We don't know how to increase the firmware size, so abort instead of creating a bricking firmware. Suggested by Rafaël Carré (funman).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18663 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2008-09-29 09:27:35 +00:00
parent 11ef4ce1f9
commit 0326055f91

View file

@ -195,17 +195,13 @@ int main(int argc, char* argv[])
fprintf(stderr,"New total size of firmware - 0x%08x\n",new_length);
if (firmware_paddedsize != new_paddedsize) {
/* Move everything after the firmare block "bootloader_size"
bytes forward to make room for the bootloader */
/* We don't know how to safely increase the firmware size, so abort */
fprintf(stderr,"Calling memmove(buf + 0x%08x,buf + 0x%08x,0x%08x)\n",
0x400 + new_paddedsize,
0x400 + firmware_paddedsize,
(int)len - firmware_paddedsize);
fprintf(stderr,
"[ERR] Bootloader too large (%d bytes - %d bytes available), aborting.\n",
bootloader_size, firmware_paddedsize - firmware_size);
memmove(buf + 0x400 + new_paddedsize,
buf + 0x400 + firmware_paddedsize,
len - firmware_paddedsize);
return 1;
}
ldr = get_uint32le(&buf[0x400]);