From 61f954dbeb99cda6db10530badc187875052cef0 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Thu, 30 Jun 2016 19:36:23 -0700 Subject: [PATCH] Tweak make_image_chunk to produce empty chunk when argc == 2. --- firmware/tools/make_image_chunk.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/firmware/tools/make_image_chunk.py b/firmware/tools/make_image_chunk.py index 825c6739..53d9b14d 100755 --- a/firmware/tools/make_image_chunk.py +++ b/firmware/tools/make_image_chunk.py @@ -41,14 +41,18 @@ def write_image(data, path): f.write(data) f.close() -if len(sys.argv) != 4: +if len(sys.argv) == 4: + input_image = read_image(sys.argv[1]) + tag = sys.argv[2].encode() + output_path = sys.argv[3] +elif len(sys.argv) == 2: + input_image = bytearray() + tag = bytearray((0,) * 4) + output_path = sys.argv[1] +else: print(usage_message) sys.exit(-1) -input_image = read_image(sys.argv[1]) -tag = sys.argv[2].encode() -output_path = sys.argv[3] - if len(tag) != 4: print(usage_message) sys.exit(-2)