3

Is there any tool to examine an existing squashfs image and and find out compression ratios per file?

Bonus points if it helps me can estimate the flash usage of statically linked symbols in a huge executable.

Atilla Filiz
  • 2,383
  • 8
  • 29
  • 47

2 Answers2

4

The 7zip program can supply the information. Use 7z l -slt squasfsfile and you get machine readable listing of each file, including original and packed (compressed) size.

Roger Binns
  • 3,203
  • 1
  • 24
  • 33
  • Also, `7z l squasfsfile` (without `-slt`) prints original/compressed sizes per file in a compact table as well as totals. – AleXoundOS Nov 04 '21 at 15:14
1

My ruby squashfs implementation makes this pretty easy to implement. Check out this revision: https://github.com/vasi/squash.rb/tree/9bac822ac08892a9764fb92314cad4066742ce06

Note that squashfs bunches up small files (and the tail ends of large files) and compresses these 'fragments' together. It's impossible to figure out exactly how much each file contributes to these bunches, so I estimated that part.

vasi
  • 1,026
  • 7
  • 6