summaryrefslogtreecommitdiffstats
path: root/common/filetype.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 /common/filetype.c
parente944e7f81069538265f01f21c0e7b1998730fea6 (diff)
downloadbarebox-cdc837f4d90fbafd0d55634ea3acfda12120e1cd.tar.gz
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 'common/filetype.c')
-rw-r--r--common/filetype.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/filetype.c b/common/filetype.c
index 1ff3dd2..13c7994 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -33,6 +33,7 @@ static const struct filetype_str filetype_str[] = {
[filetype_unknown] = { "unknown", "unkown" },
[filetype_arm_zimage] = { "arm Linux zImage", "arm-zimage" },
[filetype_lzo_compressed] = { "lzo compressed", "lzo" },
+ [filetype_lz4_compressed] = { "lz4 compressed", "lz4" },
[filetype_arm_barebox] = { "arm barebox image", "arm-barebox" },
[filetype_uimage] = { "U-Boot uImage", "u-boot" },
[filetype_ubi] = { "UBI image", "ubi" },
@@ -195,6 +196,9 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
if (buf8[0] == 0x89 && buf8[1] == 0x4c && buf8[2] == 0x5a &&
buf8[3] == 0x4f)
return filetype_lzo_compressed;
+ if (buf8[0] == 0x02 && buf8[1] == 0x21 && buf8[2] == 0x4c &&
+ buf8[3] == 0x18)
+ return filetype_lz4_compressed;
if (buf[0] == be32_to_cpu(0x27051956))
return filetype_uimage;
if (buf[0] == 0x23494255)