summaryrefslogtreecommitdiff
path: root/rbutil/mkamsboot/mkamsboot.c
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 /rbutil/mkamsboot/mkamsboot.c
parent7d1528e6013fef6520d8844e3c0ac466f164ace7 (diff)
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
Diffstat (limited to 'rbutil/mkamsboot/mkamsboot.c')
-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(
*model = sansasums[i].model;
*fw_version = sansasums[i].fw_version;
} else {
- fprintf(stderr, "[WARN] ****** Original firmware unknown ******\n");
if (get_uint32le(&buf[0x204])==0x0000f000) {
*fw_version = 2;
model_id = buf[0x219];
@@ -380,11 +379,30 @@ unsigned char* load_of_file(
*fw_version = 1;
model_id = buf[0x215];
}
-
*model = get_model(model_id);
if (*model == MODEL_UNKNOWN)
- ERROR("[ERR] Unknown firmware - model id 0x%02x\n", model_id);
+ ERROR("[ERR] Unknown firmware model (v%d) - model id 0x%02x\n",
+ *fw_version, model_id);
+
+#if 1 /* comment to test new OFs */
+ char tested_versions[100];
+ tested_versions[0] = '\0';
+
+ for (i = 0; i < NUM_MD5S ; i++)
+ if (sansasums[i].model == *model) {
+ if (tested_versions[0] != '\0') {
+ strncat(tested_versions, ", ",
+ sizeof(tested_versions) - strlen(tested_versions) - 1);
+ }
+ strncat(tested_versions, sansasums[i].version,
+ sizeof(tested_versions) - strlen(tested_versions) - 1);
+ }
+
+ ERROR("[ERR] Original firmware unknown, please try an other version." \
+ " Tested %s versions are : %s\n",
+ model_names[*model], tested_versions);
+#endif
}
/* TODO: Do some more sanity checks on the OF image. Some images (like