From d99d91e7df77882a27ae89f4745fc63580a00662 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Wed, 25 May 2022 11:42:30 -0700 Subject: meta-google: gbmc-update: Support gzipped tarballs Change-Id: Ic2096e1f49697d837ff94c0a7d51c0b447eb831f Signed-off-by: William A. Kennington III --- meta-google/recipes-phosphor/flash/gbmc-update/75-gbmc-upgrade.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'meta-google') 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 -- cgit v1.2.3