ota: add a timeout argument to jade_ota.py
What changed, and why it matters
This change simply adds a user-configurable timeout to a serial connection script used for firmware updates, and uses a longer timeout during automated testing in a simulated (QEMU) environment. There is no security issue here.
No security action needed. Treat as a normal CI/test infrastructure improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds a --serialtimeout argument to jade_ota.py (default 120 seconds) and passes it through to JadeAPI.create_serial(). It also updates main/qemu/qemu_ci_flash.sh to set --serialtimeout=900 for QEMU CI runs. This is a test/CI reliability improvement, not a vulnerability fix or security-relevant change.
Changed components
jade_ota.pymain/qemu/qemu_ci_flash.shInspect captured patch +10 / −3
diff --git a/jade_ota.py b/jade_ota.py
index a3c84f2..64c145b 100755
--- a/jade_ota.py
+++ b/jade_ota.py
@@ -385,6 +385,12 @@ if __name__ == '__main__':
dest='serialport',
help='Serial port or device',
default=None)
+ parser.add_argument('--serialtimeout',
+ action='store',
+ dest='serialtimeout',
+ type=int,
+ help='Serial port timeout',
+ default=120)
blegrp = parser.add_mutually_exclusive_group()
blegrp.add_argument('--skipble',
@@ -519,7 +525,7 @@ if __name__ == '__main__':
if not args.skipserial:
logger.info(f'Jade OTA over serial')
- with JadeAPI.create_serial(device=args.serialport) as jade:
+ with JadeAPI.create_serial(device=args.serialport, timeout=args.serialtimeout) as jade:
# By default serial uses extended-replies
extended_replies = not args.noextendedreplies
info = get_version_info(jade)
diff --git a/main/qemu/qemu_ci_flash.sh b/main/qemu/qemu_ci_flash.sh
index 8f4f9a4..cfde6f9 100755
--- a/main/qemu/qemu_ci_flash.sh
+++ b/main/qemu/qemu_ci_flash.sh
@@ -40,14 +40,15 @@ gcc -O2 -DBSDIFF_EXECUTABLE -o ./tools/bsdiff build/bsdiff.c
# OTA the build firmware
# NOTE: tools/fwprep.py should have run in the build step and produced the compressed firmware file
+OTA_ARGS="--log=INFO --skipble --serialport=tcp:localhost:30121 --serialtimeout=900"
FW_FULL=$(ls build/*_fw.bin)
-python jade_ota.py --log=INFO --skipble --serialport=tcp:localhost:30121 --fwfile=${FW_FULL}
+python jade_ota.py ${OTA_ARGS} --fwfile=${FW_FULL}
# Flash a simple patch-to-self, just to smoke test ota-delta
./tools/mkpatch.py ${FW_FULL} ${FW_FULL} build/ --force
FW_PATCH=$(ls ./build/*_patch.bin)
cp "${FW_FULL}.hash" "${FW_PATCH}.hash"
-python jade_ota.py --log=INFO --skipble --serialport=tcp:localhost:30121 --fwfile=${FW_PATCH}
+python jade_ota.py ${OTA_ARGS} --fwfile=${FW_PATCH}
# Run the tests - long timeout for bcur-fragment iteration test in 'run_remote_selfcheck()/selfcheck.c'
python test_jade.py --log=INFO --skipble --qemu --serialport=tcp:localhost:30121 --serialtimeout=900 $*
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.