From d323115c7b1a02244a52e298d83be8a390dbcc28 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 25 Apr 2006 22:41:38 +0000 Subject: Add disablemodules= kernel param git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@18 880c04e9-e011-0410-abf7-b926e227c9cd --- init | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'init') diff --git a/init b/init index a8f7b34..3afc2aa 100644 --- a/init +++ b/init @@ -17,25 +17,35 @@ for cmd in $CMDLINE; do esac done +OLDIFS=$IFS +IFS=, if [ "x${disablehooks}" != "x" ]; then - OLDIFS=$IFS - IFS=, for d in ${disablehooks}; do - export "${d}=disabled" + export "hook_${d}=disabled" done - IFS=$OLDIFS fi +if [ "x${disablemodules}" != "x" ]; then + for d in ${disablemodules}; do + export "mod_${d}=disabled" + done +fi +IFS=$OLDIFS + . /config for m in $MODULES; do - /bin/modprobe -q $m > /dev/null 2>&1 + TST="" + eval "TST=\$mod_${h}" + if [ "${TST}" != "disabled" ]; then + /bin/modprobe -q $m > /dev/null 2>&1 + fi done if [ -e "/hooks" ]; then for h in $HOOKS; do TST="" - eval "TST=\$${h}" + eval "TST=\$hook_${h}" if [ "${TST}" != "disabled" ]; then run_hook () { msg "$h: no run function defined"; } if [ -e "/hooks/$h" ]; then -- cgit v1.2.3-24-g4f1b