ubiupdatevol from pipe/compressed file
Hamish Moffatt
hamish at cloud.net.au
Mon May 19 04:47:46 EDT 2008
Hi,
We discussed this briefly a few months back but I want to investigate a
bit further.
I would like to be able to update a ubi volume from a compressed file.
My system has limited RAM so I can't always keep the whole file
uncompressed in RAM, and I'd prefer not to uncompress it to temporary
space on flash, just to copy it somewhere else.
I'm doing this on a block device with "zcat img.gz | dd of=..." but
ubiupdatevol doesn't accept a pipe.
Reading the source this looks quite difficult to fix - it really must
know how many bytes are to be programmed in advance because it
communicates that to the kernel.
One solution I see is to add decompression support directly into
ubiupdatevol. eg with zlib it can gzseek() to the end of the file to get
the length, then rewind. I modified flashcp once to do this. However I
prefer to use better compression (lzma or bzip2) and we don't want to
add all of these to mtd-utils I think.
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.
Artem, do you have any other ideas?
Thanks
Hamish
--
Hamish Moffatt VK3SB <hamish at debian.org> <hamish at cloud.net.au>
More information about the linux-mtd
mailing list