meta-google: gbmc-update: Support gzipped tarballs

Change-Id: Ic2096e1f49697d837ff94c0a7d51c0b447eb831f
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 9fe51cc..34beed3 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
@@ -33,7 +33,11 @@
 
   # We only support tarballs at the moment, our URLs will always denote
   # this with a URI query param of `format=TAR`.
-  if ! [[ "$bootfile_url" =~ [\&?]format=TAR(&|$) ]]; then
+  local tflags=()
+  if [[ "$bootfile_url" =~ [\&?]format=TAR(_GZIP)?(&|$) ]]; then
+    local t="${BASH_REMATCH[1]}"
+    [ "$t" = '_GZIP' ] && tflags+=('-z')
+  else
     echo "Unknown upgrade unpack method: $bootfile_url" >&2
     return 1
   fi
@@ -53,7 +57,7 @@
   while true; do
     local st=()
     curl -LSsk --max-time $((timeout - SECONDS)) "$bootfile_url" |
-      tar -xC "$tmpdir" "firmware-gbmc/$machine" \
+      tar "${tflags[@]}" -xC "$tmpdir" "firmware-gbmc/$machine" \
       && st=("${PIPESTATUS[@]}") || st=("${PIPESTATUS[@]}")
     # Curl failures should continue
     if (( st[0] == 0 )); then