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 <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85024
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
This commit is contained in:
Matt DeVillier 2024-11-07 11:35:22 -06:00
commit cfe1e921dd

View file

@ -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 \ )