If the lines from /etc/modules were used as arguments to /sbin/modprobe before 
trying to execute them as shell scripts there would be not chance that a name 
collision between a command name on a $PATH directory such as /bin or /sbin and 
the module name would cause a failure to load the module.

Example code to illustrate this (surely better code could be written for 
production):

diff -u /etc/init.d/module-init-tools.DIST /etc/init.d/module-init-tools
--- /etc/init.d/module-init-tools.DIST  2010-12-28 15:29:52.000000000 -0500
+++ /etc/init.d/module-init-tools       2010-12-28 15:34:27.000000000 -0500
@@ -39,9 +39,9 @@
 
   if [ "$VERBOSE" != no ]; then
     log_action_msg "Loading kernel module $module"
-    modprobe $module $args || true
+    modprobe $module $args || [ $module ]
   else
-    modprobe $module $args > /dev/null 2>&1 || true
+    modprobe $module $args > /dev/null 2>&1 || [ $module ]
   fi
 }
 
@@ -52,7 +52,6 @@
 # Loop over every line in /etc/modules.
 grep '^[^#]' $MODULES_FILE | \
 while read module args; do
-  [ "$module" ] || continue
   load_module "$module" "$args"
 done




-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to