[LinuxBIOS] Allow human friendly suffixes for the size option

Peter Stuge peter at stuge.se
Thu Jul 12 02:05:48 CEST 2007


On Wed, Jul 11, 2007 at 05:41:21PM -0600, Jordan Crouse wrote:
> > I would prefer 1024 rather than 1K and 1048576 or 1024*1024
> > rather than 1M.
> 
> Good idea.  I think 'dd' does the same thing.

--8<--
$ dd --help
..
BLOCKS and BYTES may be followed by the following multiplicative
suffixes:
xM M, c 1, w 2, b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,
GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.
-->8--

I think we should just stay with [kK]=1024 and [mM]=1024*1024 though.

But the point was that lar should print the numbers rather than the
suffixes in the help output.


> > > +static void parse_larsize(char *str)
> > 
> > May it's useful somewhere else too? Ie. move to lib.c?
> 
> I don't know - this is the only place we do this sort of thing - 
> in fact, its probably overkill to have a function - we could do it
> right in the switch statement if we wanted to.

Sounds good to me.


//Peter




More information about the coreboot mailing list