summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-05-25 10:35:15 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-05-25 10:35:15 +0000
commitb0e0ec832b3a940a59e23bbe52dee8f22bb7f813 (patch)
tree587572781c1a454cc667a8b73545a1a38301f263 /rbutil
parent14cd7d71a3e745f0b9aef6b9a521ffba11c47599 (diff)
downloadrockbox-b0e0ec832b3a940a59e23bbe52dee8f22bb7f813.tar.gz
rockbox-b0e0ec832b3a940a59e23bbe52dee8f22bb7f813.tar.bz2
rockbox-b0e0ec832b3a940a59e23bbe52dee8f22bb7f813.zip
mkamsboot: really error out if OF model is different from bootloader model
Error out if firmware md5sum isn't known, and leave the current code #if 0'ed for easier testing git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21073 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/mkamsboot/mkamsboot.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/rbutil/mkamsboot/mkamsboot.c b/rbutil/mkamsboot/mkamsboot.c
index 9c7f3ba8e3..65b88af994 100644
--- a/rbutil/mkamsboot/mkamsboot.c
+++ b/rbutil/mkamsboot/mkamsboot.c
@@ -376,6 +376,7 @@ static unsigned char* load_rockbox_file(char* filename, int model, off_t* bufsiz
if (memcmp(rb_model_names[model],header + 4,4)!=0) {
fprintf(stderr,"[ERR] Model name \"%s\" not found in %s\n",
rb_model_names[model],filename);
+ return NULL;
}
*bufsize = filesize(fd) - sizeof(header);
@@ -468,8 +469,6 @@ int main(int argc, char* argv[])
fprintf(stderr,"[INFO] Original firmware MD5 checksum match - %s %s\n",
model_names[model], sansasums[i].version);
} else {
- fprintf(stderr,"[WARN] ****** Original firmware unknown ******\n");
-
if (get_uint32le(&buf[0x204])==0x0000f000) {
fw_version = 2;
model_id = buf[0x219];
@@ -480,12 +479,21 @@ int main(int argc, char* argv[])
model = get_model(model_id);
+#if 0
+ /* if you are a tester this info might help */
+ fprintf(stderr,"[WARN] ****** Original firmware unknown ******\n");
if (model == MODEL_UNKNOWN) {
fprintf(stderr,"[ERR] Unknown firmware - model id 0x%02x\n",
model_id);
free(buf);
return 1;
}
+#else
+ /* else you don't want to brick your player */
+ fprintf(stderr, "[ERR] Original firmware untested - aborting\n");
+ free(buf);
+ return 1;
+#endif
}