]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
[PATCH 05/50] Rewrite the mount loop using bash-specific features.
authorVictor Lowther <victor.lowther@gmail.com>
Fri, 13 Feb 2009 12:41:42 +0000 (04:41 -0800)
committerDave Jones <davej@redhat.com>
Mon, 16 Feb 2009 18:56:40 +0000 (13:56 -0500)
This makes the loop slightly more compact and easier to read.

init

diff --git a/init b/init
index 78f962ef13287bfb63730719494f74fbfc844e64..2ebf1b05968ee4b5b95bf82c39fd49754ac63aec 100755 (executable)
--- a/init
+++ b/init
@@ -71,13 +71,10 @@ esac
 
 # should we have a timeout?
 tries=0
-while [ ! -e $root ]; do
+until [[ -e $root ]]; do
   echo -n "."
   sleep 1
-  tries=$(($tries + 1))
-  if [ $tries -gt 30 ]; then
-      emergency_shell
-  fi
+  ((tries++ > 30)) && emergency_shell
 done
 echo -e "\n\nMounting rootfs after $tries seconds"
 ln -s "$root" /dev/root