no initrd modules stuff
authorBrad House <brad_mssw@gentoo.org>
Tue, 23 Dec 2003 04:07:16 +0000 (04:07 +0000)
committerBrad House <brad_mssw@gentoo.org>
Tue, 23 Dec 2003 04:07:16 +0000 (04:07 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@31 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_cmdline.sh
gen_determineargs.sh
gen_initrd.sh
generic/linuxrc
genkernel.sh

index ef18dc94837d2f438a2e6571d6e031621b253c59..bcb36b6c43f0a1cf1aca813fcd8b5e7a08ca13f2 100755 (executable)
@@ -26,7 +26,8 @@ usage() {
   echo "       --no-install            Do not install kernel after building"
   echo "       --kerneldir=<dir>       Location of kernel source"
   echo "       --kernel-config=<file>  Kernel configuration file to use for compilation"
-  echo "  Low-Level Compile settings"
+  echo "        --no-initrdmodules      Don't copy modules to initrd" 
+ echo "  Low-Level Compile settings"
   echo "       --kernel-cc=<compiler>  Compiler to use for kernel (e.g. distcc)"
   echo "       --kernel-ld=<linker>    Linker to use for kernel"
   echo "       --kernel-as=<assembler> Assembler to use for kernel"
@@ -142,6 +143,10 @@ parse_cmdline() {
                                CMD_NOINSTALL=1
                                print_info 2 "CMD_NOINSTALL: $CMD_NOINSTALL"
                        ;;
+                       --no-initrdmodules)
+                               CMD_NOINITRDMODULES=1
+                               print_info 2 "CMD_NOINITRDMODULES: $CMD_NOINITRDMODULES"
+                       ;;
                        --arch-override*)
                                CMD_ARCHOVERRIDE=`parse_opt "${x}"`
                                print_info 2 "CMD_ARCHOVERRIDE: $CMD_ARCHOVERRIDE"
index e26b55ee148cf027abbacd8f1b52179846bee0db..057f85ba14800fa2a96f8b862b4c5721afd4ac8e 100644 (file)
@@ -122,4 +122,8 @@ determine_real_args() {
                MINKERNPACKAGE="${CMD_MINKERNPACKAGE}"
        fi
 
+       if [ "${CMD_NOINITRDMODULES}" != "" ]
+       then
+               NOINITRDMODULES="${CMD_NOINITRDMODULES}"
+       fi
 }
index c61d0d6c812ae9520222a579d29e0f5a069d9c44..1bfbf56407b776830238fbfe66402842a3f66ce7 100644 (file)
@@ -53,17 +53,20 @@ create_base_initrd_sys() {
        bunzip2 "${TEMP}/initrd-temp/bin/busybox.bz2" || gen_die "could not uncompress busybox"
        chmod +x "${TEMP}/initrd-temp/bin/busybox"
 
-       if [ "${PAT}" -gt "4" ]
+       if [ "${NOINITRDMODULES}" = "" ]
        then
-               cp "${MODULE_INIT_TOOLS_BINCACHE}" "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die "could not copy insmod.static from bincache"
-       else
-               cp "${MODUTILS_BINCACHE}" "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die "could not copy insmod.static from bincache"
+               if [ "${PAT}" -gt "4" ]
+               then
+                       cp "${MODULE_INIT_TOOLS_BINCACHE}" "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die "could not copy insmod.static from bincache"
+               else
+                       cp "${MODUTILS_BINCACHE}" "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die "could not copy insmod.static from bincache"
+               fi
+
+               bunzip2 "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die "could not uncompress insmod.static"
+               mv "${TEMP}/initrd-temp/bin/insmod.static" "${TEMP}/initrd-temp/bin/insmod"
+               chmod +x "${TEMP}/initrd-temp/bin/insmod"
        fi
 
-       bunzip2 "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die "could not uncompress insmod.static"
-       mv "${TEMP}/initrd-temp/bin/insmod.static" "${TEMP}/initrd-temp/bin/insmod"
-       chmod +x "${TEMP}/initrd-temp/bin/insmod"
-
        cp "${DEVFSD_BINCACHE}" "${TEMP}/initrd-temp/bin/devfsd.bz2" || gen_die "could not copy devfsd executable from bincache"
        bunzip2 "${TEMP}/initrd-temp/bin/devfsd.bz2" || gen_die "could not uncompress devfsd"
        chmod +x "${TEMP}/initrd-temp/bin/devfsd"
@@ -98,44 +101,30 @@ create_initrd_modules() {
        else
                MOD_EXT=".o"
        fi
-#      local modc i mods mymod
-#      for modc in storage firewire ataraid pcmcia usb
-#      do
-#      for 
-#              mkdir -p ${TEMP}/initrd-temp/lib/modules/${modc}
-#              mods=`echo $modc | tr [:lower:] [:upper:]`_MODULES
-#              eval mymods=\$$mods
-#              for i in ${mymods}
-               for i in `gen_dep_list`
-               do
-                       print_info 2 "$i : module searching" 1 0
-                       mymod=`find /lib/modules/${KV} -name "${i}${MOD_EXT}"`
-                       if [ -z "${mymod}" ]
-                       then
-                               print_info 2 "Warning : ${i}${MOD_EXT} not found; skipping..."
-                               continue;
-                       fi
-                       print_info 2 "copying ${mymod} to initrd"
-                       cp -ax --parents "${mymod}" "${TEMP}/initrd-temp"
-               done
-#      done
+       for i in `gen_dep_list`
+       do
+               print_info 2 "$i : module searching" 1 0
+               mymod=`find /lib/modules/${KV} -name "${i}${MOD_EXT}"`
+               if [ -z "${mymod}" ]
+               then
+                       print_info 2 "Warning : ${i}${MOD_EXT} not found; skipping..."
+                       continue;
+               fi
+               print_info 2 "copying ${mymod} to initrd"
+               cp -ax --parents "${mymod}" "${TEMP}/initrd-temp"
+       done
 
        cp -ax --parents /lib/modules/${KV}/modules* ${TEMP}/initrd-temp
 
-#      cat ${GK_SHARE}/${ARCH}/linuxrc | sed   -e "s/%%STORAGE_MODULES%%/${STORAGE_MODULES}/" \
-#                                              -e "s/%%FIREWIRE_MODULES%%/${FIREWIRE_MODULES}/" \
-#                                              -e "s/%%ATARAID_MODULES%%/${ATARAID_MODULES}/" \
-#                                              -e "s/%%PCMCIA_MODULES%%/${PCMCIA_MODULES}/" \
-#                                              -e "s/%%USB_MODULES%%/${USB_MODULES}/" \
-#                                              > ${TEMP}/initrd-temp/linuxrc
-
        mkdir -p "${TEMP}/initrd-temp/etc/modules"
        print_list ${SCSI_MODULES} > "${TEMP}/initrd-temp/etc/modules/scsi"
        print_list ${FIREWIRE_MODULES} > "${TEMP}/initrd-temp/etc/modules/firewire"
        print_list ${ATARAID_MODULES} > "${TEMP}/initrd-temp/etc/modules/ataraid"
        print_list ${PCMCIA_MODULES} > "${TEMP}/initrd-temp/etc/modules/pcmcia"
        print_list ${USB_MODULES} > "${TEMP}/initrd-temp/etc/modules/usb"
+}
 
+create_initrd_aux() {
        if [ -f "${GK_SHARE}/${ARCH}/linuxrc" ]
        then
                cp "${GK_SHARE}/${ARCH}/linuxrc" "${TEMP}/initrd-temp/linuxrc"
@@ -167,6 +156,7 @@ create_initrd_modules() {
        chmod +x "${TEMP}/initrd-temp/etc/initrd.scripts"
        chmod +x "${TEMP}/initrd-temp/etc/initrd.defaults"
        chmod +x "${TEMP}/initrd-temp/sbin/modprobe"
+
 }
 
 calc_initrd_size() {
@@ -182,8 +172,16 @@ create_initrd() {
        print_info 1 "initrd: creating base system"
        create_base_initrd_sys
 
-       print_info 1 "initrd: copying modules"
-       create_initrd_modules
+       if [ "${NOINITRDMODULES}" = "" ]
+       then
+               print_info 1 "initrd: copying modules"
+               create_initrd_modules
+       else
+               print_info 1 "initrd: not copying modules"
+       fi
+
+       print_info 1 "initrd: copying auxilary files"
+       create_initrd_aux
 
        print_info 1 "initrd: calculating initrd size"
        INITRD_CALC_SIZE=`calc_initrd_size`
index 1269ada2fa704b6cbab5e666af718349d2c70548..67f27a0ed5969ae0e6644390c27182a659eac8a2 100644 (file)
@@ -53,13 +53,17 @@ do
        done
 done
 
-echo "STEP 2: Module loading"
-
-# Load appropriate kernel modules
-for x in $MY_HWOPTS
-do
-       modules_scan $x
-done
+if [ -d "/lib/modules" ]
+then
+       echo "STEP 2: Module loading"
+       # Load appropriate kernel modules
+       for x in $MY_HWOPTS
+       do
+               modules_scan $x
+       done
+else
+       echo "STEP 2: Skipping module load. No modules in initrd"
+fi
 
 echo "STEP 3: Mounting necessary filesystems per boot options"
 
index 775bdb84fa5263ed7bf55dfaf7c9ffcb89123a93..d2835e68c84ed918cdc4d3f4539fc1d74d873b68 100755 (executable)
@@ -71,12 +71,16 @@ fi
 # Compile Busybox
 compile_busybox
 
-if [ "${PAT}" -gt "4" ]
+# Only compile insmod if we're installing modules onto the initrd
+if [ "${NOINITRDMODULES}" = "" ]
 then
-       # Compile module-init-tools
-       compile_module_init_tools
-else
-       compile_modutils
+       if [ "${PAT}" -gt "4" ]
+       then
+               # Compile module-init-tools
+               compile_module_init_tools
+       else
+               compile_modutils
+       fi
 fi
 
 compile_devfsd