From 9bb805e0c9339265de649aae2398cbf889d17bd9 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Fri, 10 Jan 2025 20:13:18 -0600 Subject: [PATCH] util/chromeos/crosfirmware: Improve matching when scanning manifest file To ensure we find the correct firmware image, match against `$BOARD":` rather than just `$BOARD`. This fixes an issue where another board (b1) using the same firmware build or name as the one we are searching for, causes the grep matching to return empty strings. TEST=successfully extract the firmware image for CAREENA, which previously failed. Change-Id: I2f2a71f0b033938aafc1fd27e2996fe319614b3c Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/85935 Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer --- util/chromeos/crosfirmware.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/chromeos/crosfirmware.sh b/util/chromeos/crosfirmware.sh index 1972aec700..cfb1fcc3c8 100755 --- a/util/chromeos/crosfirmware.sh +++ b/util/chromeos/crosfirmware.sh @@ -114,8 +114,8 @@ extract_coreboot() { _bios_image=$(grep -m1 "image" "$_unpacked/manifest.json" | cut -f4 -d'"') fi elif [ -f "$_unpacked/manifest.json" ]; then - _version=$(grep -m1 -A1 "$BOARD" "$_unpacked/manifest.json" | grep "host" | cut -f12 -d'"') - _bios_image=$(grep -m1 -A3 "$BOARD" "$_unpacked/manifest.json" | grep "image" | cut -f4 -d'"') + _version=$(grep -m1 -A1 "$BOARD\":" "$_unpacked/manifest.json" | grep "host" | cut -f12 -d'"') + _bios_image=$(grep -m1 -A3 "$BOARD\":" "$_unpacked/manifest.json" | grep "image" | cut -f4 -d'"') else _version=$(cat $_unpacked/VERSION | grep BIOS\ version: | cut -f2 -d: | tr -d \ )