diff options
author | Gaurav Shah <gauravsh@chromium.org> | 2011-02-13 16:57:38 -0800 |
---|---|---|
committer | Gaurav Shah <gauravsh@chromium.org> | 2011-02-13 16:57:38 -0800 |
commit | e1649e136c55300962079b72035498bbdd1c1a52 (patch) | |
tree | cc8b936e2c98e0543a0aeed7eebb60dbe8d8fbd3 | |
parent | 794d4d44db984759466b5b6779833e2d5281e527 (diff) | |
download | vboot-e1649e136c55300962079b72035498bbdd1c1a52.tar.gz |
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
-rwxr-xr-x | scripts/image_signing/resign_firmwarefd.sh | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/image_signing/resign_firmwarefd.sh b/scripts/image_signing/resign_firmwarefd.sh index 36334718..42412ef4 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/')" |