summaryrefslogtreecommitdiff
path: root/meta-google
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2022-04-29 20:24:53 +0300
committerWilliam A. Kennington III <wak@google.com>2022-05-02 19:56:22 +0300
commit568f2e3c8bbd2d655bdf7562fda105d24c6e8b58 (patch)
tree36f9098cfd0a7c0488fd16aafc11c454a9693d7c /meta-google
parent7d346b7258b63ddc31c007b8b63b11aaa8d07b54 (diff)
downloadopenbmc-568f2e3c8bbd2d655bdf7562fda105d24c6e8b58.tar.xz
meta-google: gbmc-update: Only extract firmware for our machine
Some machines will have multiple firmware packages assigned that could brick the BMC. Only extract the firmware for a machine that matches the expected machine. Change-Id: Ibfdbe4614ee471a9f208c3d1a31d65a9fef06747 Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google')
-rw-r--r--meta-google/recipes-phosphor/flash/gbmc-update/75-gbmc-upgrade.sh7
1 files changed, 6 insertions, 1 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 d08575a237..1ed4b9a22c 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
@@ -38,13 +38,18 @@ gbmc_upgrade_fetch() (
return 1
fi
+ # Determine the path of the image file for the correct machine
+ # Our netboot can serve us images for multiple models
+ local machine
+ machine="$(source /etc/os-release && echo "$OPENBMC_TARGET_MACHINE")" || return
+
# Ensure some sane output file limit
# Currently no BMC image is larger than 64M
ulimit -H -f $((96 * 1024 * 1024)) || return
timeout=$((SECONDS + 120))
while (( SECONDS < timeout )); do
local st=(0)
- wget -q -O - "$bootfile_url" | tar -xC "$tmpdir" || st=("${PIPESTATUS[@]}")
+ wget -q -O - "$bootfile_url" | tar -xC "$tmpdir" "firmware-gbmc/$machine" || st=("${PIPESTATUS[@]}")
(( st[0] != 0 )) || break
(shopt -s nullglob dotglob; rm -rf -- "${tmpdir:?}"/*)
sleep 5