LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (http://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   System.map - what to do when I have multiple kernels in LILO? (http://www.linuxquestions.org/questions/linux-kernel-70/system-map-what-to-do-when-i-have-multiple-kernels-in-lilo-436583/)

brgr88 04-18-2006 10:30 PM

System.map - what to do when I have multiple kernels in LILO?
 
When I compile a new kernel, I get a System.map file that I'm supposed to move into my /boot directory. This is according to the Slackware docs, but I'm assuming this applies to all distros which is why I'm posting here. Anyway...

I configure LILO to be able to boot from the new kernel(s) as well as the old one, but shouldn't each kernel require the System.map file that was made for when that kernel was compiled? If I'm reading this right, then I'll have to rename/copy System.map every time I want to boot a different kernel? I would think that sort of defeats the purpose of what LILO is supposed to do.

The manpage for lilo.conf didn't specify any options for a different System.map filename per image entry (the same way you can use a different kernel name in the 'image=' stmt.), so I guess I'm a little confused here.

What really is System.map doing that is getting changed each time I compile a kernel? And can I just keep using the same one for different kernels (even different kernel versions)?

If each kernel does require its own, custom System.map file, is there a way via LILO to specify this in that image's lilo.conf entry?

geomatt 04-19-2006 08:28 AM

I don't know if this is the right thing to do but here is what I have done when having more than one kernel on my system.

Suppose I have multiple kernels in the /boot directory called, say, vmlinuz, vmlinuz.old, and vmlinuz.veryold. Each has its own System file called System.map, System.old, and System.veryold, respectively. (I just rename everything including the current kernel and System.map file before installing the new kernel. Then I install by running "make install" which places the new kernel and System.map file in the /boot directory, and automatically runs lilo).

lilo.conf has the following entries:

image = /boot/vmlinuz
root = /dev/hda1
label = Linux
read-only

image = /boot/vmlinuz.old
root = /dev/hda1
label = Linux-old
read-only

image = /boot/vmlinuz.veryold
root = /dev/hda1
label = Linux-veryold
read-only

That seems to do the trick -- enabling me to boot all three kernels. Again, I do not know if this approach is theoretically correct, but maybe someone else will jump in here and educate us about the mysteries of the System.map file....


-geo

rkelsen 04-19-2006 08:48 AM

Quote:

Originally Posted by brgr88
If each kernel does require its own, custom System.map file, is there a way via LILO to specify this in that image's lilo.conf entry?

Each kernel does require its own System.map file:

Code:

$ ls /boot
README.initrd@
System.map-2.6.11
System.map-2.6.14
System.map-2.6.16.1
boot.0300
config-2.6.11
config-2.6.14
config-2.6.16.1
map
memtest.bin
vmlinuz-2.6.11
vmlinuz-2.6.14
vmlinuz-2.6.16.1
$

And the relevant part of /etc/lilo.conf:
Code:

image=/boot/vmlinuz-2.6.11
  root=/dev/hda6
  label="2.6.11"
  vga=795
  read-only
image=/boot/vmlinuz-2.6.14
  root=/dev/hda6
  label="2.6.14"
  vga=795
  read-only
image=/boot/vmlinuz-2.6.16.1
  root=/dev/hda6
  label="2.6.16.1"
  vga=795
  read-only

I've never had problems doing things this way. Each kernel finds its own System.map without issue.

HTH.

Edit: I found a good website:

http://www.dirac.org/linux/system.map/

Have fun!

geeman2.0 04-19-2006 09:48 AM

Quote:

Edit: I found a good website:

http://www.dirac.org/linux/system.map/

Have fun!
Nice link!
It explained a lot, but it raises an important question which it leaves unanswered at the end.

If I have multiple kernels of the same version, each with different features enabled, how does the system determine which System.map to use?

ioerror 04-19-2006 11:20 AM

Quote:

If I have multiple kernels of the same version, each with different features enabled, how does the system determine which System.map to use?
Use the extra version variable to give each kernel a unique version number. With 2.4, edit the Makefile (before runing make dep), with 2.6 just use the "local version" option in the config.


All times are GMT -5. The time now is 04:47 AM.