From 8569035c827a23fd0acf5681f4ec19a93eefbae7 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 13 Dec 2010 09:19:52 -0500 Subject: Use modprobe's --all flag instead of looping. Filter blacklisted modules with a parameter expansion and add an extra conditional to modprobe to only act if the resultant expansion has a value. It's important that no quoting takes place here, or else a variable is defined with a null terminator and which will cause the extra conditional to pass and modprobe will error out. Signed-off-by: Dave Reisner Signed-off-by: Tom Gundersen --- rc.sysinit | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index c719abf..44238fa 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -93,15 +93,13 @@ if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then fi # Load modules from the MODULES array defined in rc.conf -if [[ $load_modules != off && -f /proc/modules ]]; then - stat_busy "Loading Modules" - for mod in "${MODULES[@]}"; do - if [[ $mod = ${mod#!} ]]; then - /sbin/modprobe $mod - fi - done - stat_done +mods=${MODULES[@]/!*/} +if [[ $load_modules != off && -f /proc/modules && $mods ]]; then + stat_busy "Loading Modules" + /sbin/modprobe --all $mods + stat_done fi +unset mods # Wait for udev uevents if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then -- cgit v1.2.3