File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,6 +156,18 @@ sign_firmware_blob() {
156156 fi
157157}
158158
159+ isABCapableImage () {
160+ image=" $1 "
161+ offset=0x10008
162+ count=8
163+ bootsys=" bootsys"
164+ filename=$( dd if=" ${image} " bs=1 skip=$(( offset)) count=$(( count)) status=none | strings)
165+ if [ " ${filename} " = " ${bootsys} " ]; then
166+ return 0
167+ fi
168+ return 1
169+ }
170+
159171sign_firmware () {
160172 if [ " ${SIGN_FIRMWARE} " = 1 ]; then
161173 echo " SIGN_RECOVERY: ${SIGN_RECOVERY} "
@@ -185,7 +197,13 @@ sign_firmware() {
185197 rpi-eeprom-config -x " ${pieeprom_src} "
186198 )
187199 sign_firmware_blob " ${TMP_DIR} /bootcode.bin" " ${TMP_DIR} /bootcode.bin.signed"
188- rpi-eeprom-config --bootcode " ${TMP_DIR} /bootcode.bin.signed" -o " ${pieeprom_dst} " " ${pieeprom_src} "
200+ if isABCapableImage " ${pieeprom_src} " ; then
201+ sign_firmware_blob " ${TMP_DIR} /bootsys" " ${TMP_DIR} /bootsys.signed"
202+ rpi-eeprom-config --bootcode " ${TMP_DIR} /bootcode.bin.signed" --bootsys " ${TMP_DIR} /bootsys.signed" -o " ${pieeprom_dst} " " ${pieeprom_src} "
203+ else
204+ rpi-eeprom-config --bootcode " ${TMP_DIR} /bootcode.bin.signed" -o " ${pieeprom_dst} " " ${pieeprom_src} "
205+
206+ fi
189207 SRC_IMAGE=" ${pieeprom_dst} "
190208 fi
191209 fi
You can’t perform that action at this time.
0 commit comments