Skip to contentSkip to conversation

2.4.21 doesn't boot: /bin/insmod.old: file not found

DISCUSSION Ronald Bultje 5 participants 9 messages Jun 22, 2003 – Jun 24, 2003

lore
Share & tools
lore
#0 lore raw

Hey,

I'm trying to get 2.4.21 to run (2.4.20 runs nicely), and I get the above error ("/bin/insmod.old: file not found"), after which it stops booting.

After that, I installed the newest modutils (2.4.25) and module-init-tools (tried both 0.9.12 and 0.9.13-pre), created symlinks in /bin for all *mod* tools pointing to /sbin/$file, and I still cannot get 2.4.21 to get further than this error (obviously, /bin/insmod.old _is there_, I'm not that stupid. ;) ). I use initrd with filesystem modules and some more in it, so obviously it fails with a panic saying that /sbin/init wasn't found (no single HD mounted).

Of course, I could place ext3 in-kernel, but that's not the point. 2.4.21 doesn't boot for me as is - 2.4.20 does. I can't continue 2.5.x testing if I remove the module-init-tools and only use modutils (I'm doing that on another system, and that one works well with 2.4.21).

Does this sound familiar to anyone? Does someone know a solution that will allow me to keep on using initrd images in 2.4.x, while also being able to test 2.5.x?

System: RH73 (mostly), gcc-2.96.

Thanks,

Ronald

Signature · 1 line
Ronald Bultje <[email protected]>
#1 lore raw
Quoted 7 lines · Ronald Bultje

After that, I installed the newest modutils (2.4.25) and module-init-tools (tried both 0.9.12 and 0.9.13-pre), created symlinks in /bin for all *mod* tools pointing to /sbin/$file, and I still cannot get 2.4.21 to get further than this error (obviously, /bin/insmod.old _is there_, I'm not that stupid. ;) ). I use initrd with filesystem modules and some more in it, so obviously it fails with a panic saying that /sbin/init wasn't found (no single HD mounted).

Did you copy /bin/insmod.old to the initrd that you are booting from? Is /bin/insmod.old a static binary?

#2 lore raw

Hi Keith,

Quoted 10 lines · Keith Owens
Quoted 7 lines · Ronald Bultje

After that, I installed the newest modutils (2.4.25) and module-init-tools (tried both 0.9.12 and 0.9.13-pre), created symlinks in /bin for all *mod* tools pointing to /sbin/$file, and I still cannot get 2.4.21 to get further than this error (obviously, /bin/insmod.old _is there_, I'm not that stupid. ;) ). I use initrd with filesystem modules and some more in it, so obviously it fails with a panic saying that /sbin/init wasn't found (no single HD mounted).

Quoted 2 lines

Did you copy /bin/insmod.old to the initrd that you are booting from? Is /bin/insmod.old a static binary?

/bin/insmod.old is a symlink to the dynamically linked binary in /sbin/insmod.old. The static one is in /{s,}bin/insmod.static.old. Should I swap them around?
Also, I did recreate the initrd image (that should be enough, right?), but still get the same error on bootup.

Thanks,

Ronald

Signature · 1 line
Ronald Bultje <[email protected]>
#3 lore raw

I am getting the same unexplained error message: Can't run /bin/insmod.old, file doesn't exist, when trying to load jbd.o and ext3.o. My system is running Redhat 9, and the error occurs with 2.4.21, and 2.4.22-pre1

I have 2.4.21-rc7-ac1 booting fine. It seems I came across the same error when first booting from that kernel, but I can't figure out what I did to make it work.

This is a strange error so I'm not sure what info to post. Not being able to boot and run on 2.4.21/22 is holding me up from important projects, so everyone please help, or tell me what info I should send in order to solve the problem.

John Shillinglaw

Quoted 25 lines · Ronald Bultje

Hi Keith,

Quoted 10 lines · Keith Owens
Quoted 7 lines · Ronald Bultje

After that, I installed the newest modutils (2.4.25) and module-init-tools (tried both 0.9.12 and 0.9.13-pre), created symlinks in /bin for all *mod* tools pointing to /sbin/$file, and I still cannot get 2.4.21 to get further than this error (obviously, /bin/insmod.old _is there_, I'm not that stupid. ;) ). I use initrd with filesystem modules and some more in it, so obviously it fails with a panic saying that /sbin/init wasn't found (no single HD mounted).

Quoted 2 lines

Did you copy /bin/insmod.old to the initrd that you are booting from? Is /bin/insmod.old a static binary?

/bin/insmod.old is a symlink to the dynamically linked binary in /sbin/insmod.old. The static one is in /{s,}bin/insmod.static.old. Should I swap them around?
Also, I did recreate the initrd image (that should be enough, right?), but still get the same error on bootup.

Thanks,

Ronald

#4 lore raw
In reply to Ronald Bultje
Quoted 7 lines · Ronald Bultje
Quoted 2 lines · Keith Owens

Did you copy /bin/insmod.old to the initrd that you are booting from? Is /bin/insmod.old a static binary?

/bin/insmod.old is a symlink to the dynamically linked binary in /sbin/insmod.old. The static one is in /{s,}bin/insmod.static.old. Should I swap them around?

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.

#5 lore raw

Aha, Thanks,

Is there a howto page yet that tells all about how the old and new module utilities work? I'm sure it's right under my nose...

BTW, after vowing not to, I solved the problem by simply making ext3 part of bzImage.

Now I got back to 2.5.73...

Thanks again,
Ian

Quoted 3 lines · Keith Owens

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.

#6 lore raw
In reply to Keith Owens

Hi Keith,

Quoted 2 lines · Keith Owens

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

Signature · 1 line
Ronald Bultje <[email protected]>
#7 lore raw
Quoted 11 lines · On 24 Jun 2003 08:35:52 +0200 Ronald Bultje <[email protected]> wrote:

Hi Keith,

Quoted 2 lines · Keith Owens

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.

Quoted 5 lines

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 renamed from sbin/mkinitrd.orig +13 -5
@@ -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
#8 lore raw
In reply to Ronald Bultje

Ronald Bultje <[email protected]> said:

[...]

Quoted 3 lines

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!

I'd make that:

[ -x /sbin/insmod.old ] && inst /sbin/insmod.static.old "$MNTIMAGE/bin/insmod.old"

Just paranoia...

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513