diff options
author | Dave Reisner <d@falconindy.com> | 2010-12-13 09:19:52 -0500 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2010-12-13 22:31:18 +0100 |
commit | 8569035c827a23fd0acf5681f4ec19a93eefbae7 (patch) | |
tree | 2a42241b1ab8d4ce82edc46fe732331961cae37c | |
parent | b1f25405aeb7baff194aac4473c8c6692c3d8bea (diff) | |
download | initscripts-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>
-rwxr-xr-x | rc.sysinit | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -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 |