summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-11-14 12:35:50 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-11-14 12:35:50 +0100
commite5374fa4d443b25fc12a578a978621dcacc380df (patch)
tree2764ca012ddbd0ab6c350affe84edb0b0e89cf45 /common
parente17342474165e575199701158d77e51c826d87d2 (diff)
parent8129a0a972790f46930bca3707575d19ce48f49a (diff)
downloadbarebox-e5374fa4d443b25fc12a578a978621dcacc380df.tar.gz
barebox-e5374fa4d443b25fc12a578a978621dcacc380df.tar.xz
Merge branch 'for-next/squashfs'
Diffstat (limited to 'common')
-rw-r--r--common/filetype.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/filetype.c b/common/filetype.c
index 4728f877c9..8d7293347a 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -40,6 +40,7 @@ static const struct filetype_str filetype_str[] = {
[filetype_uimage] = { "U-Boot uImage", "u-boot" },
[filetype_ubi] = { "UBI image", "ubi" },
[filetype_jffs2] = { "JFFS2 image", "jffs2" },
+ [filetype_squashfs] = { "Squashfs image", "squashfs" },
[filetype_gzip] = { "GZIP compressed", "gzip" },
[filetype_bzip2] = { "BZIP2 compressed", "bzip2" },
[filetype_oftree] = { "open firmware Device Tree flattened Binary", "dtb" },
@@ -278,6 +279,9 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
if (buf8[0] == 0xfd && buf8[1] == 0x37 && buf8[2] == 0x7a &&
buf8[3] == 0x58 && buf8[4] == 0x5a && buf8[5] == 0x00)
return filetype_xz_compressed;
+ if (buf8[0] == 'h' && buf8[1] == 's' && buf8[2] == 'q' &&
+ buf8[3] == 's')
+ return filetype_squashfs;
if (buf[0] == be32_to_cpu(0xd00dfeed))
return filetype_oftree;
if (strncmp(buf8, "ANDROID!", 8) == 0)