Making Configuration Changes with System Files |
|
System files provide an alternate mechanism for
kernel configuration, because configuration changes can be made by
editing a system file and then telling the kernel configuration tools
to apply the changes. This is the kernel configuration method most
familiar to users of older versions of HP-UX.
To make configuration changes using a system file,
start with the system file corresponding to the configuration you
want to change.[2] The system automatically maintains system files for each
configuration. The system file for the currently running configuration
is located at /stand/system. The system file
for any saved configuration is located at /stand/configname/system. If you want to create
a new system file for a configuration, use the kconfig -e (export) command. This command takes two forms:
Export the running configuration:
Export a saved configuration:
# kconfig –e configname filename |
|
| |
|
| NOTE: /stand/system, and any system
file created by exporting the running configuration, always reflects
any changes that are being held for next boot. |
|
| |
|
Once you have a system file, you can edit it using
any text editor, making the changes you desire. After editing it,
you can apply the changes with the kconfig -i (import)
command. This command has three forms:
Import to running configuration
now:
Import and hold for next
boot:
Import to saved configuration:
kconfig -i configname filename
In the first form, if the changes cannot be applied
to the running system, they will be held for next boot.
For backward compatibility, the mk_kernel command is still available to apply changes made in a system file.
Note, however, that its name is no longer accurate since it will apply
configuration changes without making a kernel if it can. This command
has the form:
mk_kernel [-o target] [-s filename]
filename is the name
of the system file to read; if not specified, /stand/system is used. To import to a saved configuration, target should be the name of the configuration. To import to the currently
running system, taking effect immediately if possible, target should be /stand/vmunix. (Changes will be held until next boot if they cannot be applied
immediately.) If target is omitted, the
changes will be made to a saved configuration called hpux_test. It is not possible to import to the currently running system, forcing
changes to be held for next boot, using mk_kernel. Use kconfig -h -i for that purpose.
It is important to note that the system files
at /stand/system and /stand/configname/system are automatically recreated
after every configuration change. In this process, comments in the
system file are not preserved. Also, the ordering of lines in the
file is not preserved. Therefore, HP recommends against putting comments
in the system files. Instead, use the -C (comment)
option when importing the configuration, to add your comments directly
to the kernel configuration log file. (See “The Kernel Configuration Log File”.)
Most changes made in system files can be made
using the kernel configuration commands, and vice versa. Here are
the equivalents:
System File Line | Kernel Configuration Command |
---|
modulename | kcmodule modulename=best |
module modulename best | kcmodule modulename=best |
module modulename state [version][3] | kcmodule modulename=state |
(no entry for modulename) | kcmodule modulename=unused |
tunablename tunablevalue | kctune tunablename=tunablevalue |
tunable tunablename tunablevalue | kctune tunablename=tunablevalue |
(no entry for tunablename) | kctune tunablename=default |