Wednesday, April 18, 2007

HPUX: build a kernel via the command line

Sometimes it is necessary to build a kernel via the command line instead of using SAM. This document will provide the instructions to do that.

CONFIGURATION: Operating System - HP-UX Version - 10.X, 11.X Hardware System - HP 9000 Series - N/A RESOLUTION 10.X:

1. Change directories to /stand/build.
cd /stand/build

2. Create a new system file from the running kernel.
/usr/lbin/sysadm/system_prep -s /stand/build/system

3. Update the system file with the planned changes using
vi /stand/build/system or kmtune(1m).
Example setting nproc tunable to 400:
kmtune -s nproc=400 -S /stand/build/system

4. Build the new kernel.
/usr/sbin/mk_kernel -s /stand/build/system

5. Move the old system and vmunix files so if anything goes wrong, the system can be booted from the old kernel.
mv /stand/system /stand/system.prev
mv /stand/build/system /stand/system
mv /stand/vmunix /stand/vmunix.prev
mv /stand/build/vmunix_test /stand/vmunix

6. Reboot the system off the new kernel.
shutdown -r

11.X:

1. Change directories to /stand/build.
cd /stand/build

2. Create a new system file from the running kernel.
/usr/lbin/sysadm/system_prep -s /stand/build/system

3. Edit the kernel with the planned changes.
vi /stand/build/system

4. Build the new kernel.
/usr/sbin/mk_kernel -s /stand/build/system

5. Move the old system and vmunix files so if anything goes wrong, the system can be booted from the old kernel.
mv /stand/system /stand/system.prev

6. Move the new system file and new kernel into place, ready to be used when rebooting the system.
mv /stand/build/system /stand/system
kmupdate /stand/build/vmunix_test

NOTE: The kmupdate command will move the /stand/vmunix kernel to /stand/vmunix.prev and the newly created kernel to /stand/vmunix as part of the shutdown process.

7. Reboot the system off the new kernel.
shutdown -r

More information is available in the HP-UX System Administration Tasks manual. man manuals will give you ordering information and part numbers.

Most HP documentation is avaialable online at: http://www.docs.hp.com

1 comment:

Anonymous said...

Keep up the good work.