summaryrefslogtreecommitdiffstats
path: root/lib/uncompress.c
diff options
context:
space:
mode:
authorKyungsik Lee <kyungsik.lee@lge.com>2013-07-15 12:20:52 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-07-16 08:24:30 +0200
commitcdc837f4d90fbafd0d55634ea3acfda12120e1cd (patch)
tree08335c5a6675067942865c177732c5562a9e757c /lib/uncompress.c
parente944e7f81069538265f01f21c0e7b1998730fea6 (diff)
downloadbarebox-cdc837f4d90fbafd0d55634ea3acfda12120e1cd.tar.gz
barebox-cdc837f4d90fbafd0d55634ea3acfda12120e1cd.tar.xz
lib: Add support for LZ4-compressed kernel
This patch adds support for extracting LZ4-compressed kernel images, as well as LZ4-compressed ramdisk images in the kernel boot process. This depends on the patch below decompressor: Add LZ4 decompressor module Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib/uncompress.c')
-rw-r--r--lib/uncompress.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/uncompress.c b/lib/uncompress.c
index e0a69df9f9..a4225aaeb4 100644
--- a/lib/uncompress.c
+++ b/lib/uncompress.c
@@ -21,6 +21,7 @@
#include <bunzip2.h>
#include <gunzip.h>
#include <lzo.h>
+#include <linux/decompress/unlz4.h>
#include <errno.h>
#include <filetype.h>
#include <malloc.h>
@@ -112,6 +113,11 @@ int uncompress(unsigned char *inbuf, int len,
compfn = decompress_unlzo;
break;
#endif
+#ifdef CONFIG_LZ4_DECOMPRESS
+ case filetype_lz4_compressed:
+ compfn = decompress_unlz4;
+ break;
+#endif
default:
err = asprintf("cannot handle filetype %s", file_type_to_string(ft));
error_fn(err);