linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* flash_erase vs flash_eraseall
@ 2010-09-22  4:35 Mike Frysinger
  2010-09-23  1:57 ` Jon Povey
  2010-09-23 11:24 ` Artem Bityutskiy
  0 siblings, 2 replies; 7+ messages in thread
From: Mike Frysinger @ 2010-09-22  4:35 UTC (permalink / raw)
  To: linux-mtd

while looking to extend the erase ioctl abi to take a flags argument,
i needed updated utils to test my work.  reviewing the flash_erase and
flash_eraseall code bases makes me wonder why there are even two tools
in the first place.  "eraseall" sounds like it should simply be an
option to the "erase" util.  so why does it warrant its own code base
for a mere option ?

also in looking at these utils, flash_erase does not support the
extended 64bit api as it is doing ioctls directly nor does it use
getopt.  flash_eraseall however is using the common libmtd api (so it
gets the extend api support for free), and it is cleanly using getopt
cleanly.  which leads to a simple conclusion from my side ...

let's punt the current flash_erase code, rename flash_eraseall to
flash_erase, and then extend its options to support the minor
functionality of flash_erase.  doesnt look like it'll be hard at all
to do this.  but before i undertake the task, i want to make sure the
idea isnt simply going to be rejected due to some concern about
retaining backwards compatibility.

running `flash_erase /dev/mtd#` (no arguments) will make it erase the
first block.  this seems kind of useless to me.

so i'd make the arguments:
flash_erase [options] <mtd> <start> [count]
Options:
  -N, --erasebad
  -j, --jffs2
  -u, --unlock
  -q, --quiet
        --silent

for the "all" functionality, we can have a value of "-1" or "0" for
the count mean "all", or make people type "all".
-mike

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-09-23 19:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-22  4:35 flash_erase vs flash_eraseall Mike Frysinger
2010-09-23  1:57 ` Jon Povey
2010-09-23  2:06   ` Mike Frysinger
2010-09-23  2:12     ` Jon Povey
2010-09-23  2:41       ` Mike Frysinger
2010-09-23 11:24 ` Artem Bityutskiy
2010-09-23 19:21   ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).