Skip to content

Commit 5abc64e

Browse files
committed
ardupilotwaf: Fix inconsistency in signed firmware file when generated with the compact method of signing firmware
If the firmware file is built and signed using the compact method (ie. build and sign firmware at the same time) then the firmware file is not updated with the field signed_firmware. If the firmware file is built using the long form method (ie. build the firmware first, then sign after) then the apj is updated with the field signed_firmware. This ensures both signed firmware is consistent and contains the 'signed_firmware' field.
1 parent d0932a9 commit 5abc64e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Tools/ardupilotwaf/chibios.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,9 @@ def run(self):
378378
# we omit build_time when we don't have build_dates so that apj
379379
# file is identical for same git hash and compiler
380380
d["build_time"] = int(time.time())
381+
if self.env.AP_SIGNED_FIRMWARE and self.env.PRIVATE_KEY:
382+
# The firmware file was signed during the build process, so set the flag
383+
d['signed_firmware'] = True
381384
apj_file = self.outputs[0].abspath()
382385
f = open(apj_file, "w")
383386
f.write(json.dumps(d, indent=4))

0 commit comments

Comments
 (0)