diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-11-05 15:47:39 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-11-05 15:47:39 +0100 |
commit | 592d35a47ce4ef2ffffd9805a1a534771882f3a6 (patch) | |
tree | edd5c958170dcafe0d931308a0de290abd1e7da5 /common | |
parent | 7b4cc54579f12cc6c9586e8c21e729dd220e7f45 (diff) | |
parent | ccb281647704d6857d3491dc71746d2f7ce38fa7 (diff) | |
download | barebox-592d35a47ce4ef2ffffd9805a1a534771882f3a6.tar.gz barebox-592d35a47ce4ef2ffffd9805a1a534771882f3a6.tar.xz |
Merge branch 'for-next/xz'
Diffstat (limited to 'common')
-rw-r--r-- | common/Kconfig | 5 | ||||
-rw-r--r-- | common/filetype.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/common/Kconfig b/common/Kconfig index 016ba444a3..a2cce391f4 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -582,6 +582,7 @@ choice prompt "default compression for in-barebox binaries" default DEFAULT_COMPRESSION_NONE if PBL_IMAGE default DEFAULT_COMPRESSION_LZO if LZO_DECOMPRESS + default DEFAULT_COMPRESSION_XZ if XZ_DECOMPRESS default DEFAULT_COMPRESSION_GZIP if ZLIB default DEFAULT_COMPRESSION_LZ4 if LZ4_DECOMPRESS default DEFAULT_COMPRESSION_BZIP2 if BZLIB @@ -606,6 +607,10 @@ config DEFAULT_COMPRESSION_LZ4 bool "lz4" depends on LZ4_DECOMPRESS +config DEFAULT_COMPRESSION_XZ + bool "xz" + depends on XZ_DECOMPRESS + config DEFAULT_COMPRESSION_NONE bool "no compression" diff --git a/common/filetype.c b/common/filetype.c index 810d9a505c..25d97614e4 100644 --- a/common/filetype.c +++ b/common/filetype.c @@ -58,6 +58,7 @@ static const struct filetype_str filetype_str[] = { [filetype_ch_image] = { "TI OMAP CH boot image", "ch-image" }, [filetype_ch_image_be] = { "TI OMAP CH boot image (big endian)", "ch-image-be" }, + [filetype_xz_compressed] = { "XZ compressed", "xz" }, [filetype_exe] = { "MS-DOS executable", "exe" }, }; @@ -272,6 +273,9 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize) if (buf8[0] == 'B' && buf8[1] == 'Z' && buf8[2] == 'h' && buf8[3] > '0' && buf8[3] <= '9') return filetype_bzip2; + if (buf8[0] == 0xfd && buf8[1] == 0x37 && buf8[2] == 0x7a && + buf8[3] == 0x58 && buf8[4] == 0x5a && buf8[5] == 0x00) + return filetype_xz_compressed; if (buf[0] == be32_to_cpu(0xd00dfeed)) return filetype_oftree; if (strncmp(buf8, "ANDROID!", 8) == 0) |