Re: System.map

From: Ricky Beam (jfbeam@bluetopia.net)
Date: Thu Jun 15 2000 - 09:21:04 EST


On Wed, 14 Jun 2000, Jason Venner wrote:
>I like to run different kernels, can we set up something so
>that the right System.map is selected at boot time?

Umm, who's the "we" you refer to? Finding the correct System.map isn't the
kernel's job. That's up to your boot scripts and/or the programs that use
the map to reset any symlinks and/or use the kernel version to select the
right map.

I've been setup to relink /usr/src/linux and /boot/System.map for several
_years_. Recent RedHat versions attempt (poorly) to do this as well.
However, what works great for me won't necessarily work for you or anyone
else -- I've attached rc.relink anyway.

--Ricky

=====

#! /bin/sh
#

# Set the path
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH

# Rebuild all the kernel-version links
echo -n "Relinking kernel sensitive links:"

# >>> BOOT_IMAGE=SMP-2.0.29 <<<
# set - `cat /proc/cmdline`; eval $1
eval `cat /proc/cmdline | tr ' ' '\012' | grep BOOT`
# >>> /boot/vmlinuz-2.0.29-SMP <<<
LINUX_KERNEL=`lilo -I $BOOT_IMAGE`
# >>> System.map-2.0.29-SMP <<<
LINUX_MAP=`echo $LINUX_KERNEL | sed -e 's:/boot/vmlinuz:System.map:'`
# >>> linux-2.0.29-SMP <<<
LINUX_SOURCE=`echo $LINUX_KERNEL | sed -e 's:/boot/vmlinuz:linux:'`
# >>> 2.0.29-SMP <<<
LINUX_MODULES=`echo $LINUX_KERNEL | sed -e 's:/boot/vmlinuz-::'`

echo " [$BOOT_IMAGE -> $LINUX_KERNEL]"

if [ -e /boot/$LINUX_MAP ]; then
        echo " Map [$LINUX_MAP]"
        rm -f /boot/System.map && \
                ln -sf $LINUX_MAP /boot/System.map
fi

if [ -e /usr/src/$LINUX_SOURCE ]; then
        echo " Source [$LINUX_SOURCE]"
        rm -f /usr/src/linux && \
                ln -sf $LINUX_SOURCE /usr/src/linux
fi

## jfbeam ## no longer necessary as modutils is configured to use the
## jfbeam ## kernel version on it's own.
## if [ -e /lib/modules/$LINUX_MODULES ]; then
## echo " Modules [$LINUX_MODULES]"
## rm -f /lib/modules/default && \
## ln -sf $LINUX_MODULES /lib/modules/default
## fi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:35 EST