# Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 09 May 2008; Andrew Gaffney <agaffney@gentoo.org> generic/initrd.defaults,
+ generic/initrd.scripts, generic/linuxrc:
+ Add nomodules kernel commandline parameter to disable loading of modules
+
09 May 2008; Andrew Gaffney <agaffney@gentoo.org> gen_funcs.sh, genkernel,
genkernel.conf:
Move distfile cache to /var/cache/genkernel/src and add check to make sure
# Only sections that are in by default or those that
# are not module groups need to be defined here...
-HWOPTS='keymap cache pata sata scsi usb firewire slowusb evms lvm dmraid mdadm fs net'
-MY_HWOPTS='pata sata scsi usb firewire dmraid mdadm fs net'
+HWOPTS='keymap cache modules pata sata scsi usb firewire slowusb evms lvm dmraid mdadm fs net'
+MY_HWOPTS='modules pata sata scsi usb firewire dmraid mdadm fs net'
do
if [ "${y}" = "${x}" ]
then
- FOUND=1
+ continue 2
fi
done
- if [ ! "${FOUND}" = '1' ]
- then
- TMP_HWOPTS="${TMP_HWOPTS} ${x}"
- fi
+ TMP_HWOPTS="${TMP_HWOPTS} ${x}"
+ eval DO_`echo ${x} | sed 's/-//'`=1
done
MY_HWOPTS=${TMP_HWOPTS}
for modules in $MY_HWOPTS
do
modules_scan $modules
- eval DO_`echo $modules | sed 's/-//'`=1
done
else
good_msg 'Skipping module load; no modules in the initrd!'
setup_hotplug
# Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel
-if [ -d "/lib/modules/${KV}" ]
+if [ -z "${DO_modules}" ]
+then
+ good_msg 'Skipping module load; disabled via commandline'
+elif [ -d "/lib/modules/${KV}" ]
then
good_msg 'Loading modules'
# Load appropriate kernel modules
for modules in ${MY_HWOPTS}
do
modules_scan ${modules}
- eval DO_`echo ${modules} | sed 's/-//'`=1
done
fi
# Always eval doload=...
modules_load ${MDOLIST}
else
- for modules in ${MY_HWOPTS}
- do
- eval DO_`echo ${modules} | sed 's/-//'`=1
- done
good_msg 'Skipping module load; no modules in the initrd!'
fi