Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 59188 - modules-update runs depmod and should not
Summary: modules-update runs depmod and should not
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-02 14:12 UTC by Guy Martin (RETIRED)
Modified: 2005-07-15 02:59 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guy Martin (RETIRED) gentoo-dev 2004-08-02 14:12:49 UTC
At the end of the modules-update script, depmod is run.

But this cause a problem when building livecd.
Catalyst runs modules-update for each builded kernel but on hppa, one kernel is for 32 bit box and on other for 64bit.

When you run depmod for the kernel arch you're not running, depmod produce errors like "modules not for this arch" unless you set UNAME_MACHINE to the right arch AND leaves the modules.dep empty even if a correct one was build previously.
This leaves a broken modprobe for either 32 or 64 bit depending the arch you build it with. This is bug #58548.

So what are the possibles fixes :
1) do not run modules-update in catalyst
2) find a way to detect which arch is the target kernel and set UNAME_MACHINE correctly either in catalyst or in modules-update
3)do not run depmod in modules-update

My personal toughs about thoses solutions :
1) it may be needed for things like alsa so it's not a option.
2) this could produce more bugs and is not easy to do
3) the only reason modules-update runs depmod is to change the timestamp of modules.dep to avoid harmless warning messages. this is a good solution

So for me the right solution is the third one. Replacing depmod by touch -r should be enough.
Comment 1 SpanKY gentoo-dev 2004-08-03 05:25:01 UTC
should tie this in with the livecd USE flag
Comment 2 Thomas Mueller 2004-08-25 02:37:48 UTC
The problem isn't limited to livecd building.

Any time you try to boot a kernel that /usr/src/linux happens not to point to at the moment (because you are maintainig more than one kernel in the same root filesystem), that kernel's modules.dep file is broken during the /etc/init.d/modules script, generally causing hotplugging to go completely haywire  or even to hang. 

Hence, it's not really a good idea to tie this to any USE flag.

On the other hand, there is something to be said for having modules-update leaving a clean state and reporting unresolved symbols when called interactively.

I would like to suggest the following:

if [ -d "`depdir`" -a -f /proc/modules ]
then
  if [ -f /usr/src/linux-${KV}/System.map ]; then
    depmod -a -F /usr/src/linux-${KV}/System.map ${KV}
  else
    echo "warning: system map file not found - unable to check symbols"
  fi
fi
Comment 3 SpanKY gentoo-dev 2005-07-14 07:12:22 UTC
the modules init.d script no longer runs modules-update for livecds

the proposed change to modules-update also looks good to me ... i think
we should merge it into baselayout 1.12.x
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2005-07-15 02:15:12 UTC
Something like this:

-----
Index: sbin/modules-update
===================================================================
--- sbin/modules-update (revision 1297)
+++ sbin/modules-update (working copy)
@@ -230,7 +230,7 @@
                if [[ -f /usr/src/linux/System.map ]] ; then
                        depmod -a -F /usr/src/linux/System.map ${KV}
                else
-                       depmod -a ${KV}
+                       ewarn "System.map not found - unable to check symbols"
                fi
        fi
 fi
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2005-07-15 02:59:02 UTC
Added, thanks.