Operating System - HP-UX
1834970 Members
2011 Online
110072 Solutions
New Discussion

adb to add kernel parameter.....

 
SOLVED
Go to solution
Vic S. Kelan
Regular Advisor

adb to add kernel parameter.....

Hi all,

I posted this a few days ago :
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=878600
and got a suggestion to use adb to to add a kernel parameter called core_addpid.......

Any ideas?

"Because the command
echo "core_addpid/d" | adb /stand/vmunix /dev/kmem
works, this suggests that you could use adb to alter /dev/kmem on the fly to set core_addpid to 1."

Please how do I use adb to alter /dev/kmem on the fly to set core_addpid to 1? Not much experience with adb.....

Thanks
Vic
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: adb to add kernel parameter.....

Once you have successfully added the kernel parameter, something that may cause you support issues, use kmtune to change the parameter.

kmtune -s core_addpid=1

Then process your kernel and move it to production.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kent Ostby
Honored Contributor
Solution

Re: adb to add kernel parameter.....

Vic --

Keep in mind that "on the fly" adb changes to memory can also crash your system.

Take a look at "man adb" ...

I suspect you are looking for something like:

adb -w /stand/vmunix /dev/kmem
adb>core_addpid/W1
adb>cntl-D

Note that the above only changes it in kernel memory.

To change it on your actual kernel permanently, you would do:

adb>core_addpid?W1

BUT if you do this, you may make your kernel unbootable. Ensure you have a backup copy of the kernel that will boot prior to doing this.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Vic S. Kelan
Regular Advisor

Re: adb to add kernel parameter.....

Thanks Kent and SEP, thats exactly the adb command i needed, and after your tip......dont think I will use it :-(
A. Clay Stephenson
Acclaimed Contributor

Re: adb to add kernel parameter.....

Actually, all you need to do is
echo " core_addpid/W1" | adb -w /stand/vmunix /dev/kmem

This will ONLY change the memory image of the running kernel and leave the object file, /stand/vmunix, untouched. It's a safe command and this is a common practice for changing kernel values that otherwise can't be modified. You could also force the write to the object file but I prefer to simply change the image in /dev/kmem and if you want this to be a permanent change rather than writing the object file, I prefer to setup a startup script in /sbin/init.d.


Setting core_addpid (which already exists in your kernel) to 1 will have exactly the effect you are looking for. A core.nnnnn file will be produced in the CWD rather than simply 'core'.
If it ain't broke, I can fix that.