From b0e0ec832b3a940a59e23bbe52dee8f22bb7f813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Mon, 25 May 2009 10:35:15 +0000 Subject: [PATCH] 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 --- rbutil/mkamsboot/mkamsboot.c | 12 ++++++++++-- 1 file 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 }