Author: glen
Date: Thu Sep 17 10:45:19 2009
New Revision: 10614

Modified:
   geninitrd/trunk/geninitrd
Log:
- variable cosmetics, localize

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd   (original)
+++ geninitrd/trunk/geninitrd   Thu Sep 17 10:45:19 2009
@@ -612,28 +612,25 @@
                modpath=${mod%.gz}
 
                # name of the module
-               module=${modpath##*/}
-               module=${module%$modext}
-
-               options=$(modprobe_conf | awk -vmodule="$module" '{ if ($1 == 
"options" && $2 == module) { for(i=3;i<=NF;i++) printf("%s ",$i); }}' | xargs)
-
-               generic_module=$(echo $module | tr - _)
-               sleep_var=$(eval echo \$MODULE_${generic_module}_USLEEP)
-               firmware_var=$(eval echo \$MODULE_${generic_module}_FIRMWARE)
+               local module=${modpath##*/}; module=${module%$modext}
+               local options=$(modprobe_conf | awk -vmodule="$module" '{ if 
($1 == "options" && $2 == module) { for(i=3;i<=NF;i++) printf("%s ",$i); }}' | 
xargs)
+               local genericname=$(echo $module | tr - _)
+               local usleep=$(eval echo \$MODULE_${genericname}_USLEEP)
+               local firmware=$(eval echo \$MODULE_${genericname}_FIRMWARE)
 
                if [ -n "$verbose" ]; then
                        s=""
                        if [ "$options" ]; then
                                s="$s with options [$options]"
                        fi
-                       if [ "$sleep_var" ]; then
-                               s="$s and $sleep_var usleep"
+                       if [ "$usleep" ]; then
+                               s="$s and $usleep usleep"
                        fi
                        debug "Loading module [$module]$s"
                fi
 
-               if [ -n "$firmware_var" ]; then
-                       firmware_install_module "$module" "$firmware_var"
+               if [ -n "$firmware" ]; then
+                       firmware_install_module "$module" "$firmware"
                else
                        firmware_files=$(find_firmware "$module")
                        if [ -n "$firmware_files" ]; then
@@ -644,15 +641,15 @@
                fi
 
                echo "insmod /lib/modules/$kernel/$modpath $options" | 
add_linuxrc
-               if [ -n "$sleep_var" ]; then
-                       echo "usleep $sleep_var" | add_linuxrc
+               if [ -n "$usleep" ]; then
+                       echo "usleep $usleep" | add_linuxrc
                fi
                if [ "$module" = "scsi_wait_scan" ]; then
                        if [ "$(busybox_applet rmmod 2>/dev/null; echo $?)" = 0 
]; then
                                echo "rmmod scsi_wait_scan" | add_linuxrc
                        fi
                        # HACK HACK HACK until we get proper solution like 
waiting untill rootfs device appears
-                       if [ -z "$sleep_var" -a "$kernel_version_long" -ge 
"002006030" ]; then
+                       if [ -z "$usleep" -a "$kernel_version_long" -ge 
"002006030" ]; then
                                echo "usleep 15000000" | add_linuxrc
                        fi
                fi
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to