PATCH: build-initrd.sh add MODULEDIRECTORY

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

a cleaner approach this time (I hope...)

-- 
left blank, right bald
build-initrd.sh.moduledirectory.patch (text/plain, 2.6 KB)
--- build-initrd.sh.orig	2007-01-31 20:04:15.000000000 +0100
+++ build-initrd.sh	2007-05-11 15:53:27.000000000 +0200
@@ -125,6 +125,15 @@
 # 1 = use loop module, 0 = loop driver linked to kernel
 USEMODULE=1
 
+# Directory to look for modules under /boot/modules-`uname -r`/
+# 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 use this to make sure that the correct modules are loaded for each
+# CPU architecture. MODULEDIRECTORY must end with a /
+# Example: MODULEDIRECTORY="`hostname`/"
+MODULEDIRECTORY=""
+
 # 1 = stop after creating and copying initrd, 0 = also copy tools/libs
 INITRDONLY=0
 
@@ -456,7 +465,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/loop");
+    strCat(buf, "/${MODULEDIRECTORY}loop");
     strCat(buf, modext);
     strCat(buf, " ${LOOPMODPARAMS}");
     if(exeWait(buf)) goto fail5;
@@ -466,7 +475,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/${EXTRAMODULENAME1}");
+    strCat(buf, "/${MODULEDIRECTORY}${EXTRAMODULENAME1}");
     strCat(buf, modext);
     strCat(buf, " ${EXTRAMODULEPARAMS1}");
     if(exeWait(buf)) goto fail5;
@@ -475,7 +484,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/${EXTRAMODULENAME2}");
+    strCat(buf, "/${MODULEDIRECTORY}${EXTRAMODULENAME2}");
     strCat(buf, modext);
     strCat(buf, " ${EXTRAMODULEPARAMS2}");
     if(exeWait(buf)) goto fail5;
@@ -484,7 +493,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/${EXTRAMODULENAME3}");
+    strCat(buf, "/${MODULEDIRECTORY}${EXTRAMODULENAME3}");
     strCat(buf, modext);
     strCat(buf, " ${EXTRAMODULEPARAMS3}");
     if(exeWait(buf)) goto fail5;
@@ -493,7 +502,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/${EXTRAMODULENAME4}");
+    strCat(buf, "/${MODULEDIRECTORY}${EXTRAMODULENAME4}");
     strCat(buf, modext);
     strCat(buf, " ${EXTRAMODULEPARAMS4}");
     if(exeWait(buf)) goto fail5;
@@ -502,7 +511,7 @@
     buf[0] = 0;
     strCat(buf, "/lib/insmod /lib/modules-");
     strCat(buf, &un.release[0]);
-    strCat(buf, "/${EXTRAMODULENAME5}");
+    strCat(buf, "/${MODULEDIRECTORY}${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)

iD8DBQFGRHV+LMyTO8Kj/uQRAr/ZAKCGGBDpvfLfBWwNPxDlRper5eQi8gCfcDP3
Bzamqtzwifm8YpWFAaS2BRM=
=MtGV
-----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.