Questions about MTD

Bill Roman roman at alerton.com
Mon Mar 20 13:06:37 EST 2000


Dvir Oren wrote:
> 
> 3.  erase seg faults.  Is erase supposed to do what docpmap /e
> does?

You can supply a block number on the command line, and/or apply this patch:

diff -ur mtd-20000131.orig/util/erase.c mtd-20000131/util/erase.c
--- mtd-20000131.orig/util/erase.c      Tue Aug 17 15:57:08 1999
+++ mtd-20000131/util/erase.c   Wed Feb 23 10:23:19 2000
@@ -35,7 +35,7 @@
       erase.length = meminfo.erasesize;
       printf("Erasesize 0x%lx\n", meminfo.erasesize);
 
-      if (argc >= 2)
+      if (argc > 2)
              erase.start = atoi(argv[2]);
       else
              erase.start = 0;

Also, if you'd like nftl_format not to print gibberish for a usage message:

diff -ur mtd-20000131.orig/util/nftl_format.c mtd-20000131/util/nftl_format.c
--- mtd-20000131.orig/util/nftl_format.c        Fri Aug 20 08:31:01 1999
+++ mtd-20000131/util/nftl_format.c     Wed Feb 16 11:45:10 2000
@@ -107,7 +107,8 @@
        struct mtd_oob_buf oob = {0, 16, oobbuf};
 
    if (argc < 2) {
-          fprintf(stderr,"Usage: %s <mtddevice> [<start offset> [<size>]]\n");
+          fprintf(stderr,"Usage: %s <mtddevice> [<start offset> [<size>]]\n",
+                  argv[0]);
           return 1;
    }


To unsubscribe, send "unsubscribe mtd" to majordomo at infradead.org



More information about the linux-mtd mailing list