Operating System - HP-UX
1834609 Members
2753 Online
110069 Solutions
New Discussion

Command line kernel build

 
SOLVED
Go to solution
MikeL_4
Super Advisor

Command line kernel build

We had a hang of one of our systems due to: kthread table full. I've made some kernel changes for this and rebuild by 11.11 kernel manually using following steps:
cd /stand/build
/usr/lbin/sysadm/system_prep -s /stand/build/system
vi /stand/build/system
/usr/sbin/mk_kernel -s /stand/build/system
mv /stand/system /stand/system.prev
mv /stand/build/system /stand/system
kmupdate /stand/build/vmunix_test

If I can get a window to reboot this server it will reboot off the new kernel, but what I noticed is the kmupdate command does not move the /stand/build/vmunix_test into /stand, when does this take place ??

If this server hangs again and I have to reset it again to reboot, will this new kernel still be moved into place ??
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: Command line kernel build

Hi Mike:

The move of the updated kernel to '/stand/vmunix' will occur during (at) the next shutdown.

Regards!

...JRF...
MikeL_4
Super Advisor

Re: Command line kernel build

So if I don't get to do a normal shutdown and reboot of the server and this server hangs again then the new kernel will not be moved into place ??

Can I just manually move the /stand/build/vmunix_test file myself manually ?? or is there something else that goes on that I would be missing ???
Victor BERRIDGE
Honored Contributor

Re: Command line kernel build

Hi,
Yes you could move the new kernel to /stand but dont forget to move also by renaming the previous /stand/vmunix to /stand/vmunix.prev BEFORE! (I did this quite a few times with HPUX 11.00...)

But then do this only when you know you will reboot the system very soon, not that it wont work but you might have to be there if the system refuses to reboot... (bad kernel and having to use vmunix.prev...)


All the best
Victor
A. Clay Stephenson
Acclaimed Contributor

Re: Command line kernel build

You should also note that directly editing system is not considered to be good practice. Kmtune is the weapon of choice; it will help from being your own worst enemy.
If it ain't broke, I can fix that.
MikeL_4
Super Advisor

Re: Command line kernel build

I didn't modify /stand/system directly, I folowed the steps I mentioned in the origional question. I am only after an answer to manually moving /stand/build/vmunix_test and /stand/build/dlk.vmunix_test over to /stand now instead of waiting for a shutdown.
The reason I want to do this is the server hung this morning with kthread tabel full errors. Should the server hang again I want to be able to reset it and reboot with the new kernel for this problem in place and not have to come up regen kernel and reboot again...
A. Clay Stephenson
Acclaimed Contributor

Re: Command line kernel build

Well, you did say that you vi'ed the system file so that sure sounds like changing it directly to me.
If it ain't broke, I can fix that.
Jon M Zellhoefer
Valued Contributor
Solution

Re: Command line kernel build

To answer your question, no - if you do not properly shut down the system (e.g. it hangs and you have to reset) - the newly compiled kernel will not be moved into place and you will boot back up on the old one.

mv /stand/vmunix /stand/vmunix.prev
mv /stand/system /stand/system.prev
mv /stand/dlkm /stand/dlkm.vmunix.prev
(in case the system doesn't like your new kernel)

Then
mv /stand/build/vmunix_test /stand/vmunix
mv /stand/build/system /stand/system
and so forth for dlkm directory

When you reboot, the system will use the copy you put there rather than the old kernel, regardless of whether the system has been properly shutdown / rebooted.

(The kernel relocation takes place at shutdown, not at boot time unless you manually copy it. Note: the manual copy can cause strangeness with some diag. utils until you reboot and match what's in memory with what's in /stand.)
MikeL_4
Super Advisor

Re: Command line kernel build

Thanks