]> www.infradead.org Git - mtd-utils.git/commitdiff
nanddump: document, warn about future default --omitoob
authorBrian Norris <computersforpeace@gmail.com>
Wed, 22 Jun 2011 16:49:23 +0000 (09:49 -0700)
committerArtem Bityutskiy <dedekind1@gmail.com>
Thu, 23 Jun 2011 14:57:55 +0000 (17:57 +0300)
To work as a proper inverse to nandwrite, nanddump must not dump OOB data by
default. This patch prints a warning regarding the future change. We also
suggest using the new flag, `--oob', for transitioning to the next release
with new default behavior.

Note that we are changing `-o' to mean `--oob' in the next release,
similar to `nandwrite -o'.  This is a break from previous behavior.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
feature-removal-schedule.txt
nanddump.c

index f9910f11d5f2ac8e7798239b9d2070f97715f120..338bc085584d18686cc0ed31adeba33e9e346f4f 100644 (file)
@@ -66,3 +66,14 @@ Transition summary table:
  --omitbad      N/A                        very similar to `skipbad', will be removed soon
 
 ---------------------------
+
+5. nanddump will not dump OOB by default
+
+In 1.4.6, nanddump will not dump OOB by default. To dump OOB, you will have to
+explicitly use the option `--oob'. For now, there is simply a warning every
+time you use nanddump without explicitly choosing `--oob' or `--omitoob'.
+
+Note that `-o' will no longer stand for `--omitoob'. To unify with nandwrite,
+it will stand for `--oob' (Dump OOB data).
+
+---------------------------
index e19a45fd3b25c5cbc4e5d953831d627cca580231..54cb1af5daaf5b497c927cc2387fe2d534d54e90 100644 (file)
@@ -53,8 +53,8 @@ static void display_help(void)
 "-f file    --file=file          Dump to file\n"
 "-l length  --length=length      Length\n"
 "-n         --noecc              Read without error correction\n"
-"-o         --omitoob            Omit oob data\n"
-"           --oob                Dump OOB data\n"
+"-o         --omitoob            Omit OOB data (default in next release)\n"
+"           --oob                Dump OOB data (current default)\n"
 "-p         --prettyprint        Print nice (hexdump)\n"
 "-q         --quiet              Don't display progress and status messages\n"
 "-s addr    --startaddress=addr  Start address\n"
@@ -77,7 +77,14 @@ static void display_help(void)
 "  and resume dumping at the next good block. However, with `omitbad', we\n"
 "  count the bad block as part of the total dump length, whereas with\n"
 "  `skipbad', the bad block is skipped, that is, not counted toward the\n"
-"  total dump length.\n",
+"  total dump length.\n"
+"\n"
+"Note on --oob, --omitoob:\n"
+"  To make nanddump act more like an inverse to nandwrite, we are changing\n"
+"  the default OOB behavior. In the next release, nanddump will not dump\n"
+"  OOB data by default. We will leave both the `--omitoob' and `--oob'\n"
+"  options, but to mirror nandwrite, the short option `-o' will then stand\n"
+"  for `--oob', not `--omitoob'. Please adjust your usage accordingly.\n",
        PROGRAM_NAME);
        exit(EXIT_SUCCESS);
 }
@@ -119,7 +126,7 @@ static enum {
 static void process_options(int argc, char * const argv[])
 {
        int error = 0;
-       bool bb_default = true;
+       bool bb_default = true, oob_default = true;
 
        for (;;) {
                int option_index = 0;
@@ -171,7 +178,12 @@ static void process_options(int argc, char * const argv[])
                                                bb_default = false;
                                                break;
                                        case 3: /* --oob */
-                                               omitoob = false;
+                                               if (oob_default) {
+                                                       oob_default = false;
+                                                       omitoob = false;
+                                               } else {
+                                                       errmsg_die("--oob and --oomitoob are mutually exclusive");
+                                               }
                                                break;
                                }
                                break;
@@ -200,7 +212,12 @@ static void process_options(int argc, char * const argv[])
                                length = simple_strtoll(optarg, &error);
                                break;
                        case 'o':
-                               omitoob = true;
+                               if (oob_default) {
+                                       oob_default = false;
+                                       omitoob = true;
+                               } else {
+                                       errmsg_die("--oob and --oomitoob are mutually exclusive");
+                               }
                                break;
                        case 'a':
                                forcebinary = true;
@@ -259,6 +276,11 @@ static void process_options(int argc, char * const argv[])
                        "  method. In future versions, the default will change to\n"
                        "  --bb=skipbad. Use \"nanddump --help\" for more information.");
 
+       if (oob_default)
+               warnmsg("in next release, nanddump will not dump OOB\n"
+                       "  by default. Use `nanddump --oob' explicitly to ensure\n"
+                       "  it is dumped.");
+
        if ((argc - optind) != 1 || error)
                display_help();