Skip to contentSkip to conversation

Rewrite the mount loop using bash-specific features.

PATCH In review initramfs mailing list 1 participant 1 message Feb 16, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 5/50 Rewrite the mount loop using bash-specific features.

Gitweb:     http://git.kernel.org/?p=linux/kernel/git/davej/dracut.git;a=commit;h=e0bb3c3613a7b706984f12829892365fa42a404d
Commit:     e0bb3c3613a7b706984f12829892365fa42a404d
Parent:     f9a0b9f8683acf3b35f45f1fdf472ed6409fa004
Author:     Victor Lowther <[email protected]>
AuthorDate: Fri Feb 13 04:41:42 2009 -0800
Committer:  Dave Jones <[email protected]>
CommitDate: Mon Feb 16 13:56:40 2009 -0500

[PATCH 05/50] Rewrite the mount loop using bash-specific features.

This makes the loop slightly more compact and easier to read.

---
 init |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
init +2 -5
index 78f962e..2ebf1b0 100755
@@ -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    

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html