[rtems-tools commit] misc: tools: fix mkimage.py script type processing

Chris Johns chrisj at rtems.org
Tue Feb 16 05:12:49 UTC 2021


Module:    rtems-tools
Branch:    master
Commit:    7189172c1a81dd042696066246f77e59580852b2
Changeset: http://git.rtems.org/rtems-tools/commit/?id=7189172c1a81dd042696066246f77e59580852b2

Author:    Andre Nahrwold <andre.nahrwold at dlr.de>
Date:      Thu Feb 11 17:23:16 2021 +0100

misc: tools: fix mkimage.py script type processing

---

 misc/tools/mkimage.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/misc/tools/mkimage.py b/misc/tools/mkimage.py
index fd75f0a..111e224 100755
--- a/misc/tools/mkimage.py
+++ b/misc/tools/mkimage.py
@@ -121,6 +121,16 @@ outputfile.seek(struct.size);
 
 inputcrc = 0;
 
+if options.type in 'script':
+
+    filler_struct = Struct("!II")
+    inputblock = filler_struct.pack(inputsize, 0)
+
+    inputcrc = binascii.crc32(inputblock, inputcrc)
+    outputfile.write(inputblock)
+
+    inputsize = inputsize + 8
+
 while True:
         inputblock = inputfile.read(4096)
         if not inputblock: break



More information about the vc mailing list