PATCH: build-initrd.sh add MODULENAMEPREFIX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.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;

Attachment: pgpUfpWaGUKOq.pgp
Description: PGP signature


[Index of Archives]     [Kernel]     [Linux Crypto]     [Gnu Crypto]     [Gnu Classpath]     [Netfilter]     [Bugtraq]
  Powered by Linux