LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   System.map curiosities... (https://www.linuxquestions.org/questions/linux-newbie-8/system-map-curiosities-175392/)

strsst 04-28-2004 01:08 AM

System.map curiosities...
 
My questions concern the creation of a new kernel and booting the old kernel...The Slackware book suggests that you "...add a section to boot your old kernel in case your new one does not work." Now, the new system.map file (when the installation of the new kernel is complete) is associated with the new kernel image.

1. If I boot the old kernel, does the system use the old system.map file or the new file (or the specified file)? I have read about lilo and how to specify a system.map file. It seems that the mapfile setting is a global setting (I tried to set it in the image section of the file and quickly learned that I could not do this since lilo gave me an error on the line where I had the map file specified)...

///////////////////////////////////////////////////
The following code is INCORRECT
////////////////////////////////////////////////////

#-------------------------------------------------
#New Kernel Section, after 4-8-04
image = /boot/vmlinuz.beast
map=/boot/System.map.beast "<-- Error here"
root = /dev/hda5
label = swlinux_beast
read-only # Non-UMSDOS filesystems should be mounted read-only for checking
# Linux bootable partition config ends


///////////////////////////////////////////////////
The following code is correct
////////////////////////////////////////////////////

# Start LILO global section
boot = /dev/fd0
map = /boot/System.map <-- mapfile specified in the global section

2. If the old kernel uses the new map file, won't there be errors between the old kernel and the new map file?

3. Does there need to be a new boot disk for each kernel or can you have many kernels boot from one boot disk and use the same map file?

4. I understand this may be a trivial matter and I would love to read more about this topic. Is there anywhere on the internet or in print where I could read more about the relationship between the kernel and the map file?

Thanks in advance!

Qucho 04-28-2004 03:15 AM

I have no idea about the function of the system.map file, I am a big newbie :p

But after several custom kernels I have made, I never worried for such file. I just compile the kernel installed and choose what kernel to run at boot.

I never had a problem. :)

AutOPSY 04-28-2004 03:46 AM

System.map is a symbolic link to the newest Sytem.map file.
example, 2.4 kernel.

System.map -> System.map-2.4.20-6

BTW, I couldn't answer your question, because I cannot decipher what your asking.

AutOPSY 04-28-2004 03:49 AM

2. If the old kernel uses the new map file, won't there be errors between the old kernel and the new map file?

The kernel and the mapfile are not the same files, nor contain the same content.
Why would there be "errors" between them?

Kroenecker 04-28-2004 04:26 AM

This link clearly explains the system map:

www.dirac.org/p/linux/system.map/

strsst 04-30-2004 08:04 AM

Thanks for the replies. I apologize for being unclear in my first post. My thoughts were that when you recompiled the kernel, the new system.map file takes precidence over any other system.map file in the file system regardless of any other kernel you use. The "Recompiling The Kernel" instructions in the Slackware book explain this clearly.

However, would there be errors if in fact you used the old kernel with the new system.map file (or any other system.map file)? The Slackware book suggests that you may use your old kernel to boot your system in case your new kernel crashed the system or didn't work for whatever reason. When I compiled the new kernel and compared the old system.map file to the new system.map file, the size was different. I began to suspect something may go wrong if I used an old kernel with the new system.map file. When I first tried it everything went well and nothing crashed.... THAT TIME nothing crashed with that kernel, but what about with other kernels using the same system.map file? (see example below)

Obviously, when you select the new kernel to boot, there shouldn't be a problem because the new system.map file that was created when the new kernel was compiled is used.

BUT, when you select the old kernel, you still use the new system.map file. My question basically was, will this cause any problems? We know it won't when we use the new kernel. However, will it when we use other kernels?

This can be taken further because if you create multiple kernels and would like to boot them from the same bootdisk, you will use the most recently created system.map file. So now you have 5 kernels and each are using the new system.map file. Now I ask the question, "do you need to create a boot disk for each new kernel, one that uses the associated system.map file?"

AutOPSY, I understand that the kernel and the system.map are 2 different files. After recompiling the kernel several times, this fact becomes trivial. Another trivial fact is that system.map is a symbolic link. The instructions in the Slackware book explicity show this. I was using system.map as a general reference. There would be no errors when used in conjunction with each other, however my question is "would there be a problem if a kernel not created at the same time as a system.map file was used to boot a system?" For example:

Boot time:

New.Kernel ---> uses ---> System.map.new
No Errors!!


Old.Kernel ---> uses ---> System.map.new
Possible errors???


Old.Kernel.FitsOnFloppy ---> uses ---> System.map.new
Possible errors???


Old.Kernel.GBitEthernet ---> uses ---> System.map.new
Possible errors???


Old.Kernel.P4Optimized ---> uses ---> System.map.new
Possible errors???


(please note: all kernels located on same system)

The code I provided was to illustrate how lilo processes the 'map=' parameter. An error will be generated if the map files is not specified globally. In other words, you will get an error if you list the map file setting within your linux kernel section. Lilo won't update the boot configuration on your floppy (or harddrive).

Kroenecker, the link you provided was excellent. There is much more information about linux located at that particular site...check it out if you haven't already done so.

Anyway, the moral of the story is: has anybody else out there had problems using multiple kernels with a single system.map file?

Thanks again for all of your replies!

Kroenecker 04-30-2004 08:38 AM

I would recommend that you read or reread the link that I posted because to be honest I can tell that you didn't read it at all or didnt read it thoroughly.

Qucho 04-30-2004 09:27 PM

Quote:

I would recommend that you read or reread the link that I posted because to be honest I can tell that you didn't read it at all or didnt read it thoroughly.
indeed !!! LOL....

Now I even know that I could DELETE my system.map entirely from my compu and worry not more than if my coffe has cream on it !! ;P

strsst 05-01-2004 03:40 AM

Thanks. didn't read the bottom part. you should really check out the rest of the site. good stuff.

////////////////////////////////////////////////////////////
How Do I Remedy The Above Situation?

The solution is to keep all your System.map files in /boot and rename them with the kernel version. Suppose you have multiple kernels like:

/boot/vmlinuz-2.2.14
/boot/vmlinuz-2.2.13

Then just rename your map files according to the kernel version and put them in /boot, like:

/boot/System.map-2.2.14
/boot/System.map-2.2.13

Now what if you have two copies of the same kernel? Suppose you have two copies of 2.2.14. One compiled with sound, and the other without sound:

/boot/vmlinuz-2.2.14
/boot/vmlinuz-2.2.14.nosound

The best answer would be if all software looked for the following files:

/boot/System.map-2.2.14
/boot/System.map-2.2.14.nosound

But to be honest, I don't know if this is the best situation. Everything I've seen searches for "System.map-version" but what about "System.map-version.extraversion"? I have no idea (TODO).
////////////////////////////////////////////////////////////


All times are GMT -5. The time now is 08:20 AM.