Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86057?usp=email )
Change subject: util/chromeos/crosfirmware: Improve parsing of manifest.json ......................................................................
util/chromeos/crosfirmware: Improve parsing of manifest.json
Some newer boards (like google/skyrim) use a separate line for each field, so adjust parsing to accommodate that.
TEST=run `bash crosfirmware.sh` for frostflow, grunt, careena.
Change-Id: I3af38d3577f1390c999ad5e6df0fa2c4c4382245 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M util/chromeos/crosfirmware.sh 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/86057/1
diff --git a/util/chromeos/crosfirmware.sh b/util/chromeos/crosfirmware.sh index cfb1fcc..22fd611 100755 --- a/util/chromeos/crosfirmware.sh +++ b/util/chromeos/crosfirmware.sh @@ -114,8 +114,10 @@ _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 -A4 "$BOARD":" "$_unpacked/manifest.json" | grep -m1 "rw" | + sed 's/.*(rw.*)/\1/' | sed 's/.*("Google.*)/\1/' | cut -f2 -d'"') + _bios_image=$(grep -m1 -A7 "$BOARD":" "$_unpacked/manifest.json" | grep -m1 "image" | + sed 's/.*"image": //' | cut -f2 -d'"') else _version=$(cat $_unpacked/VERSION | grep BIOS\ version: | cut -f2 -d: | tr -d \ )