Finding (was:Re: Kernel Profiling???? Please explain...)

Robert Wuest (
Sun, 03 Nov 1996 13:01:53 -0600

Hans Lermen wrote:
> On Sun, 3 Nov 1996, DPD wrote:
> > > > - make sure you have the file that corresponds to your
> > > > kernel
> > > > in your root directory (this should be done automatically for
> > > > you if you use "make zlilo" to create the kernel)
> > How can I assure that I have the proper '' file???
> After a 'make bzImage' you have /usr/src/linux/, you should save
> this along with the kernel image. If you boot different kernels, the
> 'right' should be '/' (maybe via a link).
> =
> Hans
> <>

I currently store all of my kernels and files
in /boot. So I have zImage-2.0.24 and a corresponding And I use (in rc.local):

VERSION=`/bin/uname -a | /usr/bin/cut -d\ -f3`

in my rc.local to access the 'right' map (and create /etc/issue).

I like the idea of making a link to / such that
it would always be the right one, and immediately ran into
the problem where if I apply the reverse patch to sock.c to
profile the result, I have two 2.0.24 kernels. I'm thinking
about something like using the following:

VEXT=`/bin/uname -a | /usr/bin/md5sum | cut -b1-4`

and having${VEXT} files in /boot.
Then a:

ln -sf /boot/${VEXT} /

should get the right file (if 4 digits is enough to always
be unique).

Two questions:

1. Is there a standard way to get the exact uname info
from an unbooted kernel image so I know what VEXT is
before rebooting ( to install I can
find the string in my /usr/src/linux/vmlinux file.

2. Is there a way to know what boot image was booted
in a running system? I could just run the kernel image
through md5sum to get an extension.

Maybe there's a better way to get a unique identifier. Something
that can be determined before and after booting a new kernel.


Empowered by Linux.