|
|
|
@ -205,7 +205,7 @@ class set_app_descriptor(Task.Task):
@@ -205,7 +205,7 @@ class set_app_descriptor(Task.Task):
|
|
|
|
|
desc_len = 16 |
|
|
|
|
crc1 = to_unsigned(crc32(bytearray(img[:offset]))) |
|
|
|
|
crc2 = to_unsigned(crc32(bytearray(img[offset+desc_len:]))) |
|
|
|
|
githash = to_unsigned(int('0x' + self.generator.bld.git_head_hash(short=True),16)) |
|
|
|
|
githash = to_unsigned(int('0x' + os.environ.get('GIT_VERSION', self.generator.bld.git_head_hash(short=True)),16)) |
|
|
|
|
desc = struct.pack('<IIII', crc1, crc2, len(img), githash) |
|
|
|
|
img = img[:offset] + desc + img[offset+desc_len:] |
|
|
|
|
Logs.info("Applying %s APP_DESCRIPTOR %08x%08x" % (self.env.APP_DESCRIPTOR, crc1, crc2)) |
|
|
|
|