Operating System - HP-UX
1834441 Members
2448 Online
110067 Solutions
New Discussion

Re: Kernel rebuilding problem

 
Jun Zhang_4
Regular Advisor

Kernel rebuilding problem

I have 11.0 runs on D370. After modifying the system file, mk_kernel created the vmunix_test file. I then did kmupdate, and got the following message,
kmupdate: Specified file /stand/build/vmunix_test is not kernel file
Same procedure was carried out on an E35 without a problem.

Jun
Food lover
12 REPLIES 12
Helen French
Honored Contributor

Re: Kernel rebuilding problem

Some possible tries:

1) Check the output of "file /stand/build/vmunix_test" and see the output. Post the output

2) Check the revision of /etc/magic file (sometimes, this file might have been corrupted or on a wrong version) - 'what /etc/magic"

3) Install this patch (or the latest) if you haven't already - PHCO_24285 (awk patch)
Life is a promise, fulfill it!
Stanimir
Trusted Contributor

Re: Kernel rebuilding problem

Hi!
I thing there is something wrong in your procedure of editing&creating kernel on
hp-ux 11. You have 2 ways after you prepare your /stand/system and have to
choise 1 of them:

1.
#mk_kernel -s ./system
- this created /stand/build/vmunix_test
#kmupdate /stand/build/vmunix_test
- and your kernel is ready to boot.

OR:

2.
#mk_kernel -s ./system -o /stand/vmunix
- this will create vmunix at once.

Try to check your steps or try second variant. And dont forget backup of old vmunix. :)

Good luck.
Stan.
Jun Zhang_4
Regular Advisor

Re: Kernel rebuilding problem

# file vmunix_test
vmunix_test: PA-RISC1.1 executable -not stripped
# what /etc/magic
/etc/magic:
$Revision: 80.3 $
Installed PHCO_27251 (supersedes PHCO_24285).
Tried kmupdate, got the same message.

The output of "file vmunix_test" is the same as the output of "file vmunix".

Jun
Food lover
Jun Zhang_4
Regular Advisor

Re: Kernel rebuilding problem

Thanks for the replies.
# mk_kernel -s system -o /stand/vmunix
Generating module: krm...
Compiling conf.c...
Loading the kernel...
Generating kernel symbol table...

Kernel update request is scheduled.

Default kernel /stand/vmunix will be updated by
newly built kernel /stand/build/vmunix_test
at next system shutdown or startup time.

The above sounds like kmupdate executed implicitly. The /stand/vmunix is still the previous one, though. I'll go ahead reboot and tell you the result.

Jun
Food lover
Jun Zhang_4
Regular Advisor

Re: Kernel rebuilding problem

The system boot up fine, with the new kernel as /stand/vmunix.
I went back to follow the first method mentioned in Stan's message, and got
kmupdate: Specified file /stand/build/vmunix_test is not kernel file
again. What can you say?

Jun
Food lover
Dietmar Konermann
Honored Contributor

Re: Kernel rebuilding problem

Jun,

the /usr/sbin/kmupdate command is only a shell script that can be easily trouble-shooted.

First create a backup of it:
# mv /usr/sbin/kmupdate /usr/sbin/kmupdate.org
# cp -p /usr/sbin/kmupdate.org /usr/sbin/kmupdate

Then edit the script and place a "set -x" just at the beginning of the shell function "check_kernel_image". The next kmupdate run should give you more information.

I suspect that kmupdate fails to find some important kernel symbols using nm(1).

The next step would be to check the result of the nm command in question. Should look like this:

# nm -pghN /stand/build/vmunix_test |grep -e rootdev -e bdevsw -e cdevsw
0008073688 D bdevsw
0008070040 D bdevsw_shadow
0008058816 D cdevsw
0008045552 D cdevsw_shadow
0008650960 D rootdev
0009448336 B mod_bdevsw_lock
0009448352 B mod_cdevsw_lock
0008355736 D cdevsw_lkinfo
0008355720 D bdevsw_lkinfo

Don't forget to restore the original file:

# mv /usr/sbin/kmupdate.org /usr/sbin/kmupdate


Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Jun Zhang_4
Regular Advisor

Re: Kernel rebuilding problem

Dietmar,
The nm command didn't give me anything beside the coming back of the shell promt. Running kmupdate with sh -x gave me the following the lines below.

Jun

# kmupdate
+ umask 022
+ PATH=/usr/local/bin:/opt/perl/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib
/bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/u
sr/bin/X11:/usr/contrib/bin/X11:/opt/hparray/bin:/opt/ignite/bin:/opt/resmon/bin
:/usr/sbin/diag/contrib:/opt/pred/bin:/opt/perf/bin:/opt/hpnpl//bin:/sbin:/opt/u
ltplus/bin:/opt/gnuplot/bin/X11:/usr/sbin:/usr/bin:/sbin
+ ROOT=
+ KMUPDATE=kmupdate
+ KMADMIN=kmadmin
+ KMMODREG=kmmodreg
+ KMTYPEINIT=kmtypeinit
+ KMPATH=kmpath
+ STAND=/stand
+ BUILD=/stand/build
+ CONF=/usr/conf
+ TMP=/tmp
+ KERN_DEF=/stand/vmunix
+ KERN_PREV=/stand/vmunix.prev
+ KERN_TEST=/stand/build/vmunix_test
+ KM_D=/usr/conf/km.d
+ KMC_DEF=/stand/dlkm
+ + kmc_path /stand/vmunix.prev
KMC_PREV=/stand/dlkm.vmunix.prev
+ + kmpath -c
+ 2> /dev/null
KMC=/stand/dlkm
+ [ 0 -ne 0 ]
+ MOD_D=/stand/dlkm/mod.d
+ MOD_BLD_D=/stand/dlkm/mod_bld.d
+ SYSTEM_D=/stand/dlkm/system.d
+ NODE_D=/stand/dlkm/node.d
+ UPDATE_UX_FILE=/stand/.update_ux
+ UPDATE_MOD_FILE=/stand/dlkm/.update_mod
+ UPDATE_MODS=
+ IMMEDIATE_MODS=
+ ACTIVATE_MODS=
+ ENABLED_MODS=
+ ASYNC_MODS=
+ UNLOADED_MODS=
+ SUCCESS=0
+ ERROR=1
+ cmd_err=0
+ first_msg=1
+ WORK_FILE=/tmp/.km_work5070
+ LOCK_FILE=/tmp/.kmupdate
+ mflag=0
+ iflag=0
+ aflag=0
+ kflag=0
+ typeset -i argcnt=0
+ MVsrc=mv
+ OS_VIRSION_UP=
+ getopts :M:iak OPT
+ (( argcnt=OPTIND-1 ))
+ [ 0 -gt 0 ]
+ shift 0
+ [ 0 -eq 0 ]
+ [ 0 -eq 1 ]
+ [ 0 -eq 1 ]
+ [ 0 -eq 1 ]
+ [ 0 -eq 0 ]
+ KERN_src=/stand/build/vmunix_test
+ trap 1 2 3 15
+ lock_me
+ [ 0 -ne 0 ]
+ [ 0 -eq 0 ]
+ update_kernel
kmupdate: Specified file /stand/build/vmunix_test is not kernel file.
+ [ 1 -ne 0 ]
+ unlock_me
+ exit 1


Food lover
Dietmar Konermann
Honored Contributor

Re: Kernel rebuilding problem

Jun,

just have a look at the nm executable. Maybe it'corrupted somehow? Or truncated? What's the result of:

# what $(whence nm)
# ll $(whence nm)

Best regards...
Dietmar.

"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Jun Zhang_4
Regular Advisor

Re: Kernel rebuilding problem

what /usr/local/bin/nm
(blank)
ll /usr/local/bin/nm
-rwxr-xr-x 2 root sys 135168 May 31 15:51 /usr/local/bin/nm
file /usr/local/bin/nm
/usr/local/bin/nm: PA-RISC1.1 shared executable dynamically linked


Jun
Food lover
Dietmar Konermann
Honored Contributor

Re: Kernel rebuilding problem

Well, obviously your PATH includes /usr/local/bin before /bin, so you seem not to use the genuine HP-UX nm command.

This is the result from my box:

$ what $(whence nm)
/bin/nm:
HP aC++ B3910B A.03.30 Classic Iostream Library
HP aC++ B3910B A.03.30 Language Support Library
nm.cat: $Revision: 1.0 $
92453-07 linker command s800.sgs nm PA64 B.11.32 REL 020412

ll $(whence nm)
lr-xr-xr-t 1 root sys 15 Feb 25 1999 /bin/nm@ -> /usr/ccs/bin/nm

Please check what happens if you include /bin in yout PATH _before_ /usr/local/bin.

Best regards...
Dietmar.


"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Norman_21
Honored Contributor

Re: Kernel rebuilding problem

Jun,

Download and install the following patch: PHCO_24285 awk(1) patch

Does rc.log have the following:

Update kernel and loadable modules
Output from "/sbin/rc1.d/S110kmbuild start":
----------------------------
ERROR: Cannot find the newly built kernel function set directory
"//dlkm.vmunix_test".
EXIT CODE: 1
"/sbin/rc1.d/S110kmbuild start" FAILED

Please keep us updated.
Thanks

"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Dietmar Konermann
Honored Contributor

Re: Kernel rebuilding problem

Jun,
don't bother with awk... nm is your problem.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)