From Wiki-UX.info

How to build a test kernel on HP-UX 11i v2
Jump to: navigation, search

How to build a test kernel on HP-UX 11i v2

Contents

Abstract

The following article explains how to build a new kernel from the command line interface (CLI) for testing kernel build process using kernel modules. The procedures describe applies to HP-UX 11i v2.

1. Change directory to /stand

# cd /stand


2. Verify that /stand/testbuild directory does not exists

# ls -ld /stand/testbuild


3. Save current kernel configuration as testbuild.

# kconfig -s testbuild
      * The current configuration has been saved to 'testbuild'.
# ls -ld /stand/testbuild
drwxr-xr-x   5 root       sys           8192 Jul  3 13:49 /stand/testbuild
# ll /stand/testbuild
total 125472
-rw-r--r--   1 root       sys              0 Jul  3 13:43 .config
-rw-r--r--   1 root       sys            147 Jul  3 13:43 README
drwxr-xr-x   3 root       sys             96 Jul  3 13:43 bootfs
drwxr-xr-x   2 root       sys             96 Jul  3 13:43 krs
drwxr-xr-x   2 root       sys           8192 Jul  3 13:43 mod
-rw-r--r--   1 root       sys           3535 Jul  3 13:43 system
-rwxr-xr-x   4 root       sys        64211664 Jul  2 19:32 vmunix <-- Modification date

Note that the modification date of the /stand/testbuild/vmunix file is older that the kernel configuration files because is a copy of the current kernel.


4. Check the status of a common kernel module, that can be removed or added from the /stand/testbuild/vmunix kernel file to test the build process. The schgr module, used to support Tape Libraries robotic arms is a good candidate.

# kcmodule -c testbuild schgr
Module  State   Cause
schgr   unused


5. Add or remove the kernel module (the module is added in the example). The command will initiate a kernel build when a module is added | removed from the kernel.

# kcmodule -c testbuild schgr=static
       * Building a new kernel for configuration 'testbuild'...
       * Adding version information to new kernel...
       * The requested changes have been applied to configuration
         'testbuild'.
Module            State   Cause
schgr   (before)  unused
        (now)     static  explicit

If an error is encountered during the kernel build process it will be reported during this step, for example missing kernel module files:

# kcmodule -c testbuild schgr=static
ERROR:   The configuration is supposed to include a module 'sasd_vbus'
         which is not installed on the system.


6. Check the /stand/testbuid/vmunix file has been modified.

# ll /stand/testbuild
total 125568
-rw-r--r--   1 root       sys              0 Jul  3 13:43 .config
-rw-r--r--   1 root       sys            147 Jul  3 13:43 README
drwxr-xr-x   3 root       sys             96 Jul  3 13:43 bootfs
drwxr-xr-x   2 root       sys             96 Jul  3 13:43 krs
-rw-r--r--   1 root       sys          13853 Jul  3 13:49 ldargs
drwxr-xr-x   2 root       sys           8192 Jul  3 13:43 mod
-rw-r--r--   1 root       sys           3539 Jul  3 13:49 system
-rwxr-xr-x   1 root       sys        64242520 Jul  3 13:50 vmunix   <-- Modification date

Additional commands

  • To delete a saved configuration:
# kconfig -d testbuild
  • To schedule a saved configuration to be used at next boot:
# kconfig -n testbuild
  • To load a saved configuration:
# kconfig -l testbuild
  • To check a tunable on the saved configuration:
# kctune -c testbuild -q <tunable>
  • To check a module on a saved configuration:
# kcmodule -c testbuild -q <module>

Reference

Authors

This page was last modified on 20 November 2009, at 15:45. This page has been accessed 1,532 times.