summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuxiao Zhang <yuxiaozhang@google.com>2024-04-25 01:53:26 +0300
committerYuxiao Zhang <yuxiaozhang@google.com>2024-05-08 01:01:37 +0300
commit49d7e60ef51acb51b22d048624b1c748c07422de (patch)
tree3e49c8c3b0c3933658fa722706d95bef95bfa09d
parent414a6e13063994c27171293be6fe0d2724699c14 (diff)
downloadopenbmc-49d7e60ef51acb51b22d048624b1c748c07422de.tar.xz
meta-google: gbmc-bridge: fail upgrade when url is invalid
Currently the upgrade will continue when there is no url. This change will stop self update if the url is empty/invalid. Change-Id: I465ee426c845b918aa458b24db89fbcc2795cde5 Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com>
-rw-r--r--meta-google/recipes-phosphor/flash/gbmc-update/40-gbmc-upgrade.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta-google/recipes-phosphor/flash/gbmc-update/40-gbmc-upgrade.sh b/meta-google/recipes-phosphor/flash/gbmc-update/40-gbmc-upgrade.sh
index 0b927f0e36..3ac40208a7 100644
--- a/meta-google/recipes-phosphor/flash/gbmc-update/40-gbmc-upgrade.sh
+++ b/meta-google/recipes-phosphor/flash/gbmc-update/40-gbmc-upgrade.sh
@@ -78,8 +78,14 @@ gbmc_upgrade_hook() {
local tmpdir
tmpdir="$(mktemp -d)" || return
+ if ! gbmc_upgrade_dl_unpack; then
+ echo 'upgrade unpack failed' >&2
+ # shellcheck disable=SC2153
+ rm -rf -- "$tmpdir" "$GBMC_UPGRADE_SIG" "$GBMC_UPGRADE_IMG"
+ return 1
+ fi
# shellcheck disable=SC2015
- gbmc_upgrade_dl_unpack && gbmc_br_run_hooks GBMC_UPGRADE_HOOKS || true
+ gbmc_br_run_hooks GBMC_UPGRADE_HOOKS || true
# shellcheck disable=SC2153
rm -rf -- "$tmpdir" "$GBMC_UPGRADE_SIG" "$GBMC_UPGRADE_IMG"
}