From 0326055f9153f6635623f9698c5f1186be5e7c4a Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Mon, 29 Sep 2008 09:27:35 +0000 Subject: =?UTF-8?q?We=20don't=20know=20how=20to=20increase=20the=20firmwar?= =?UTF-8?q?e=20size,=20so=20abort=20instead=20of=20creating=20a=20bricking?= =?UTF-8?q?=20firmware.=20=20Suggested=20by=20Rafa=C3=ABl=20Carr=C3=A9=20(?= =?UTF-8?q?funman).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18663 a1c6a512-1295-4272-9138-f99709370657 --- utils/AMS/hacking/mkamsboot.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'utils') 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]); -- cgit v1.2.3