Modify kernel using kconfig in HPUX 11i v3

From Wiki-UX.info
Jump to: navigation, search

The kernel parameters can be change on HP-UX 11i v2/v3 (11.23/11.31) using "kconfig" saved kernel templates instead of using kcweb or SMH. This method is particularly useful to troubleshoot kernel compilation or dynamic parameters modification problems.

The kernel build process is accomplished through the following steps:

1. Change directory to "/stand" mount point.

 # cd /stand

2. Create a kernel parameter system file from the running system

# kconfig -s myconfig

A directory called myconfig will be created under /stand and that will contain all the current running kernel configuration state.

# ll -d /stand/myconfig
drwx------   5 root       sys           1024 Aug  7 13:11 /stand/myconfig

# ll /stand/myconfig
total 60752
-rw-------   1 root       sys              0 Aug  7 13:11 .config
-rw-------   1 root       sys            147 Aug  7 13:11 README
drwx------   3 root       sys           1024 Aug  7 13:11 bootfs
drwx------   2 root       sys           1024 Aug  7 13:11 krs
drwx------   2 root       sys           1024 Aug  7 13:11 mod
-rw-------   1 root       sys           4327 Aug  7 13:11 system
-rwxr-xr-x   6 root       sys        30939392 Jul  1 15:28 vmunix

3. Check the current state of the system parameters or modules using kctune, kcmodule commands. For example:

# kctune -c myconfig -q filecache_max -q filecache_min
Tunable         Value  Expression
filecache_max  (auto)  25%
filecache_min  (auto)  10%

Make changes to the current system configuration using the kmsystem, kmtune or kmadmin commands. For example:

# kctune -c myconfig filecache_max=10% filecache_min=5%
       * The requested changes have been applied to the configuration
         'myconfig'.
Tunable                   Value  Expression
filecache_max  (before)  (auto)  25%
               (now)     (auto)  10%
filecache_min  (before)  (auto)  10%
               (now)     (auto)  5%

Verify that the new value(s) has been commited to the configuration file, by checking the difference from the original set:

# kctune -c myconfig -q filecache_max -q filecache_min
Tunable         Value  Expression
filecache_max  (auto)  10%
filecache_min  (auto)  5%

4. Change directory to /stand/build. While you are in the /stand/build directory, build a new kernel using mk_kernel command:

# cd /stand/build
# /usr/sbin/mk_kernel -v -s /stand/myconfig/system -o mybuild
       * The configuration 'mybuild' has been imported from
         '/stand/myconfig/system'.

5. Change directory to stand. Check the created kernel build.

# cd /stand
# ll mybuild
total 60752
-rw-------   1 root       sys              0 Aug  7 13:51 .config
-rw-------   1 root       sys            147 Aug  7 13:51 README
drwx------   3 root       sys           1024 Aug  7 13:51 bootfs
drwx------   2 root       sys           1024 Aug  7 13:51 krs
drwx------   2 root       sys           1024 Aug  7 13:51 mod
-rw-------   1 root       sys           4328 Aug  7 13:51 system
-rwxr-xr-x   7 root       sys        30939392 Jul  1 15:28 vmunix

6. Apply kernel build

# kconfig -l mybuild
       * The automatic 'backup' configuration has been updated.
       * The requested changes have been applied to the currently
         running configuration.
       * The configuration 'mybuild' has been loaded and is now in use.