Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX System Administrator's Guide: Configuration Management: HP-UX 11i Version 3 > Chapter 10 Configuring the Kernel

Managing Configurations with System Files

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Every kernel configuration has a corresponding system file. A system file is a flat text file that describes all of the configuration settings in a compact, machine-readable, portable format. The format of a system file is described in detail in the system(4) manpage. It is an enhancement of the format used in previous releases of HP-UX; the previous formats are still accepted.

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:

    # kconfig –e filename
  • 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:

    kconfig -i filename

  • Import and hold for next boot:

    kconfig -h -i filename

  • 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 LineKernel Configuration Command
modulenamekcmodule modulename=best
module modulename bestkcmodule modulename=best
module modulename state [version][3]kcmodule modulename=state
(no entry for modulename)kcmodule modulename=unused
tunablename tunablevaluekctune tunablename=tunablevalue
tunable tunablename tunablevaluekctune tunablename=tunablevalue
(no entry for tunablename)kctune tunablename=default

[3] System files created by the kernel configuration tools always list the version number for each module. However, it is not required. Administrators adding module lines to a system file need not give version numbers.

Uses for System Files

System files are primarily useful in the following situations.

  1. They are useful for system administrators who are familiar with them from previous releases of HP-UX. If you are used to editing /stand/system and running mk_kernel to make configuration changes, it will still work.

  2. System files are useful if you want to apply multiple configuration changes simultaneously. You can edit a /stand/system and change three tunable values and two module states, and have all of those changes take effect together when you import the system file with kconfig -i or mk_kernel. By contrast, each invocation of one of the kernel configuration commands applies changes separately (although multiple changes listed on the same configuration command line are applied together).

    Applying multiple changes together is particularly valuable when modules are moved into or out of static state, because each command that does this will run for quite a while. This occurs because such changes require that the kernel executable be relinked. If you have multiple such changes to make, it is best that you list them all on the same kcmodule command line, or make the changes in a system file and import it. Either of these techniques will ensure that the kernel executable is only relinked once.

  3. System files are used for copying configurations from one system to another. It is not safe to copy a kernel configuration directory from one machine to another, and HP does not support doing that. However, it is perfectly safe to export a system file from a configuration on one system, move that system file to a different system, and import it there. This is an appropriate and effective way to ensure that two machines are running compatible configurations. (Compatible means they have the same set of kernel modules, but they may have different versions of those modules due to patch installations.)

    In some cases, running compatible configurations is not enough; you need to be sure that two machines are running exactly the same configuration. In that case, use the -V (version match) option while importing the system file on the target system. This option turns on strict version checking, and the import will fail if the two machines have different versions of kernel modules installed.



[2] You will be asked to confirm your changes if the system file comes from a different configuration from the one you’re changing, or if it’s out of date with respect to the configuration you’re changing.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2008 Hewlett-Packard Development Company, L.P.