Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 104288 - /sbin/modules-update assumes System.map is in /usr/src/linux at boot
Summary: /sbin/modules-update assumes System.map is in /usr/src/linux at boot
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 112125 112764 119322 119947 121237 123807 123973 124517 129339 131229 143403 165020 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-30 11:30 UTC by Henrik Brix Andersen
Modified: 2007-02-03 00:37 UTC (History)
14 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for /sbin/modules-update (modules-update-system-map.patch,574 bytes, patch)
2005-09-02 12:52 UTC, Henrik Brix Andersen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Brix Andersen 2005-08-30 11:30:48 UTC
Using modules-update from sys-apps/baselayout-1.12.0_pre6-r3 I get the following
warning on every boot: "System.map not found - unable to check symbols".

This happens due to the fact that /sbin/modules-update checks for the presence
of /usr/src/linux/System.map, which is not available at boot time, since /usr is
not yet mounted.

On another note, there is no guarantee that the kernel source for the currently
running kernel is present in /usr/src/linux - this location can specified for
all portage activity using the KERNEL_DIR environment variable - or the user
could be booting an older kernel...
Comment 1 SpanKY gentoo-dev 2005-08-30 13:17:01 UTC
you'd get a warning from insmod then, so it's not like you can 'fix'
modules-update to not warn

using the wrong System.map is probably worse than getting a warning though ...
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2005-08-30 16:34:05 UTC
-----
<dsd_> ok, well that can be fixed relatively easily then
<dsd_> ie /lib/modules/2.6.13-gentoo/build/System.map
<dsd_> but the mounting prob will still exist
-----

Probably a good idea to avoid issues for when /usr/src/linux do not point to the
right place, but yeah, its not going to fix /usr on diff partition.  Only way I
can see to do that, will be to do a modules-update early during shutdown/reboot,
and then there still might be some loopholes ...
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2005-08-30 16:35:03 UTC
Actually, early in halt.sh might work.
Comment 4 Henrik Brix Andersen 2005-09-02 12:52:36 UTC
Created attachment 67505 [details, diff]
Patch for /sbin/modules-update

This patch fixed part of the problem: use the System.map from the currently
running kernel.
Comment 5 Henrik Brix Andersen 2005-10-16 14:57:34 UTC
Any chance of getting this patch applied before baselayout-1.12 goes final?
Comment 6 SpanKY gentoo-dev 2005-10-16 15:00:52 UTC
baselayout-1.12 wont be going stable for quite some time :p
Comment 7 Henrik Brix Andersen 2005-10-16 15:02:59 UTC
Then can we please have it applied to the stable branch?
Comment 8 John Mylchreest (RETIRED) gentoo-dev 2005-10-17 11:55:38 UTC
Personally, I would question if this was still needed (OK, it is but bare with me)
2.6 has successfully booted the requirement of having System.map, so the only
thing which is still needed is for a 2.4 kernel. 

Since we have gone 2.6 default, we can possibly look at this as a means for
back-compatibility and shelving support. I woudl also remove any warnigns on a
2.6 kernel as this is completely unneccessary.

Of course, I may be mistaken so please correct me but I know of nothing which
uses this anymore.
Comment 9 John Mylchreest (RETIRED) gentoo-dev 2005-10-17 11:57:03 UTC
heh.. except for depmod apparently, but I'll leave the question open anyways!
Comment 10 Henrik Brix Andersen 2005-10-29 12:44:26 UTC
Correct me if I am wrong, but isn't System.map also used for debugging the
kernel? Looking up module symbols etc?
Comment 11 John Mylchreest (RETIRED) gentoo-dev 2005-10-29 13:09:00 UTC
/proc/kallsyms supplies (afaik) identical information. I have a niggling feeling
it is lacking some very minor symbol information, but of course this is
accessible only via the running kernel configuration. IE: why System.map still
bodes a potential use.
Comment 12 Martin Schlemmer (RETIRED) gentoo-dev 2005-11-10 02:44:35 UTC
Erk, sorry, forgot about this.  How about this patch:

-----
Index: sbin/modules-update
===================================================================
--- sbin/modules-update (revision 1601)
+++ sbin/modules-update (working copy)
@@ -227,10 +227,10 @@
 # is more recent then modules.dep
 if [[ ${CFGFILE2} -nt /lib/modules/${KV}/modules.dep ]] ; then
        if [[ -d $(depdir) && -f /proc/modules ]] ; then
-               if [[ -f /usr/src/linux/System.map ]] ; then
-                       depmod -a -F /usr/src/linux/System.map ${KV}
+               if [[ -f /lib/modules/${KV}/build/System.map ]] ; then
+                       depmod -a -F /lib/modules/${KV}/build/System.map ${KV}
                else
-                       ewarn "System.map not found - unable to check symbols"
+                       depmod -a ${KV}
                fi
        fi
 fi
-----

The user's system will bork if he reboot into a broken kernel, but he should in
theory see that already at kernel install time if he uses 'make install'.

PS, John, why dont the kenrnel guids persist on copying the kernel image, and
not rather use 'make install' and then using /boot/vmlinuz or
/boot/vmlinuz-${KV} in grub/lilo ??
Comment 13 John Mylchreest (RETIRED) gentoo-dev 2005-11-10 02:55:10 UTC
I'll assume the guides use make install for simplicity reasons. In all cases, I
never use it personally.
Do you have a list of the documents which comment on "make install" at all?

I will get them changed so they also advise on:
cp arch/XXXX/boot/bzImage /boot/bzImage-KV
or vmlinuz of course.

I often just have a bzImage && bzImage-safe symlink to the appropriate files.
Comment 14 Henrik Brix Andersen 2005-11-10 03:07:52 UTC
(In reply to comment #12)
> Erk, sorry, forgot about this.  How about this patch:

Looks good to me :)

> The user's system will bork if he reboot into a broken kernel, but he should in
> theory see that already at kernel install time if he uses 'make install'.
> 
> PS, John, why dont the kenrnel guids persist on copying the kernel image, and
> not rather use 'make install' and then using /boot/vmlinuz or
> /boot/vmlinuz-${KV} in grub/lilo ??

How is that related to this bug?
Comment 15 Martin Schlemmer (RETIRED) gentoo-dev 2005-11-10 03:12:28 UTC
(In reply to comment #14)
> (In reply to comment #12)

> > The user's system will bork if he reboot into a broken kernel, but he should in
> > theory see that already at kernel install time if he uses 'make install'.
> > 
> > PS, John, why dont the kenrnel guids persist on copying the kernel image, and
> > not rather use 'make install' and then using /boot/vmlinuz or
> > /boot/vmlinuz-${KV} in grub/lilo ??
> 
> How is that related to this bug?
> 

Err, because I forgot that 'make modules_install' does the 'depmod -ae ...'. 
Its anyhow easier ;p
Comment 16 Martin Schlemmer (RETIRED) gentoo-dev 2005-11-10 03:28:33 UTC
Committed to svn.
Comment 17 SpanKY gentoo-dev 2005-11-10 15:57:04 UTC
*** Bug 112125 has been marked as a duplicate of this bug. ***
Comment 18 SpanKY gentoo-dev 2005-11-16 21:17:14 UTC
*** Bug 112764 has been marked as a duplicate of this bug. ***
Comment 19 Jakub Moc (RETIRED) gentoo-dev 2006-01-17 11:35:34 UTC
*** Bug 119322 has been marked as a duplicate of this bug. ***
Comment 20 Jakub Moc (RETIRED) gentoo-dev 2006-01-22 09:23:51 UTC
*** Bug 119947 has been marked as a duplicate of this bug. ***
Comment 21 MickKi 2006-02-13 03:59:40 UTC
According to this link: http://www.dirac.org/linux/system.map/ klogd looks into:
/boot/System.map 
/System.map 
/usr/src/linux/System.map
to find System.map.  My /usr is on a different to my / partition and I never had any problems until the recent baselayout update.  I assume that the copy of System.map in the /boot worked fine for the last few years.  Could it be reverted to look into /boot as well as /usr/src/linux?
-- 
Regards,
Mick
Comment 22 Daniel Drake (RETIRED) gentoo-dev 2006-02-13 07:55:38 UTC
What problems have you run into after the baselayout update?

Also, is there any particular reason you use klogd? The functionality it uses System.map for is fully implemented into the kernel (kallsyms).
Comment 23 MickKi 2006-02-15 10:48:12 UTC
Sorry, perhaps I didn't explain myself properly.  I don't have any 'real' problems following the last baselayout update, other than the "System.map not found - unable to check symbols" error message coming up when I boot.  This causes some delay to my booting, but that's all.  I didn't know that klogd has been superseded by kallsyms (too technical for me to know) - so was merely guessing as to what has gone amiss with my system lately.
-- 
Regards,
Mick
Comment 24 Jakub Moc (RETIRED) gentoo-dev 2006-02-23 08:32:21 UTC
*** Bug 123807 has been marked as a duplicate of this bug. ***
Comment 25 Jakub Moc (RETIRED) gentoo-dev 2006-02-23 08:34:53 UTC
*** Bug 121237 has been marked as a duplicate of this bug. ***
Comment 26 Jakub Moc (RETIRED) gentoo-dev 2006-02-24 12:43:00 UTC
*** Bug 123973 has been marked as a duplicate of this bug. ***
Comment 27 Jakub Moc (RETIRED) gentoo-dev 2006-03-01 06:14:32 UTC
*** Bug 124517 has been marked as a duplicate of this bug. ***
Comment 28 Mike Green 2006-04-02 21:51:38 UTC
I have recently noticed this bug every time I attempt to do a modules-update.  I have no idea if my /etc/modprobe.conf or map files (which hotplug depends on) are being generated completely or successfully, all I see is the error message.  

I see it mentioned in the comments that a fix has been committed to svn, I can't seem to locate the svn repository, so I can't see what the fix was.  I have been manually copying System.map to /boot/System.map-x.x.x for at least 10 years, why has this behavior changed recently in gentoo?  Does the fix involve supporting System.map being in /boot, as other apps such as procps and klogd do?

Comment 29 Cletus Lichte 2006-04-03 00:16:23 UTC
This bug still exists on my system too.  I get the error whenever I boot up.  I see the bug has been closed and marked as fixed.  Where do I find the fix?
Comment 30 Jakub Moc (RETIRED) gentoo-dev 2006-04-09 06:01:52 UTC
*** Bug 129339 has been marked as a duplicate of this bug. ***
Comment 31 Cletus Lichte 2006-04-19 15:06:56 UTC
I applied this patch and it doesn't work.  The line /lib/modules/${KV}/build/System.map is just a symlink to /usr/src/linux !  I changed the line to /lib/modules/${KV}/System.map and placed a copy of System.map in this dir and now everything is working.
Comment 32 Jakub Moc (RETIRED) gentoo-dev 2006-04-25 08:59:59 UTC
*** Bug 131229 has been marked as a duplicate of this bug. ***
Comment 33 Nathan Adams 2006-07-30 18:38:04 UTC
A simple workaround is to do this after each kernel installation:

# cp /usr/src/linux/System.map /
Comment 34 Paul Sumner 2006-08-09 17:28:16 UTC
*** Bug 143403 has been marked as a duplicate of this bug. ***
Comment 35 Jakub Moc (RETIRED) gentoo-dev 2007-02-02 22:12:43 UTC
*** Bug 165020 has been marked as a duplicate of this bug. ***
Comment 36 Jakub Moc (RETIRED) gentoo-dev 2007-02-03 00:37:23 UTC
*** Bug 165020 has been marked as a duplicate of this bug. ***