]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
base/init.sh: use loop counter with unique varname
authorHarald Hoyer <harald@redhat.com>
Fri, 27 Jun 2014 16:05:37 +0000 (18:05 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 29 Jul 2014 10:05:38 +0000 (12:05 +0200)
$i can be polluted too easily

(cherry picked from commit 6525182bfc06abfffd71dafc06c5faca6c55eace)

modules.d/99base/init.sh

index 9ee3e9dc3e8cddb333dee2f2b0cfafb30c4ee457..dcc62d2aba4bff58a2f2dc4ff852dec286eea29f 100755 (executable)
@@ -231,7 +231,7 @@ source_hook pre-mount
 getarg 'rd.break=mount' -d 'rdbreak=mount' && emergency_shell -n mount "Break mount"
 # mount scripts actually try to mount the root filesystem, and may
 # be sourced any number of times. As soon as one suceeds, no more are sourced.
-i=0
+_i_mount=0
 while :; do
     if ismounted "$NEWROOT"; then
         usable_root "$NEWROOT" && break;
@@ -247,8 +247,8 @@ while :; do
         fi
     done
 
-    i=$(($i+1))
-    [ $i -gt 20 ] \
+    _i_mount=$(($_i_mount+1))
+    [ $_i_mount -gt 20 ] \
         && { flock -s 9 ; action_on_fail "Can't mount root filesystem" && break; } 9>/.console_lock
 done