summaryrefslogtreecommitdiffstats
path: root/lib/uncompress.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-10-17 15:36:39 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-11-04 12:18:55 +0100
commitccb281647704d6857d3491dc71746d2f7ce38fa7 (patch)
tree174abba08cfce552c97535d9c0abd1f8b32a99f5 /lib/uncompress.c
parent2f81d316d21113ab4288fbd3e84c03bf6f0c08ed (diff)
downloadbarebox-ccb281647704d6857d3491dc71746d2f7ce38fa7.tar.gz
barebox-ccb281647704d6857d3491dc71746d2f7ce38fa7.tar.xz
Add xz decompression support
This adds xz decompression support from the kernel. Both compressing the barebox binary with xz and decompressing xz files on the commandline is supported. 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 a4225aaeb4..329c9fc366 100644
--- a/lib/uncompress.c
+++ b/lib/uncompress.c
@@ -21,6 +21,7 @@
#include <bunzip2.h>
#include <gunzip.h>
#include <lzo.h>
+#include <linux/xz.h>
#include <linux/decompress/unlz4.h>
#include <errno.h>
#include <filetype.h>
@@ -118,6 +119,11 @@ int uncompress(unsigned char *inbuf, int len,
compfn = decompress_unlz4;
break;
#endif
+#ifdef CONFIG_XZ_DECOMPRESS
+ case filetype_xz_compressed:
+ compfn = decompress_unxz;
+ break;
+#endif
default:
err = asprintf("cannot handle filetype %s", file_type_to_string(ft));
error_fn(err);