Patch / RFC: add "flashcp" applet

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Sat Nov 14 22:03:02 UTC 2009


On Sat, Nov 14, 2009 at 08:00:44PM +0100, Stefan Seyfried wrote:
>Hi,
>
>the attached patch implements a "flashcp" similar the one form
>mtd-utils.
>
>I have read the style-guide and I think that I did everything right.
>If so, please "git am", if not, please comment ;)

  CC      miscutils/flashcp.o
miscutils/flashcp.c: In function ‘flashcp_main’:
miscutils/flashcp.c:121: warning: format ‘%.8x’ expects type ‘unsigned
int’, but argument 2 has type ‘size_t’
miscutils/flashcp.c:121: warning: format ‘%.8x’ expects type ‘unsigned
int’, but argument 3 has type ‘size_t’
miscutils/flashcp.c:121: warning: format ‘%d’ expects type ‘int’, but
argument 5 has type ‘long unsigned int’
miscutils/flashcp.c:128: warning: format ‘%.8x’ expects type ‘unsigned
int’, but argument 2 has type ‘size_t’
miscutils/flashcp.c:128: warning: format ‘%.8x’ expects type ‘unsigned
int’, but argument 3 has type ‘size_t’

$ ./scripts/bloat-o-meter _bb_un.orig busybox_unstripped
function                                             old     new   delta
flashcp_main                                           -     835    +835
packed_usage                                       26028   26128    +100
progress                                               -      67     +67
applet_names                                        2102    2110      +8
applet_main                                         2496    2504      +8
applet_nameofs                                       624     626      +2
applet_install_loc                                   156     157      +1
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 5/0 up/down: 1021/0)           Total: 1021
bytes

$ size miscutils/flashcp.o 
   text	   data	    bss	    dec	    hex	filename
   1344	      0	      0	   1344	    540	miscutils/flashcp.o

1.3k
don't get me wrong, but this applet seems to:
-) loop through mtd, eraseing 1k
-) loop through file, bb_copyfd_exact_size()
   and verify bytes re-read do memcmp==0 bytes written

Sounds more like 600b-800b than more than 1k, no?
I encourage you to license your new applet under GPLv2 *or later* so we
don't have to rewrite it later on (eventually).

Anyway. Attached patch would kill off 100b, but i think rewriting it
from scratch would be easier.

cheers,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flashcp-still-waaaay-too-big.00.patch
Type: text/x-diff
Size: 4593 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20091114/d57692d9/attachment.bin>


More information about the busybox mailing list