From 568f2e3c8bbd2d655bdf7562fda105d24c6e8b58 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Fri, 29 Apr 2022 10:24:53 -0700 Subject: 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 --- meta-google/recipes-phosphor/flash/gbmc-update/75-gbmc-upgrade.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3