diff options
author | William A. Kennington III <wak@google.com> | 2022-05-25 21:42:30 +0300 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2022-06-11 21:52:17 +0300 |
commit | d99d91e7df77882a27ae89f4745fc63580a00662 (patch) | |
tree | 44205b0c65b380614efb18a799dfd7cae557fb38 | |
parent | 3cfbd1542958b656f38389758579e0640d6462cb (diff) | |
download | openbmc-d99d91e7df77882a27ae89f4745fc63580a00662.tar.xz |
meta-google: gbmc-update: Support gzipped tarballs
Change-Id: Ic2096e1f49697d837ff94c0a7d51c0b447eb831f
Signed-off-by: William A. Kennington III <wak@google.com>
-rw-r--r-- | meta-google/recipes-phosphor/flash/gbmc-update/75-gbmc-upgrade.sh | 8 |
1 files changed, 6 insertions, 2 deletions
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 9fe51cce2b..34beed335e 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 @@ gbmc_upgrade_fetch() ( # 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 @@ gbmc_upgrade_fetch() ( 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 |