flash_erase vs flash_eraseall

Mike Frysinger vapier.adi at gmail.com
Thu Sep 23 15:21:27 EDT 2010


On Thu, Sep 23, 2010 at 07:24, Artem Bityutskiy wrote:
> On Wed, 2010-09-22 at 00:35 -0400, Mike Frysinger wrote:
>> 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".
>
> I'm perfectly fine with getting rid of one of these, this would be a
> very good clean-up. May be additionally we could create a
> flashe_eraseall shell script which will just run flash_erase <mtd> 0 -1
> <other flags>.

OK, i'll get going on this then

> But also, it need a careful look to make sure all flash_eraseall
> functionality is also in flash_erase.

shouldnt be too hard :)
-mike



More information about the linux-mtd mailing list