diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-10-17 15:36:39 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-11-04 12:18:55 +0100 |
commit | ccb281647704d6857d3491dc71746d2f7ce38fa7 (patch) | |
tree | 174abba08cfce552c97535d9c0abd1f8b32a99f5 /lib/uncompress.c | |
parent | 2f81d316d21113ab4288fbd3e84c03bf6f0c08ed (diff) | |
download | barebox-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.c | 6 |
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); |