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
# $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

@ -77,5 +77,5 @@ LOOPS='/livecd.loop /zisofs /livecd.squashfs /image.squashfs /livecd.gcloop'
# 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'

@ -448,13 +448,11 @@ cmdline_hwopts() {
do
if [ "${y}" = "${x}" ]
then
FOUND=1
continue 2
fi
done
if [ ! "${FOUND}" = '1' ]
then
TMP_HWOPTS="${TMP_HWOPTS} ${x}"
fi
eval DO_`echo ${x} | sed 's/-//'`=1
done
MY_HWOPTS=${TMP_HWOPTS}
@ -470,7 +468,6 @@ load_modules() {
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!'

@ -203,7 +203,10 @@ mount_sysfs
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
@ -212,16 +215,11 @@ then
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

Loading…
Cancel
Save