View previous topic :: View next topic |
Author |
Message |
ova Retired Dev
Joined: 06 Nov 2003 Posts: 120 Location: Russia, Moscow
|
Posted: Sun Apr 25, 2004 1:20 pm Post subject: The right place for System.map! |
|
|
Hi all!
I'm not going to explain what is System.map. If you are interested in look here:http://www.dirac.org/linux/systemmap.html/.(This link I've found searching Gentoo forum.)
But I am going to state The right place for System.map in Gentoo distribution, because neither Gentoo Handbook nor searching forum can not give me the right(!) place for it.
Yes. The handbook tells us:
Code: |
# cp System.map /boot/System.map-2.4.24
|
But look in your logs. What is it:
Code: |
kernel: Cannot find map file.
|
This is klogd trying to tell us that it can not find System.map file.
Why is it? Because if you follow The Gentoo Handbook, then you have /boot partion, which is normally unmounted. And when klogd starts it can not find System.map file in your /boot partition.
So the right place for this file is "/"
or you should unmount /boot before coping there System.map file, but the first variant is better.
Also If you have different versions of kernel you need to use different names for this file. As I could find out this is undocumented bu this naming convention works (at least for me): System.map-<kernel version>-<kernel subversion>.
E.g. for my gentoo kernel linux-2.4.25-gentoo-r2. After compilling of new kernel I am doing:
Code: |
# cp System.map /System.map-2.4.25-gentoo-r2.
|
And everything is Ok!
Correct me if I'm wrong. Comment's are also welcome. |
|
Back to top |
|
|
Souperman Guru
Joined: 14 Jul 2003 Posts: 449 Location: Cape Town, South Africa
|
Posted: Sun Apr 25, 2004 3:21 pm Post subject: |
|
|
Thanks for the link. I've always kinda wondered what the System.map file is for but never really bothered to investigate it.
System.map files in (unmounted by default) /boot
Code: | # strace -f /usr/sbin/klogd 2>&1 |grep 'System.map'
open("/boot/System.map-2.6.5-gentoo-r1", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/boot/System.map", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/System.map-2.6.5-gentoo-r1", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/System.map", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) |
/var/log/syslog wrote: | Code: | Apr 25 17:14:28 desktop kernel: klogd 1.4.1, log source = /proc/kmsg started.
Apr 25 17:14:28 desktop kernel: Cannot find map file. |
|
System.map files moved to /
Code: | # strace -f /usr/sbin/klogd 2>&1 |grep 'System.map'
open("/boot/System.map-2.6.5-gentoo-r1", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/boot/System.map", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/System.map-2.6.5-gentoo-r1", O_RDONLY|O_LARGEFILE) = 2
open("/System.map-2.6.5-gentoo-r1", O_RDONLY|O_LARGEFILE) = 3
open("/System.map-2.6.5-gentoo-r1", O_RDONLY|O_LARGEFILE) = 3 |
/var/log/syslog wrote: | Code: | Apr 25 17:18:23 desktop kernel: klogd 1.4.1, log source = /proc/kmsg started.
Apr 25 17:18:23 desktop kernel: Inspecting /System.map-2.6.5-gentoo-r1
Apr 25 17:18:23 desktop kernel: Loaded 25902 symbols from /System.map-2.6.5-gentoo-r1.
Apr 25 17:18:23 desktop kernel: Symbols match kernel version 2.6.5.
|
|
I guess you could put them in /boot before mounting it, as it seems to look there first. Should save you a few microseconds at boot. _________________ moo |
|
Back to top |
|
|
scruff Tux's lil' helper
Joined: 28 Nov 2003 Posts: 142 Location: Boston, MA
|
Posted: Sun Apr 25, 2004 3:27 pm Post subject: |
|
|
Great link! Cleared up a bit of the System.map mystery for me. Though it looks as if it doesn't really matter whether it is located in /boot /usr/src/linux, or /.
Quote: |
Upon bootup, if klogd isn't given the location of System.map as an argument, it will look for System.map in three places, in the following order:
1. /boot/System.map
2. /System.map
3. /usr/src/linux/System.map
For instance, suppose you're running kernel 2.4.18 and the associated map file is /boot/System.map. You now compile a new kernel 2.5.1 in the tree /usr/src/linux. During the compiling process, the file /usr/src/linux/System.map is created. When you boot your new kernel, klogd will first look at /boot/System.map, determine it's not the correct map file for the booting kernel, then look at /usr/src/linux/System.map, determine that it is the correct map file for the booting kernel and start reading the symbols.
|
So according to the author, klogd is intelligent enough to search for, and determine the correct System.map. It is odd that your log showed it couldn't find it though... _________________
AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ @ oc'd to 2.3ghz
DFI Lanparty UltraD nForce4 SLI
2x1gb Geil PC4000
GeForce 7800GT
Sound Blaster Audigy Platinum
200gb Maxtor DiamondMax 10
74gb WD Raptor 10k RPM
|
|
Back to top |
|
|
mike4148 l33t
Joined: 09 Sep 2003 Posts: 641
|
Posted: Sun Apr 25, 2004 3:52 pm Post subject: |
|
|
Most importantly,
means that you don't have to put System.map anywhere, if /usr/src/linux is on your root filesystem -- just leave it alone after building your kernel. If /usr/src/linux is on a separate filesystem (i.e., that will not be mounted when the kernel looks for it), you'll need to copy it to /. |
|
Back to top |
|
|
Souperman Guru
Joined: 14 Jul 2003 Posts: 449 Location: Cape Town, South Africa
|
Posted: Sun Apr 25, 2004 5:21 pm Post subject: |
|
|
mike4148 wrote: | Most importantly,
means that you don't have to put System.map anywhere, if /usr/src/linux is on your root filesystem -- just leave it alone after building your kernel. If /usr/src/linux is on a separate filesystem (i.e., that will not be mounted when the kernel looks for it), you'll need to copy it to /. |
Sure, except /usr/src/linux may not always point to the current kernel. _________________ moo |
|
Back to top |
|
|
deadaim Guru
Joined: 27 Oct 2003 Posts: 467 Location: Florida
|
Posted: Sun Apr 25, 2004 6:42 pm Post subject: |
|
|
In the Gentoo documentation, it says to do the following:
Code: | mount /boot
cp /usr/src/linux/System.map /boot/System.map |
Since klogd looks in /usr/src/linux/ for your System.map file, you shouldn't have any problem unless you mv the file. |
|
Back to top |
|
|
stahlsau Guru
Joined: 09 Jan 2004 Posts: 584 Location: WildWestwoods
|
Posted: Sun Apr 25, 2004 7:18 pm Post subject: |
|
|
nice link, put some light into my dark brain
Wondered a long time what this file is for, now i know a little more. Also good to know that i don't have to copy it anymore, since klogd searches in /usr/src/linux |
|
Back to top |
|
|
p2cd3 Tux's lil' helper
Joined: 29 Apr 2004 Posts: 95
|
Posted: Thu May 06, 2004 9:54 pm Post subject: |
|
|
Yes this does explain System.map, my problem is that it is in /boot/System.map & /usr/src/linux/System.map but has a file size of 0 |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|