PATCH: build-initrd.sh add MODULENAMEPREFIX

markus reichelt <[email protected]>
Newsgroups gmane.linux.cryptography
Organization still stuck in reorganization mode
Message-ID <[email protected]>
Hi,

I'm using a single boot medium for different machines using the same
kernel version and found this patch to make life a bit easier.

-- 
left blank, right bald
build-initrd.sh.modulenameprefix.patch (text/plain, 2.8 KB)
--- build-initrd.sh.orig	2007-01-31 20:04:15.000000000 +0100
+++ build-initrd.sh	2007-05-11 13:25:16.000000000 +0200
@@ -125,6 +125,18 @@
 # 1 = use loop module, 0 = loop driver linked to kernel
 USEMODULE=1
 
+# Prefix of all module names. Only used if USEMODULE=1 or extra modules are
+# loaded.
+# Normally this is empty, but if you want to use the same kernel version on
+# different CPU architectures in combination with a single boot medium,
+# you can add a prefix to the module names to make sure that the correct
+# modules are loaded for each CPU architecture.
+# You might have to honour 8.3 filename conventions (syslinux USB Stick), so
+# the recommended prefix length is 4 chars max for the loop module alone.
+# In case you need additional modules loaded you might have to adapt the module
+# names in question manually to fit that convention.
+MODULENAMEPREFIX=
+
 # 1 = stop after creating and copying initrd, 0 = also copy tools/libs
 INITRDONLY=0
 
@@ -456,7 +468,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/loop");
+    strCat(buf, "/${MODULENAMEPREFIX}loop");
     strCat(buf, modext);
     strCat(buf, " ${LOOPMODPARAMS}");
     if(exeWait(buf)) goto fail5;
@@ -466,7 +478,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/${EXTRAMODULENAME1}");
+    strCat(buf, "/${MODULENAMEPREFIX}${EXTRAMODULENAME1}");
     strCat(buf, modext);
     strCat(buf, " ${EXTRAMODULEPARAMS1}");
     if(exeWait(buf)) goto fail5;
@@ -475,7 +487,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/${EXTRAMODULENAME2}");
+    strCat(buf, "/${MODULENAMEPREFIX}${EXTRAMODULENAME2}");
     strCat(buf, modext);
     strCat(buf, " ${EXTRAMODULEPARAMS2}");
     if(exeWait(buf)) goto fail5;
@@ -484,7 +496,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/${EXTRAMODULENAME3}");
+    strCat(buf, "/${MODULENAMEPREFIX}${EXTRAMODULENAME3}");
     strCat(buf, modext);
     strCat(buf, " ${EXTRAMODULEPARAMS3}");
     if(exeWait(buf)) goto fail5;
@@ -493,7 +505,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/${EXTRAMODULENAME4}");
+    strCat(buf, "/${MODULENAMEPREFIX}${EXTRAMODULENAME4}");
     strCat(buf, modext);
     strCat(buf, " ${EXTRAMODULEPARAMS4}");
     if(exeWait(buf)) goto fail5;
@@ -502,7 +514,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/${EXTRAMODULENAME5}");
+    strCat(buf, "/${MODULENAMEPREFIX}${EXTRAMODULENAME5}");
     strCat(buf, modext);
     strCat(buf, " ${EXTRAMODULEPARAMS5}");
     if(exeWait(buf)) goto fail5;
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFGRFOtLMyTO8Kj/uQRAruwAJ495FnSnVZz62PpaMjsHton1GNTyACfXvZ1
yTL46GORX++WjDBJKBA0WFw=
=YLdB
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.