meta-google: gbmc-update: stop self-upgrade if url is missing
This change will stop self update if the url is empty. Let it fall
through the upgrade hook and return error.
Change-Id: I92118d1697f1b8474c5152e6ea52f7ddb36b5615
Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com>
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 3ac4020..d671e81 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
@@ -28,6 +28,11 @@
fi
gbmc_upgrade_dl_unpack() {
+ if [ -z "${bootfile_url-}" ]; then
+ echo "bootfile_url is empty" >&2
+ return 1
+ fi
+
echo "Fetching $bootfile_url" >&2
# We only support tarballs at the moment, our URLs will always denote
@@ -74,8 +79,6 @@
}
gbmc_upgrade_hook() {
- [ -n "${bootfile_url-}" ] || return 0
-
local tmpdir
tmpdir="$(mktemp -d)" || return
if ! gbmc_upgrade_dl_unpack; then