From cfe1e921dd5d358fec2b46f50e356839531d487f Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Thu, 7 Nov 2024 11:35:22 -0600 Subject: util/crosfirmware: Add support for parsing from manifest.json Some ChromeOS recovery images, such as for GRUNT, support multiple boards / multiple bios/ec images, but do not break them out in a 'models' subdirectory like modern recovery images do. Instead, they use a manifest.json to map the board name to the correct bios/ec images. Add support for parsing out the info from here. TEST=run `util/chromeos/crosfirmware.sh kasumi` and verify that the correct shellball firmware is extracted from the recovery image. Change-Id: I64153ba16cb8328d65a0f088d05f04a969f6810f Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/85024 Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer --- util/chromeos/crosfirmware.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/chromeos/crosfirmware.sh b/util/chromeos/crosfirmware.sh index e72ff7d395..ee873290a5 100755 --- a/util/chromeos/crosfirmware.sh +++ b/util/chromeos/crosfirmware.sh @@ -107,6 +107,9 @@ extract_coreboot() { fi _bios_image=$(grep "IMAGE_MAIN" $_unpacked/models/$_board/setvars.sh | cut -f2 -d\") + 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'"') else _version=$(cat $_unpacked/VERSION | grep BIOS\ version: | cut -f2 -d: | tr -d \ ) -- cgit v1.2.3