diff options
-rw-r--r-- | common/filetype.c | 4 | ||||
-rw-r--r-- | fs/squashfs/squashfs.c | 1 | ||||
-rw-r--r-- | include/filetype.h | 1 |
3 files changed, 6 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) diff --git a/fs/squashfs/squashfs.c b/fs/squashfs/squashfs.c index d00dee6caa..6d046810d9 100644 --- a/fs/squashfs/squashfs.c +++ b/fs/squashfs/squashfs.c @@ -353,6 +353,7 @@ static struct fs_driver_d squashfs_driver = { .readdir = squashfs_readdir, .closedir = squashfs_closedir, .stat = squashfs_stat, + .type = filetype_squashfs, .drv = { .probe = squashfs_probe, .remove = squashfs_remove, diff --git a/include/filetype.h b/include/filetype.h index cde73c1170..65bd6efb7b 100644 --- a/include/filetype.h +++ b/include/filetype.h @@ -16,6 +16,7 @@ enum filetype { filetype_uimage, filetype_ubi, filetype_jffs2, + filetype_squashfs, filetype_gzip, filetype_bzip2, filetype_oftree, |