FAI kernel image without modules.

Daniel Pittman daniel at rimspace.net
Tue Feb 4 05:20:29 CET 2003


As a rule I use kernels without module support built in for my kernels.
It's not that I care that deeply about the issue -- it's just that
having everything I use built in means that I don't have to administer
module configuration or anything like that.

So, trying to run the make-fai-nfsroot (or fai-setup) script actually
fails when the installed kernel does not have modules support.

This is caused by the depmod command in install_kernel_nfsroot()
returning an error because /lib/modules/.../ does not exist.

The appended patch will skip the module configuration stage when the
installed kernel lacks module support.[1]

          Daniel

Footnotes: 
[1]  Well, when it lacks a /lib/modules/... directory for the installed
     kernel, anyway, which is about the same thing.


--- make-fai-nfsroot.orig       Wed Feb  5 01:42:28 2003
+++ make-fai-nfsroot    Wed Feb  5 01:41:51 2003
@@ -96,9 +96,11 @@
     dpkg -x $KERNELPACKAGE $NFSROOT
     # if $NFROOT/proc/modules exists, then update-modules calls depmod -a without
     # these special flags; so umount first
-    [ -e $NFSROOT/proc/modules ] && umount $NFSROOT/proc
-    chroot $NFSROOT update-modules
-    chroot $NFSROOT depmod -a -F /boot/System.map-$KERNELVERSION $KERNELVERSION
+    if [ -d $NFSROOT/lib/modules/$KERNELVERSION ]; then
+        [ -e $NFSROOT/proc/modules ] && umount $NFSROOT/proc
+        chroot $NFSROOT update-modules
+        chroot $NFSROOT depmod -a -F /boot/System.map-$KERNELVERSION $KERNELVERSION
+    fi
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 setup_ssh() {


-- 
Time spent in the advertising business seems to create a
permanent deformity like the Chinese habit of foot-bonding.
        -- Dean Acheson



More information about the linux-fai mailing list