diff options
author | Dave Chapman <dave@dchapman.com> | 2008-09-29 09:27:35 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2008-09-29 09:27:35 +0000 |
commit | 0326055f9153f6635623f9698c5f1186be5e7c4a (patch) | |
tree | c92caba34368716d8ddc8ef3c59aecf943ce9eb4 /utils | |
parent | 11ef4ce1f9500ca1bd5651bc0e0dc49bf0dfbd2d (diff) |
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
Diffstat (limited to 'utils')
-rw-r--r-- | utils/AMS/hacking/mkamsboot.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/utils/AMS/hacking/mkamsboot.c b/utils/AMS/hacking/mkamsboot.c index a6e4e01532..30ca66e43b 100644 --- a/utils/AMS/hacking/mkamsboot.c +++ b/utils/AMS/hacking/mkamsboot.c @@ -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]); |