Skip to content

Instantly share code, notes, and snippets.

@bryant
Created May 18, 2016 22:45
Show Gist options
  • Save bryant/0329f7e8952533b16b7c5cfcfe0ad489 to your computer and use it in GitHub Desktop.
Save bryant/0329f7e8952533b16b7c5cfcfe0ad489 to your computer and use it in GitHub Desktop.
commit fda5c8f46b58fb43e9245609579334df19bbb5d4
Author: bryant <[email protected]>
Date: Wed May 18 18:34:31 2016 -0400
use a retry loop for `plainroot`
because detection of the ${ROOT} device could take some time
diff --git a/components/9990-main.sh b/components/9990-main.sh
index e5884f9..10a746a 100755
--- a/components/9990-main.sh
+++ b/components/9990-main.sh
@@ -48,7 +48,17 @@ Live ()
elif [ -n "${PLAIN_ROOT}" ] && [ -n "${ROOT}" ]
then
# Do a local boot from hd
- livefs_root=${ROOT}
+ i=0
+ while [ "$i" -lt 10 ]
+ do
+ if [ -e "${ROOT}" ]
+ then
+ livefs_root=${ROOT}
+ break
+ fi
+ sleep 1
+ i="$((i + 1))"
+ done
else
if [ -x /usr/bin/memdiskfind ]
then
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment