diff options
author | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-10-18 07:22:59 +0000 |
---|---|---|
committer | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-10-18 07:22:59 +0000 |
commit | c34b71fa3d6f389bd769256a8ab1e5fdc66bd400 (patch) | |
tree | 6d9714e2397ea0ccd7e08c849ece661e5fca5b72 /package/mtd/src/mtd.c | |
parent | 01339d91da84f562386e682fb88ee5e98f694287 (diff) |
package/mtd: add option for fixing seama images
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33841 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mtd/src/mtd.c')
-rw-r--r-- | package/mtd/src/mtd.c | 12 |
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; } |