aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-12-13 09:19:52 -0500
committerThomas Bächler <thomas@archlinux.org>2010-12-13 22:31:18 +0100
commit8569035c827a23fd0acf5681f4ec19a93eefbae7 (patch)
tree2a42241b1ab8d4ce82edc46fe732331961cae37c /rc.sysinit
parentb1f25405aeb7baff194aac4473c8c6692c3d8bea (diff)
downloadinitscripts-8569035c827a23fd0acf5681f4ec19a93eefbae7.tar.xz
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 <d@falconindy.com> Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit14
1 files 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