1837903 Members
3289 Online
110124 Solutions
New Discussion

how recompile kernel

 
SOLVED
Go to solution
Jairo Campana
Trusted Contributor

how recompile kernel

how recompile my kernel in HPUX 11.0

and boot with my new kernel
legionx
2 REPLIES 2
Sridhar Bhaskarla
Honored Contributor
Solution

Re: how recompile kernel

Hi Jairo,

Are you planning to make modifications to any of the kernel parameters?. If so,

#cp /stand/system /stand/system.old
#/usr/lbin/sysadm/system_prep -s /stand/system
#vi /stand/system

(make modifications if needed)
#mk_kernel -o /stand/vmunix
#kmupdate
#shutdown -r now (no reboot)

This should compile the kernel for you.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
G. Vrijhoeven
Honored Contributor

Re: how recompile kernel

Hi,

I would use sam to recompile a kernel. If you like to know how it is done manually:

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90742/B2355-90742_top.html&con=/hpux/onlinedocs/B2355-90742/00/00/32-con.html&toc=/hpux/onlinedocs/B2355-90742/00/00/32-toc.html&searchterms=kernel&queryid=20040126-150108


It states:

Steps to Reconfigure the Kernel

You can use SAM or HP-UX commands to reconfigure the kernel.

To use SAM to reconfigure the kernel, log in as the superuser, ensure you are logged on to the machine for which you are regenerating the kernel, and start SAM. Select the "Kernel Configuration" menu item; use SAM's online help if needed. Generally, SAM is simpler and faster to use than the equivalent HP-UX commands.

To use HP-UX commands to reconfigure the kernel:

Log in as superuser on the machine for which a new kernel is being generated. You can log in remotely from another location by using the /usr/bin/rlogin command.

Change directory to the build environment (/stand/build). There, execute a system preparation script, system_prep. system_prep writes a system file based on your current kernel in the current directory. (That is, it creates /stand/build/system.) The -v provides verbose explanation as the script executes.
cd /stand/build
/usr/lbin/sysadm/system_prep -v -s system

Use the kmsystem command to view the kernel modules that were already selected for the next kernel build:
/usr/sbin/kmsystem -S /stand/build/system
Add absent kernel modules (like device drivers) using the kmsystem command. The -c Y option specifies the module name to be configured into the system:
/usr/sbin/kmsystem -S /stand/build/system \
-c Y driver-name

--------------------------------------------------------------------------------
Direct edits to the HP-UX system description files no longer work as in previous releases. Direct edits have no supported kernel configuration interface and are likely to introduce configuration errors. Instead, use the commands kmsystem and kmtune. These commands are new for Release 11.0; consult kmsystem(1M) and kmtune(1M) in the HP-UX Reference .

--------------------------------------------------------------------------------


Build the new kernel by invoking the mk_kernel command:
/usr/sbin/mk_kernel -s /stand/build/system
This builds a new kernel ready for testing: /stand/build/vmunix_test and the associated kernel components.

Save the old system file by moving it. Then move the new system file into place.
mv /stand/system /stand/system.prev
mv /stand/build/system /stand/system

Prepare for rebooting by invoking the kmupdate command. This sets a flag that tells the system to use the new kernel when it restarts.
/usr/sbin/kmupdate

Notify users that the system will be shut down. You can use the

/usr/sbin/wall command and/or the interactivate capabilities of the /usr/sbin/shutdown command to broadcast a message to users before the system goes down. For details, see wall(1M) , shutdown(1M) , and Shutting Down Systems.
--------------------------------------------------------------------------------
You only need to do the next steps if you are changing hardware, such as adding new peripherals. If you are simply changing a kernel parameter, reboot the system to active the new kernel with shutdown -r.

--------------------------------------------------------------------------------


Bring the system to a halt using the shutdown command.

Turn off the power to all peripheral devices and then to the SPU.

Install the hardware or remove interface cards or peripheral devices. Refer to the documents shipped with the products being installed and to Configuring HP-UX for Peripherals for specific instructions.

Turn on the power to all peripheral devices. Wait for them to become "ready", then turn on power to the SPU. The system will attempt to boot the new kernel.
If the New Kernel Fails to Boot

If the new kernel fails to boot, boot the system from the backup kernel (/stand/vmunix.prev) and repeat the process of creating a new kernel. See Booting From an Alternate Kernel for information on rebooting from a backup kernel.

HTH,

Gideon