View Issue Details

IDProjectCategoryView StatusLast Update
0000107fileGeneralpublic2019-09-30 15:51
Reporterlucas.hartmann Assigned Tochristos  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.36 
Fixed in Version5.38 
Summary0000107: Add report for squashfs compression algorithm
DescriptionFeature request: Report compression algorithm for squashfs files.

Compression is included in the squashfs superblock, uint16_t at offset 20 from the start of the file. Values are:
0 - uncompressed (unsure)
1 - zlib compressed
2 - lzma compressed
3 - lzo compressed
4 - xz compressed
5 - lz4 compressed
6 - zstd compressed

Source: *_COMPRESSION macros, and struct squashfs_super_block at
https://sourceforge.net/p/squashfs/code/ci/master/tree/squashfs-tools/squashfs_fs.h#l295
TagsNo tags attached.

Activities

lucas.hartmann

2019-09-26 15:09

reporter   ~0003308

This may do it.
squashfs_compression.patch (1,040 bytes)   
diff -Naur file-5.37/magic/Magdir/filesystems file-5.37-mod/magic/Magdir/filesystems
--- file-5.37/magic/Magdir/filesystems	2019-04-23 12:43:27.000000000 -0300
+++ file-5.37-mod/magic/Magdir/filesystems	2019-09-26 12:01:45.912325776 -0300
@@ -2150,6 +2150,13 @@
 0	string	sqsh	Squashfs filesystem, big endian,
 >28	beshort	x	version %d.
 >30	beshort x	\b%d,
+>20 beshort =0 uncompressed,
+>20 beshort =1 zlib compressed,
+>20 beshort =2 lzma compressed,
+>20 beshort =3 lzo compressed,
+>20 beshort =4 xz compressed,
+>20 beshort =5 lz4 compressed,
+>20 beshort =6 zstd compressed,
 >28	beshort <3
 >>8	belong	x	%d bytes,
 >28	beshort >2
@@ -2173,6 +2180,13 @@
 0	string	hsqs	Squashfs filesystem, little endian,
 >28	leshort	x	version %d.
 >30	leshort	x	\b%d,
+>20 leshort =0 uncompressed,
+>20 leshort =1 zlib compressed,
+>20 leshort =2 lzma compressed,
+>20 leshort =3 lzo compressed,
+>20 leshort =4 xz compressed,
+>20 leshort =5 lz4 compressed,
+>20 leshort =6 zstd compressed,
 >28	leshort <3
 >>8	lelong	x	%d bytes,
 >28	leshort >2
squashfs_compression.patch (1,040 bytes)   

christos

2019-09-30 15:51

manager   ~0003310

Fixed, thanks!

Issue History

Date Modified Username Field Change
2019-09-26 01:39 lucas.hartmann New Issue
2019-09-26 15:09 lucas.hartmann File Added: squashfs_compression.patch
2019-09-26 15:09 lucas.hartmann Note Added: 0003308
2019-09-30 15:50 christos Assigned To => christos
2019-09-30 15:50 christos Status new => assigned
2019-09-30 15:51 christos Status assigned => resolved
2019-09-30 15:51 christos Resolution open => fixed
2019-09-30 15:51 christos Fixed in Version => 5.38
2019-09-30 15:51 christos Note Added: 0003310