[PATCH [mtd-utils] 3/3] mkfs.ubifs: allow reformatting of devices

Mike Frysinger vapier at gentoo.org
Fri May 10 11:26:00 EDT 2013


On Friday 10 May 2013 03:07:53 Ricard Wanderlof wrote:
> On Wed, 8 May 2013, Mike Frysinger wrote:
> > Sometimes I want to re-initialize an existing ubifs, but the tool
> > currently bails out if the volume is already formatted.  Prompt the
> > user instead so they can decide.
> > 
> > 	{"max-leb-cnt",        1, NULL, 'c'},
> > 	{"output",             1, NULL, 'o'},
> > 	{"devtable",           1, NULL, 'D'},
> > +	{"yes",                0, NULL, 'y'},
> > 	{"help",               0, NULL, 'h'},
> > 	{"verbose",            0, NULL, 'v'},
> > 	{"version",            0, NULL, 'V'},
> > 
> > @@ -191,6 +193,7 @@ static const char *helptext =
> > "-U, --squash-uids        squash owners making all files owned by root\n"
> > "-l, --log-lebs=COUNT     count of erase blocks for the log (used only
> > for\n" "                         debugging)\n"
> > +"-y, --yes                assume the answer is \"yes\" for all
> > questions\n" ...
> 
> Wouldn't it be better to have a specific option for this specific case,
> rather than a general yes-to-everything option?

this is the standard that the various mtd tools (including a bunch of UBI 
ones) follow

> The latter makes sense
> with programs such as fsck where the only prompt basically is 'I found a
> fault, shall I fix it?', but in this is case it can be difficult to
> predict the outcome should the option start to cover more potential
> questions in the future.

if you want to compare to standard tools, then the check would be dropped 
entirely.  when i run `mke2fs /dev/sda1`, it doesn't prompt me.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20130510/f28f2b5c/attachment-0001.sig>


More information about the linux-mtd mailing list