meta-google: gbmc-update: Retry wget in case networking isn't ready

Otherwise the netboot process will fail early and never complete
properly.

Change-Id: I90dfbaa53d914df1f9515e2a1feaf17797f741b8
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-phosphor/flash/gbmc-update/75-gbmc-upgrade.sh b/meta-google/recipes-phosphor/flash/gbmc-update/75-gbmc-upgrade.sh
index fb6bb4d..4c7d15e 100644
--- a/meta-google/recipes-phosphor/flash/gbmc-update/75-gbmc-upgrade.sh
+++ b/meta-google/recipes-phosphor/flash/gbmc-update/75-gbmc-upgrade.sh
@@ -41,7 +41,15 @@
   # Ensure some sane output file limit
   # Currently no BMC image is larger than 64M
   ulimit -H -f $((96 * 1024 * 1024)) || return
-  wget -q -O - "$bootfile_url" | tar -xC "$tmpdir" || true
+  timeout=$((SECONDS + 120))
+  while (( SECONDS < timeout )); do
+    local st=(0)
+    wget -q -O - "$bootfile_url" | tar -xC "$tmpdir" || st=("${PIPESTATUS[@]}")
+    (( st[0] != 0 )) || break
+    shopt -s nullglob
+    rm -rf -- "${tmpdir:?}"/* "${tmpdir:?}"/.*
+    sleep 5
+  done
 
   local sig
   sig="$(find "$tmpdir" -name 'image-*.sig')" || return