*** empty log message ***
authorcharles <charles>
Wed, 12 Mar 2003 19:32:31 +0000 (19:32 +0000)
committercharles <charles>
Wed, 12 Mar 2003 19:32:31 +0000 (19:32 +0000)
utils/mkyaffs [deleted file]
utils/mkyaffs.c

diff --git a/utils/mkyaffs b/utils/mkyaffs
deleted file mode 100755 (executable)
index 28870e6..0000000
Binary files a/utils/mkyaffs and /dev/null differ
index a0107bad89e917f8f98c6adc6aac6036d8447096..fdcf4517f29453636a77de140dea978d4b4e74e2 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/config.h>
 #include <linux/mtd/mtd.h>
 
-const char *mkyaffs_c_version = "$Id: mkyaffs.c,v 1.6 2003-03-11 05:16:53 charles Exp $";
+const char *mkyaffs_c_version = "$Id: mkyaffs.c,v 1.7 2003-03-12 19:32:41 charles Exp $";
 
 // countBits is a quick way of counting the number of bits in a byte.
 // ie. countBits[n] holds the number of 1 bits in a byte with the value n.
@@ -92,19 +92,34 @@ int main(int argc, char **argv)
        int optcnt = 1;
        int usemtdecc = 0;
        int imglen = 0;
+       int showHelp = 0;
        struct mtd_oob_buf oob = {0, 16, (unsigned char *) &oobbuf};
        mtd_info_t meminfo;
        erase_info_t erase;
        struct nand_oobinfo oobsel;
 
-       if (strcmp (argv[optcnt], "-e") == 0) {
+       if (argc > 1 && strcmp (argv[optcnt], "-?") == 0) {
+               showHelp = 1;
+       }
+
+       if (argc > 1 && strcmp (argv[optcnt], "-h") == 0) {
+               showHelp = 1;
+       }
+       
+       if (argc > 1 && strcmp (argv[optcnt], "-e") == 0) {
                optcnt++;
                usemtdecc = 1;
        }
        
        /* Make sure a device was specified */
-       if(argc < (optcnt + 2)) {
-               printf("usage: %s -e <mtdname> <image name>\n", argv[0]);
+       if(showHelp || argc < (optcnt + 2)) {
+               printf("usage: %s [-e] <mtdname> [image name]\n", argv[0]);
+               printf("  -e         Use mtd ecc. Default: do not use mtd ecc\n");
+               printf("  mtdname    Name of mtd device\n");
+               printf("  image name Name of optional image file\n\n");
+               printf("Function: Formats a NAND mtd device for YAFFS. If the optional\n"
+                      "image file is specified, then the file system is loaded with\n"
+                      "this image.\n\n");
                exit(1);
        }