Add nomodules kernel commandline parameter to disable loading of modules

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@675 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Andrew Gaffney 17 years ago
parent 1a90fbf8f1
commit 80fb4b4d11

@ -2,6 +2,10 @@
# Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2 # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $ # $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, 09 May 2008; Andrew Gaffney <agaffney@gentoo.org> gen_funcs.sh, genkernel,
genkernel.conf: genkernel.conf:
Move distfile cache to /var/cache/genkernel/src and add check to make sure Move distfile cache to /var/cache/genkernel/src and add check to make sure

@ -77,5 +77,5 @@ LOOPS='/livecd.loop /zisofs /livecd.squashfs /image.squashfs /livecd.gcloop'
# Only sections that are in by default or those that # Only sections that are in by default or those that
# are not module groups need to be defined here... # are not module groups need to be defined here...
HWOPTS='keymap cache pata sata scsi usb firewire slowusb evms lvm dmraid mdadm fs net' HWOPTS='keymap cache modules pata sata scsi usb firewire slowusb evms lvm dmraid mdadm fs net'
MY_HWOPTS='pata sata scsi usb firewire dmraid mdadm fs net' MY_HWOPTS='modules pata sata scsi usb firewire dmraid mdadm fs net'

@ -448,13 +448,11 @@ cmdline_hwopts() {
do do
if [ "${y}" = "${x}" ] if [ "${y}" = "${x}" ]
then then
FOUND=1 continue 2
fi fi
done done
if [ ! "${FOUND}" = '1' ]
then
TMP_HWOPTS="${TMP_HWOPTS} ${x}" TMP_HWOPTS="${TMP_HWOPTS} ${x}"
fi eval DO_`echo ${x} | sed 's/-//'`=1
done done
MY_HWOPTS=${TMP_HWOPTS} MY_HWOPTS=${TMP_HWOPTS}
@ -470,7 +468,6 @@ load_modules() {
for modules in $MY_HWOPTS for modules in $MY_HWOPTS
do do
modules_scan $modules modules_scan $modules
eval DO_`echo $modules | sed 's/-//'`=1
done done
else else
good_msg 'Skipping module load; no modules in the initrd!' good_msg 'Skipping module load; no modules in the initrd!'

@ -203,7 +203,10 @@ mount_sysfs
setup_hotplug setup_hotplug
# Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel # 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 then
good_msg 'Loading modules' good_msg 'Loading modules'
# Load appropriate kernel modules # Load appropriate kernel modules
@ -212,16 +215,11 @@ then
for modules in ${MY_HWOPTS} for modules in ${MY_HWOPTS}
do do
modules_scan ${modules} modules_scan ${modules}
eval DO_`echo ${modules} | sed 's/-//'`=1
done done
fi fi
# Always eval doload=... # Always eval doload=...
modules_load ${MDOLIST} modules_load ${MDOLIST}
else 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!' good_msg 'Skipping module load; no modules in the initrd!'
fi fi

Loading…
Cancel
Save