package/system/mtd: fix usage message
[openwrt/staging/wigyori.git] / package / system / mtd / src / mtd.c
index af544198cbe20fde7ba380ae42eea28ffeaefad7..822e466f470f8af3cc3bee7959cb56a5f7d168a7 100644 (file)
@@ -586,7 +586,7 @@ resume:
                                if (!quiet)
                                        fprintf(stderr, "\b\b\b   ");
                                if (quiet < 2)
-                                       fprintf(stderr, "\nAppending jffs2 data from %s to %s...", jffs2file, mtd);
+                                       fprintf(stderr, "\nAppending jffs2 data from %s to %s..\n.", jffs2file, mtd);
                                /* got an EOF marker - this is the place to add some jffs2 data */
                                skip = mtd_replace_jffs2(mtd, fd, e, jffs2file);
                                jffs2_replaced = 1;
@@ -674,7 +674,7 @@ resume:
                        break;
                case MTD_IMAGE_FORMAT_SEAMA:
                        if (mtd_fixseama)
-                               mtd_fixseama(mtd, 0);
+                               mtd_fixseama(mtd, 0, 0);
                        break;
                default:
                        break;
@@ -732,13 +732,15 @@ static void usage(void)
        "        -d <name>               directory for jffs2write, defaults to \"tmp\"\n"
        "        -j <name>               integrate <file> into jffs2 data when writing an image\n"
        "        -s <number>             skip the first n bytes when appending data to the jffs2 partiton, defaults to \"0\"\n"
-       "        -p                      write beginning at partition offset\n"
+       "        -p <number>             write beginning at partition offset\n"
        "        -l <length>             the length of data that we want to dump\n");
        if (mtd_fixtrx) {
            fprintf(stderr,
        "        -o offset               offset of the image header in the partition(for fixtrx)\n");
+       }
+       if (mtd_fixtrx || mtd_fixseama) {
                fprintf(stderr,
-       "        -c datasize             amount of data to be used for checksum calculation (for fixtrx)\n");
+       "        -c datasize             amount of data to be used for checksum calculation (for fixtrx / fixseama)\n");
        }
        fprintf(stderr,
 #ifdef FIS_SUPPORT
@@ -859,7 +861,7 @@ int main (int argc, char **argv)
                                errno = 0;
                                data_size = strtoul(optarg, 0, 0);
                                if (errno) {
-                                       fprintf(stderr, "-d: illegal numeric string\n");
+                                       fprintf(stderr, "-c: illegal numeric string\n");
                                        usage();
                                }
                                break;
@@ -987,7 +989,7 @@ int main (int argc, char **argv)
                        break;
                case CMD_FIXSEAMA:
                        if (mtd_fixseama)
-                               mtd_fixseama(device, 0);
+                               mtd_fixseama(device, 0, data_size);
                        break;
        }