mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Ronald Bultje <rbultje@ronald.bitfreak.net>
Cc: kaos@ocs.com.au, linux-kernel@vger.kernel.org
Subject: Re: 2.4.21 doesn't boot: /bin/insmod.old: file not found
Date: Tue, 24 Jun 2003 09:13:01 -0700	[thread overview]
Message-ID: <20030624091301.6a22a184.shemminger@osdl.org> (raw)
In-Reply-To: <1056436551.2674.2.camel@localhost.localdomain>

On 24 Jun 2003 08:35:52 +0200
Ronald Bultje <rbultje@ronald.bitfreak.net> wrote:

> Hi Keith,
> 
> On Tue, 2003-06-24 at 02:37, Keith Owens wrote:
> > initrd needs the static version of insmod.  Copy /sbin/insmod.static.old
> > to the ramdisk and rename it as /bin/insmod.old to suit the 2.5 modutils.
> 
> Ah, right, insmod.static.old was indeed missing, I basically assumed
> it'd copy that one in automatically (since it worked for 2.4.20), but
> apparently, 2.4.20 just worked for no apparent reason while it shouldn't
> have.
> 
> Adding insmod.static.old to the ramdisk image (add the line 'inst
> /sbin/insmod.static.old "$MNTIMAGE/bin/insmod.old"' in /sbin/mkinitrd)
> fixed the issue for me. Thanks for the pointer!
> 
> Ronald

The modutils install doesn't save insmod.static (it should).  Assuming
you save the original 2.4 version as insmod.static.old, then the following
change to mkinitrd should correctly handle both 2.4 and 2.5 kernels.

--- /sbin/mkinitrd.orig	2003-06-24 09:08:21.000000000 -0700
+++ /sbin/mkinitrd	2003-05-14 14:55:55.000000000 -0700
@@ -35,6 +35,8 @@
 builtins=""
 pivot=1
 modulefile=/etc/modules.conf
+modext="o"
+insmod="/sbin/insmod.static.old"
 rc=0
 
 if [ `uname -m` = "ia64" ]; then
@@ -128,7 +130,7 @@
 	modName="sbp2"
     fi
     
-    fmPath=`(cd /lib/modules/$kernel; echo find . -name $modName.o | /sbin/nash --quiet)`
+    fmPath=`(cd /lib/modules/$kernel; echo find . -name $modName.$modext | /sbin/nash --quiet)`
 
     if [ ! -f /lib/modules/$kernel/$fmPath ]; then
 	if [ -n "$skiperrors" ]; then
@@ -276,6 +278,12 @@
     exit 1
 fi
 
+# Hack for module extension change in 2.5
+if [[ $kernel = 2.[56].* ]]; then
+    modext="ko"
+    insmod="/sbin/insmod.static"
+fi
+
 # find a temporary directory which doesn't use tmpfs
 TMPDIR=""
 for t in /tmp /var/tmp /root ${PWD}; do
@@ -461,7 +469,7 @@
 
 dd if=/dev/zero of=$IMAGE bs=1k count=$IMAGESIZE 2> /dev/null || exit 1
 
-LODEV=$(echo findlodev $modName.o | /sbin/nash --quiet)
+LODEV=$(echo findlodev $modName.$modext | /sbin/nash --quiet)
 
 if [ -z "$LODEV" ]; then
     rm -rf $MNTPOINT $IMAGE
@@ -500,7 +508,7 @@
 rm -rf $MNTPOINT/lost+found
 
 inst /sbin/nash "$MNTIMAGE/bin/nash"
-inst /sbin/insmod.static "$MNTIMAGE/bin/insmod"
+inst $insmod "$MNTIMAGE/bin/insmod"
 ln -s /sbin/nash $MNTIMAGE/sbin/modprobe
 
 for MODULE in $MODULES; do
@@ -536,7 +544,7 @@
 
 for MODULE in $MODULES; do
     text=""
-    module=`echo $MODULE | sed "s|.*/||" | sed "s/.o$//"`
+    module=`echo $MODULE | sed "s|.*/||" | sed "s/.$modext$//"`
 
     options=`sed -n -e "s/^options[ 	][ 	]*$module[ 	][ 	]*//p" $modulefile 2>/dev/null`
 
@@ -547,7 +555,7 @@
         echo "Loading module $module$text"
     fi
     echo "echo \"Loading $module module\"" >> $RCFILE
-    echo "insmod /lib/$module.o $options" >> $RCFILE
+    echo "insmod /lib/$module.$modext $options" >> $RCFILE
 
     # Hack - we need a delay after loading usb-storage to give things
     #        time to settle down before we start looking a block devices

  reply	other threads:[~2003-06-24 15:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-22 17:07 Ronald Bultje
2003-06-23  9:26 ` Keith Owens
2003-06-23 18:40   ` Ronald Bultje
2003-06-23 23:01     ` John Shillinglaw
2003-06-24  0:37     ` Keith Owens
2003-06-24  2:24       ` John Shillinglaw
2003-06-24  6:35       ` Ronald Bultje
2003-06-24 16:13         ` Stephen Hemminger [this message]
2003-06-24 21:16         ` Horst von Brand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030624091301.6a22a184.shemminger@osdl.org \
    --to=shemminger@osdl.org \
    --cc=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rbultje@ronald.bitfreak.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®