[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: System.map File



On Wed, Sep 01, 1999 at 10:38:56AM -0400, Jake Colman wrote:
> 
> What is the System.map file used for?  It seems that it must point to the map 
> for the kernel version that you are booting.  If so, how do you boot multiple 
> lernel versions safely via lilo?  You can only have on System.map symlink
> pointing a particular version's map file?

System.map is a file which maps kernel memory locations to symbol names
(basically debugging information).  It's used by the kernel syslog daemon
and a few other programs to produce human readable output when the kernel
belches out pointers in hexadecimal format.

That said, look at these magic lines in /etc/rc.d/rc.sysinit (the first
script run by init):

if [ -x /sbin/depmod -a -n "$USEMODULES" ]; then
    # Get ready for kmod if module support in the kernel
    if [ -z `uname -r | grep "-"` ]; then
       # we're using a new kernel, no preferred needed
       mver=`uname -r`
    else
       ktag="`cat /proc/version`"
       mtag=grep -l "$ktag" /lib/modules/*/.rhkmvtag 2> /dev/null
       if [ -n "$mtag" ]; then
          mver=echo $mtag | sed -e 's,/lib/modules/,,' -e 's,/.rhkmvtag,,' -e 's
,[       ].*$,,'
       fi
       if [ -n "$mver" ]; then
         ln -sf /lib/modules/$mver /lib/modules/default
       fi
    fi
    [ -n "$mver" -a -f "/boot/module-info-$mver" ] && ln -sf /boot/module-info-$
mver /boot/module-info
    [ -n "$mver" -a -f "/boot/System.map-$mver" ] && ln -sf /boot/System.map-$mv
er /boot/System.map
    action "Finding module dependencies" depmod -a
fi

What this basically means (anyone from Red Hat care to correct me?) is
that if you're using a kernel version with an "extraversion" level, like
2.2.5-22 (the way Red Hat ships it's kernels), then this code will delete
the symlink /boot/System.map and create a new one to
/boot/System.map-2.2.5-22.

If you've compiled a new kernel without the Red Hat version number, like
2.2.12, then the code will remove /boot/System.map and create a new one
pointing at /boot/System.map-$mver, where $mver is the directory name
under /lib/modules when your kernel modules were installed.  Typically,
this will be the version number (2.2.12) but if you've got many copies of
2.2.12 installed under different dirs like 2.2.12-scsi and 2.2.12-ide,
then this code will try to find that right one by taking advantage of the
fact that the kernel remembers when and where it was compiled (and allows
you to see it by cat'ing /proc/version).  It tries to find out where your
modules installed by looking in all the directories in /lib/modules for
files named .rhkmvtag and compares them to /proc/version.

The moral of the story is that if you recompiled the stock Red Hat kernel,
you should recompile it again after changing EXTRAVERSION to be something
other than -22 (let's just say -23), then after installing the new kernel
copy /usr/src/linux/System.map to /boot/System.map-2.2.5-23 and reboot.
If you've compiled a new kernel from scratch (like 2.2.12), then boot into
the new kernel and run:

cat /proc/version > /lib/modules/2.2.12/.rhkmvtag

(then reboot yet again).


-- 
Steve Borho



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]