summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-06-04 16:31:11 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-06-04 16:31:11 +0000
commit8bb5e430e507cdf53e0909d8cf02b249153ccb87 (patch)
tree83fb8a225a0316665ddf24d91288133efcb7579d
parent7d1528e6013fef6520d8844e3c0ac466f164ace7 (diff)
downloadrockbox-8bb5e430e507cdf53e0909d8cf02b249153ccb87.tar.gz
rockbox-8bb5e430e507cdf53e0909d8cf02b249153ccb87.zip
mkamsboot: refuse to patch an untested OF, and provide a list of tested OF versions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21189 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/mkamsboot/mkamsboot.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/rbutil/mkamsboot/mkamsboot.c b/rbutil/mkamsboot/mkamsboot.c
index b55c8bcbdb..9a80d4892a 100644
--- a/rbutil/mkamsboot/mkamsboot.c
+++ b/rbutil/mkamsboot/mkamsboot.c
@@ -372,7 +372,6 @@ unsigned char* load_of_file(
372 *model = sansasums[i].model; 372 *model = sansasums[i].model;
373 *fw_version = sansasums[i].fw_version; 373 *fw_version = sansasums[i].fw_version;
374 } else { 374 } else {
375 fprintf(stderr, "[WARN] ****** Original firmware unknown ******\n");
376 if (get_uint32le(&buf[0x204])==0x0000f000) { 375 if (get_uint32le(&buf[0x204])==0x0000f000) {
377 *fw_version = 2; 376 *fw_version = 2;
378 model_id = buf[0x219]; 377 model_id = buf[0x219];
@@ -380,11 +379,30 @@ unsigned char* load_of_file(
380 *fw_version = 1; 379 *fw_version = 1;
381 model_id = buf[0x215]; 380 model_id = buf[0x215];
382 } 381 }
383
384 *model = get_model(model_id); 382 *model = get_model(model_id);
385 383
386 if (*model == MODEL_UNKNOWN) 384 if (*model == MODEL_UNKNOWN)
387 ERROR("[ERR] Unknown firmware - model id 0x%02x\n", model_id); 385 ERROR("[ERR] Unknown firmware model (v%d) - model id 0x%02x\n",
386 *fw_version, model_id);
387
388#if 1 /* comment to test new OFs */
389 char tested_versions[100];
390 tested_versions[0] = '\0';
391
392 for (i = 0; i < NUM_MD5S ; i++)
393 if (sansasums[i].model == *model) {
394 if (tested_versions[0] != '\0') {
395 strncat(tested_versions, ", ",
396 sizeof(tested_versions) - strlen(tested_versions) - 1);
397 }
398 strncat(tested_versions, sansasums[i].version,
399 sizeof(tested_versions) - strlen(tested_versions) - 1);
400 }
401
402 ERROR("[ERR] Original firmware unknown, please try an other version." \
403 " Tested %s versions are : %s\n",
404 model_names[*model], tested_versions);
405#endif
388 } 406 }
389 407
390 /* TODO: Do some more sanity checks on the OF image. Some images (like 408 /* TODO: Do some more sanity checks on the OF image. Some images (like