View previous topic :: View next topic |
Author |
Message |
humble_programmer n00b
Joined: 08 Apr 2004 Posts: 25 Location: Germany
|
Posted: Mon Mar 21, 2005 3:34 pm Post subject: Why am I copying System.map to /boot? |
|
|
After successfully building, tweaking, and installing multiple kernels on my Gentoo system, I'm left with one noobie question that I can't find a good answer to: "Why am I copying System.map to /boot?" I can understand copying bzImage (duh) and even the .config file--so that it can be recovered after I bork up /usr/src/linux--but what's with System.map? Does anything (other than the installation guide) use it? What for? Is that enough questions? _________________ Cheers!
,,,^..^,,, |
|
Back to top |
|
|
AliasXZ l33t
Joined: 08 Feb 2005 Posts: 847 Location: England, Wakefield
|
Posted: Mon Mar 21, 2005 3:45 pm Post subject: |
|
|
System.map is a "map" of your kernel. It contains info about the entry points of the functions you compiled into your kernel, and de-bug information. The kernel itself knows the addresses and entry-points, but that file is needed for some programs which need info about kernel entry points. _________________ Main:
Kernel: 5.4.38 amd64
RAM: 4GB
Lappy:
Macbook Pro 10.14.6
------------------------------
Please add (solved) to your first post when your issue is resolved |
|
Back to top |
|
|
Pink Veteran
Joined: 24 Jul 2003 Posts: 1062
|
Posted: Mon Mar 21, 2005 4:48 pm Post subject: |
|
|
Then again.....
After using many, many kernels including every final and rc candidate (with the 2.6 kernel and many with the 2.4 kernel), plus countless patchsets downloaded, plus countless of my own patchsets (I like to play ) I have never put the System.map in my boot folder and experienced zero concerns.
I have also looked and failed to find an answer as to why it is needed.
Seen plently of posts like AliasXZ's which, in all due respect, was simply copied and pasted from here: http://www.aplawrence.com/Bofcusm/643.html and fail to answer why it is needed.
As I say, I have never, not once, had it in my boot partition and have tried, literally, hundreds of kernels, and had absolutely zero negative result from not having the System.map.
I would dearly love to see a proper explanation, with replicable examples i.e. show me what does not work correctly without System.map - my experience of searching for 'the' answer will result in posts like these two - some quoting someone else with no evidence of anything and all having a caveat (One of the first lines on the link above is 'Although there was no conclusive evidence') or people who have never used it and have seen no reason to use it.
Challenge on.....
PS I am serious, if anyone can find a real reason to use it then I will - it's just that I never have and have never seen any evidence to use it. |
|
Back to top |
|
|
hielvc Advocate
Joined: 19 Apr 2002 Posts: 2805 Location: Oceanside, Ca
|
Posted: Mon Mar 21, 2005 5:43 pm Post subject: |
|
|
Ive wondered about System.map myself and never found a really good explaination till this morning Peter's Notes:System.map. This is an easy read with details of what it is and the several ways that it is used. _________________ An A-Z Index of the Linux BASH command line
Last edited by hielvc on Tue Mar 22, 2005 3:34 am; edited 1 time in total |
|
Back to top |
|
|
Pink Veteran
Joined: 24 Jul 2003 Posts: 1062
|
Posted: Mon Mar 21, 2005 6:06 pm Post subject: |
|
|
Interesting link - thanks. It does give a more concrete answer than I have seen before.
Hmmm, klogd looks in /usr/src/linux/System.map by default (amongst the other two places) and I don't use Dosemu. So that is probably why I have never run into any problems but it could be advisable to have it in /boot as a general rule.
An interesting thought though, and I may have missed when System.map is called upon by whatever prog uses it, but a default Gentoo install has a /boot partition that is not mounted.
Now, unless something unexpected is occuring, how would Dosemu get to the /boot/System.map?
Any pointers as to how something can access a file in a (deliberately) unmounted partition? |
|
Back to top |
|
|
Pink Veteran
Joined: 24 Jul 2003 Posts: 1062
|
Posted: Tue Mar 22, 2005 8:17 am Post subject: |
|
|
judging from the lack of response, the answer is that a programme is not able to read a file from an unmounted partition - exactly the reason a default Gentoo install does not mount /boot.
humble_programmer:
As you can see from the last 2 or 3 posts, there is absolutely no need whatsoever to have System.map in the boot partition. The only thing that could use it on bootup also searches for it in /usr/src/linux/System.map, which is another reason the symlink should always point to your working kernel, something you should always ensure occurs. Anything else is simply not able to read the file in /boot anyway.
HTH |
|
Back to top |
|
|
hielvc Advocate
Joined: 19 Apr 2002 Posts: 2805 Location: Oceanside, Ca
|
Posted: Tue Mar 22, 2005 6:01 pm Post subject: |
|
|
pink I agree its hard to read an unmounted partition. What Im curious about is why dont the progs check out /proc/ksyms or why is it there? _________________ An A-Z Index of the Linux BASH command line |
|
Back to top |
|
|
Pink Veteran
Joined: 24 Jul 2003 Posts: 1062
|
Posted: Tue Mar 22, 2005 6:53 pm Post subject: |
|
|
hielvc wrote: | pink I agree its hard to read an unmounted partition. What Im curious about is why dont the progs check out /proc/ksyms or why is it there? |
I honestly don't know - I'm not really into what calls what from where, if you see what I mean.
I think a more experienced programmer (which I am not) would be able to give more pointers. To be frank, my main concern these days is that it works and I'm not too concerned as to the technical details as to why. I just got into this thread as I truly believe that System.map always was a waste of space and effort (in the /boot partition).
edit: Oooh, that was my 1000th post! |
|
Back to top |
|
|
pilla Bodhisattva
Joined: 07 Aug 2002 Posts: 7731 Location: Underworld
|
Posted: Tue Mar 22, 2005 9:55 pm Post subject: |
|
|
Moved from IG _________________ "I'm just very selective about the reality I choose to accept." -- Calvin |
|
Back to top |
|
|
rowbin hod n00b
Joined: 08 Jan 2005 Posts: 50
|
Posted: Tue Mar 22, 2005 11:12 pm Post subject: |
|
|
I just assumed that it was a backup for the version in /usr/src/linux. Say you bork the source directory, then you have a backup of not only your config file (also saved in /boot) but also the system map for whatever needs it.
And to me, /boot seems like an excellent place to keeps it for the reason that it isn't mounted by default. That way, you're never going to lose it through human error! |
|
Back to top |
|
|
electrofreak l33t
Joined: 30 Jun 2004 Posts: 713 Location: Ohio, USA
|
Posted: Wed Mar 23, 2005 6:46 am Post subject: |
|
|
the program strace uses it. That program traces what programs do... for debugging purposes. |
|
Back to top |
|
|
Jengu Guru
Joined: 28 Oct 2004 Posts: 384
|
Posted: Wed Mar 23, 2005 7:30 am Post subject: |
|
|
electrofreak wrote: | the program strace uses it. That program traces what programs do... for debugging purposes. |
Does it look in /usr/src/linux first too though? |
|
Back to top |
|
|
slashdevslashtty Tux's lil' helper
Joined: 29 Aug 2004 Posts: 119 Location: 97219
|
Posted: Wed Mar 23, 2005 8:00 am Post subject: |
|
|
Not first. Actually, third. But it does fall back on /usr/src/linux/System.map |
|
Back to top |
|
|
Pink Veteran
Joined: 24 Jul 2003 Posts: 1062
|
Posted: Wed Mar 23, 2005 8:19 am Post subject: |
|
|
slashdevslashtty wrote: | Not first. Actually, third. But it does fall back on /usr/src/linux/System.map |
That is the whole point - there is no need to have all these files lying around in /boot (unless you want a backup, but that's what a backup in a serperate hdd/partition is for surely?) I mean, how do you bork your entire /usr/src/linux directory? You have the same chance of 'accidentally' wiping your /etc directory or your /usr/bin directory as doing that.
So lets see:
Anything that might use it also looks in the place it is automatically put: /usr/src/linux
Nothing can see it /boot because /boot is deliberately not mounted - strace, etc cannot use it!
It comes down to a simple answer:
if you want System.map in /boot, then put it there. There is no technical reason why it should go there and no programme can access it when it is in /boot.
Not exactly compelling reasons for spending effort putting it there. |
|
Back to top |
|
|
|