Patch / RFC: add "flashcp" applet

Stefan Seyfried stefan.seyfried at googlemail.com
Sun Nov 15 14:18:46 UTC 2009


On Sun, 15 Nov 2009 14:57:33 +0100
Tito <farmatito at tiscali.it> wrote:

> On Saturday 14 November 2009 22:53:22 Stefan Seyfried wrote:
> > On Sat, 14 Nov 2009 22:15:14 +0100
> > Tito <farmatito at tiscali.it> wrote:
> > 
> > > Hi,
> > > just some ideas I had while looking at your patch,
> > > hope they can help you to improve/optimize it.
> > 
> > Thanks, I will check them. I btw. just did not think of "puts" instead
> > of "printf ... \n", will check all those, too.
> > 
> > > Ciao,
> > > Tito
> > > 
> > > PS.: progress() is used only in two sites, is it worth the hassle, couldn't it be inlined?
> > 
> > My first incarnation used it more often (there were two loops, one for
> > write and one for verify), and then it was a clear win. I will check if
> > is still is now.
> > 
> 
> snip 
> 
> > > 
> > > 	Use xioctl here?
> > 
> > I actually want the "is no valid MTD flash" error here, not only "ioctl
> > 0x12345 failed". Did you never try to fcp something
> > into /dev/mtdblock/x? ;-)
> 
> You can set :
>  Busybox Library Tuning
> [*] Use ioctl names rather than hex values in error messages   

Yes, I know. I'd rather try to make the flashcp applet useful anyway.
Experienced users do not need a flashcp program to bring their image
into flash. The others might be thankful for a useful error message.

If you are really low on space and care for every byte, flashcp is not
for you anyway. You just do the erase ioctl for the whole partition and
then cat your image into the MTD device. No fancy flashcp is
needed for this at all. Saves lots of space.

The whole purpose of flashcp is, IMO, to make the flashing a bit more
"luxurious". By providing useful messages in case something goes wrong
and by providing a useful progress indicator.

If i want to provide this, I will probably not get below 1200bytes.
This is (for me) still much better than the >8kb the standalone version
of flashcp needs on my powerpc systems. But then, I am not that short
on space that I need the 7 kb urgently, so I'll just continue to use
the standalone version instead of putting it into busybox.

-- 
Stefan Seyfried

"Any ideas, John?"
"Well, surrounding them's out."


More information about the busybox mailing list