aboutsummaryrefslogtreecommitdiffstats
path: root/package/mtd/src/mtd.c
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-10-18 07:22:59 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-10-18 07:22:59 +0000
commita67d5fd24fa80d3f0989f0e6a3f137b8c18cdc41 (patch)
tree21c6d4e95ba552b0fdecc792f9ce70e5c1e063d4 /package/mtd/src/mtd.c
parent25250a22ef4e5e02475f63c20aa9f73ce7c996bd (diff)
downloadupstream-a67d5fd24fa80d3f0989f0e6a3f137b8c18cdc41.tar.gz
upstream-a67d5fd24fa80d3f0989f0e6a3f137b8c18cdc41.tar.bz2
upstream-a67d5fd24fa80d3f0989f0e6a3f137b8c18cdc41.zip
package/mtd: add option for fixing seama images
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 33841
Diffstat (limited to 'package/mtd/src/mtd.c')
-rw-r--r--package/mtd/src/mtd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/package/mtd/src/mtd.c b/package/mtd/src/mtd.c
index 18efcf57cf..9a6e65d0de 100644
--- a/package/mtd/src/mtd.c
+++ b/package/mtd/src/mtd.c
@@ -137,6 +137,7 @@ image_check(int imagefd, const char *mtd)
if (trx_check) {
ret = trx_check(imagefd, mtd, buf, &buflen);
}
+
return ret;
}
@@ -520,6 +521,10 @@ static void usage(void)
fprintf(stderr,
" fixtrx fix the checksum in a trx header on first boot\n");
}
+ if (mtd_fixseama) {
+ fprintf(stderr,
+ " fixseama fix the checksum in a seama header on first boot\n");
+ }
fprintf(stderr,
"Following options are available:\n"
" -q quiet mode (once: no [w] on writing,\n"
@@ -574,6 +579,7 @@ int main (int argc, char **argv)
CMD_REFRESH,
CMD_JFFS2WRITE,
CMD_FIXTRX,
+ CMD_FIXSEAMA,
} cmd = -1;
erase[0] = NULL;
@@ -662,6 +668,9 @@ int main (int argc, char **argv)
} else if (((strcmp(argv[0], "fixtrx") == 0) && (argc == 2)) && mtd_fixtrx) {
cmd = CMD_FIXTRX;
device = argv[1];
+ } else if (((strcmp(argv[0], "fixseama") == 0) && (argc == 2)) && mtd_fixseama) {
+ cmd = CMD_FIXSEAMA;
+ device = argv[1];
} else if ((strcmp(argv[0], "write") == 0) && (argc == 3)) {
cmd = CMD_WRITE;
device = argv[2];
@@ -738,6 +747,9 @@ int main (int argc, char **argv)
if (mtd_fixtrx) {
mtd_fixtrx(device, offset);
}
+ case CMD_FIXSEAMA:
+ if (mtd_fixseama)
+ mtd_fixseama(device, 0);
break;
}