diff options
-rw-r--r-- | extra/usb_updater/gsctool.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c index 4584c2bb82..b7fc2c02e2 100644 --- a/extra/usb_updater/gsctool.c +++ b/extra/usb_updater/gsctool.c @@ -1302,11 +1302,23 @@ static bool fetch_header_versions(const void *image) sections[i].offset); if (h->image_size < CONFIG_FLASH_BANK_SIZE) { - fprintf(stderr, - "Image at offset %#5x too short (%d bytes)\n", - sections[i].offset, - h->image_size); - return false; + /* + * Return an error for incorrectly signed images. If + * it's a RO image with 0 as its size, ignore the error. + * + * TODO(b/273510573): revisit after dbg versioning is + * figured out. + */ + if (h->image_size || sections[i].offset) { + fprintf(stderr, + "Image at offset %#5x too short " + "(%d bytes)\n", + sections[i].offset, + h->image_size); + return false; + } + + printf("warning: invalid RO_A (size 0)\n"); } sections[i].shv.epoch = h->epoch_; sections[i].shv.major = h->major_; |