ubiupdatevol from pipe/compressed file

Artem Bityutskiy dedekind at infradead.org
Fri Jun 27 10:36:19 EDT 2008


On Tue, 2008-05-20 at 18:39 +1000, Hamish Moffatt wrote:
> On Mon, May 19, 2008 at 11:54:01AM +0300, Artem Bityutskiy wrote:
> > On Mon, 2008-05-19 at 18:47 +1000, Hamish Moffatt wrote:
> > > Alternatively allow the uncompressed file size to be specified as a
> > > ubiupdatevol parameter. In my application I can store the uncompressed
> > > file size and provide it to ubiupdatevol ok.
> > 
> > Yeah, I think it is reasonable to add one more option and pass the size
> > there. Then it could be easy to teach ubiupdatevol to read the specified
> > amount of bytes from stdin.
> 
> Here's a patch for ubiupdatevol. It contains 3 changes;
> 
> 1. Adds -s/--size switch;
> 2. Allows the image file to be specified as '-', meaning stdin; if used,
> the size must be specified.
> 
> 3. In ubi_update_volume(), the code assumed that a read() requesting a
> whole LEB worth of data would always return the amount requested.
> However read() is allowed to return less than that, and does in some
> cases eg reading from a pipe. I modified it to call read() in a loop
> until it had a whole LEB worth of data.

You didn't send this N3 change, so I did this (and few more minor
tewaks) and pushed your patch, thanks.

http://git.infradead.org/mtd-utils.git?a=commit;h=8ec6531393464519a9d2720c27be200d226c21fb

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list