From e1649e136c55300962079b72035498bbdd1c1a52 Mon Sep 17 00:00:00 2001 From: Gaurav Shah Date: Sun, 13 Feb 2011 16:57:38 -0800 Subject: [PATCH] Support new style flashmap labels for firmware signing BUG=chrome-os-partner:2316 TEST=tried signing firmware with old style and new style fmap and verified that it works. Change-Id: I9076fe60308bdb787440486d592c9d5e72602199 Review URL: http://codereview.chromium.org/6516004 --- scripts/image_signing/resign_firmwarefd.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/image_signing/resign_firmwarefd.sh b/scripts/image_signing/resign_firmwarefd.sh index 363347181f..42412ef49c 100755 --- a/scripts/image_signing/resign_firmwarefd.sh +++ b/scripts/image_signing/resign_firmwarefd.sh @@ -81,15 +81,21 @@ echo "Using firmware version: $VERSION" # Parse offsets and size of firmware data and vblocks for i in "A" "B" do - match_str="$i Key" - line=$(mosys -f -k eeprom map $1 | grep "$match_str") + line=$(mosys -f -k eeprom map $1 | grep "$i Key") || + line=$(mosys -f -k eeprom map $1 | grep "VBLOCK_$i") || + { echo "Couldn't parse vblock section $i from mosys output"; + exit 1; } + offset="$(echo $line | sed -e 's/.*area_offset=\"\([a-f0-9x]*\)\".*/\1/')" eval fw${i}_vblock_offset=$((offset)) size="$(echo $line | sed -e 's/.*area_size=\"\([a-f0-9x]*\)\".*/\1/')" eval fw${i}_vblock_size=$((size)) - match_str="$i Data" - line=$(mosys -f -k eeprom map $1 | grep "$match_str") + line=$(mosys -f -k eeprom map $1 | grep "$i Data") || + line=$(mosys -f -k eeprom map $1 | grep "FW_MAIN_$i") || + { echo "Couldn't parse Firmware $i section from mosys output"; + exit 1; } + offset="$(echo $line | sed -e 's/.*area_offset=\"\([a-f0-9x]*\)\".*/\1/')" eval fw${i}_offset=$((offset)) size="$(echo $line | sed -e 's/.*area_size=\"\([a-f0-9x]*\)\".*/\1/')"