[PATCH] rc.sysinit: only call modprobe once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Use modprobe -a and a bash PE to filter the MODULES array.

Signed-off-by: Dave Reisner <d@xxxxxxxxxxxxxx>
---
 rc.sysinit |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/rc.sysinit b/rc.sysinit
index 09d5e97..4b6e1e7 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -92,14 +92,10 @@ 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
+if [[ $load_modules != off && -f /proc/modules ]] && (( ${#MODULES[@]} > 0 )); then
+	stat_busy "Loading Modules"
+		/sbin/modprobe -a "${MODULES[@]/#\!*/}"
+	stat_done
 fi
 
 # Wait for udev uevents
-- 
1.7.2.3



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux