summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/image_signing/resign_firmwarefd.sh14
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/')"