Closed GoogleCodeExporter closed 8 years ago
Alas, I'm not the creator/maintainer of this kernel patch. I'll try to help,
but in any case, don't forget this is the work of Kyungsik Lee, he's probably
in best position to help you.
One potential issue is there might be some confusion on the format.
LZ4 compression and decompression functions (such as LZ4_decompress_safe() and
LZ4_decompress_fast())are designed for direct memory-to-memory applications.
This format is also used for I/O compression too, but in this case, it is
encapsulated. This is necessary because, in many circumstances, files and
streams to compress are much larger than allocated memory. Hence, input is cut
into blocks, and each block is compressed, using LZ4.
This encapsulation format is named "LZ4 Streaming Format", and defined here :
http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html
But the kernel patch was created before the LZ4 Streaming Format was formally
defined, and therefore uses the Legacy Streaming format.
In any case, you shouldn't use LZ4_decompress_safe() or LZ4_decompress_fast()
directly on encapsulated data : you have to decode it, extract the blocks, and
then you can decode those blocks using the decompression functions.
The logic is present into lz4c.c, function decodeLegacyStream().
Last detail :
LZ4_decompress_safe() and LZ4_decompress_fast() are only newer names.
The equivalence is :
LZ4_uncompress = LZ4_decompress_fast
LZ4_uncompress_unknownOutputSize = LZ4_decompress_safe
Original comment by yann.col...@gmail.com
on 10 May 2013 at 1:07
Last point, maybe the issue is not in the source code itself :
If you use latest version of LZ4c to compress your kernel, the resulting file
will use the latest version of the Streaming format. Therefore, it will not be
decoded by the kernel patch, because the kernel patch expects the Legacy
streaming format.
In order to compress using the Legacy format, you need to use the hidden option
-l :
example :
lz4c -l kernel.raw kernel.lz4
In this example, lz4c will use the Legacy streaming format to produce
kernel.lz4, which will be decodable by the kernel patch.
Rgds
Original comment by yann.col...@gmail.com
on 11 May 2013 at 11:30
I've googled a bit and found a patch that will change scripts/Makefile.lib to
use lz4c with -l flag.
Although, since it's named "Legacy", I want to figure out how to use the latest
Streaming format in Linux kernel :(
Is there any new patches? I've tried to contact Kyungsik Lee but I haven't got
any answers yet :(
Original comment by qkrwngud...@gmail.com
on 11 May 2013 at 12:42
Hi,
I guess the patch you found is:
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=b078
915464637215645a2dcf388a0402986f4a41
Like Yann mentioned above, Linux kernel only supports Legacy format so far.
That's why the kernel isn't decompressed when you try to use lz4c which
compresses the kernel with the new Streaming format.
I'm trying to make the Linux kernel support the Streaming format but
it will be on a slow track. By the way I'v got your email and this comment
is enough to explain what you asked, except that how long lz4c will support
"-l".
Thanks,
Kyungsik
Original comment by raphael....@gmail.com
on 13 May 2013 at 1:05
I close this issue, since I believe the answer of Kyungsik sum it all.
Also : don't expect anything special from the "new streaming format". It's
meant to support different scenarios, but doesn't bring any great improvement
for kernel compression.
Original comment by yann.col...@gmail.com
on 13 May 2013 at 9:42
Original issue reported on code.google.com by
qkrwngud...@gmail.com
on 10 May 2013 at 12:39