From 5c95716ed53b561a75e7016d4f385a38b1865b60 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 1 Sep 2022 08:17:18 +1000 Subject: [PATCH] Tools: allow apj_tool.py --extract without having params --- Tools/scripts/apj_tool.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Tools/scripts/apj_tool.py b/Tools/scripts/apj_tool.py index e67d76c26c..26b5e25a01 100755 --- a/Tools/scripts/apj_tool.py +++ b/Tools/scripts/apj_tool.py @@ -229,11 +229,14 @@ if __name__ == '__main__': defaults = embedded_defaults(args.firmware_file) - if not defaults.find(): + have_defaults = defaults.find() + + if not have_defaults and not args.extract: print("Error: Param defaults support not found in firmware") sys.exit(1) - - print("Found param defaults max_length=%u length=%u" % (defaults.max_len, defaults.length)) + + if have_defaults: + print("Found param defaults max_length=%u length=%u" % (defaults.max_len, defaults.length)) if args.set_file: # load new defaults from a file