INNER CODE UNIT · Python
total_img_sz
wolfSSL/wolfBoot · tools/keytools/sign.py:718
total_img_sz = WOLFBOOT_HEADER_SIZE + img_size
# Only subtract sector for trailer when sector < partition.
# When sector >= partition (e.g. update_ram targets), the
# entire partition is available for the image.
if WOLFBOOT_SECTOR_SIZE < WOLFBOOT_PARTITION_SIZE:
max_img_sz = WOLFBOOT_PARTITION_SIZE - WOLFBOOT_SECTOR_SIZE
else:
max_img_sz = WOLFBOOT_PARTITION_SIZE
if total_img_sz > max_img_sz:
if WOLFBOOT_SECTOR_SIZE < WOLFBOOT_PARTITION_SIZE:
print("Error: Image size %d (header %d + firmware %d) "
"exceeds max %d (partition %d - sector %d)" %
(total_img_sz, WOLFBOOT_HEADER_SIZE, img_size,
max_img_sz, WOLFBOOT_PARTITION_SIZE, WOLFBOOT_SECTOR_SIZE))
else:
print("Error: Image size %d (header %d + firmware %d) "
"exceeds max %d (partition %d)" %
(total_img_sz, WOLFBOOT_HEADER_SIZE, img_size,