" -n, --noecc Write without ecc\n"
" -N, --noskipbad Write without bad block skipping\n"
" -o, --oob Image contains oob data\n"
+" -O, --onlyoob Image contains oob data and only write the oob part\n"
" -r, --raw Image contains the raw oob data dumped by nanddump\n"
" -s addr, --start=addr Set start address (default is 0)\n"
" -p, --pad Pad to page size\n"
static bool quiet = false;
static bool writeoob = false;
static bool rawoob = false;
+static bool onlyoob = false;
static bool autoplace = false;
static bool markbad = false;
static bool forcejffs2 = false;
for (;;) {
int option_index = 0;
- static const char *short_options = "ab:fjmnNopqrs:y";
+ static const char *short_options = "ab:fjmnNoOpqrs:y";
static const struct option long_options[] = {
{"help", no_argument, 0, 0},
{"version", no_argument, 0, 0},
{"noecc", no_argument, 0, 'n'},
{"noskipbad", no_argument, 0, 'N'},
{"oob", no_argument, 0, 'o'},
+ {"onlyoob", no_argument, 0, 'O'},
{"pad", no_argument, 0, 'p'},
{"quiet", no_argument, 0, 'q'},
{"raw", no_argument, 0, 'r'},
case 'o':
writeoob = true;
break;
+ case 'O':
+ writeoob = true;
+ onlyoob = true;
+ break;
case 'p':
pad = true;
break;
process_options(argc, argv);
- if (pad && writeoob) {
+ if (!onlyoob && (pad && writeoob)) {
fprintf(stderr, "Can't pad when oob data is present.\n");
exit(EXIT_FAILURE);
}
}
/* Write out the Page data */
- if (mtd_write(&mtd, fd, mtdoffset / mtd.eb_size, mtdoffset % mtd.eb_size,
+ if (!onlyoob && mtd_write(&mtd, fd, mtdoffset / mtd.eb_size, mtdoffset % mtd.eb_size,
writebuf, mtd.min_io_size)) {
int i;
if (errno != EIO) {