构建前需进入 squashfs-tools 源码子目录,顶层目录直接 make 无效;压缩算法、XATTR 支持和安装路径需改 Makefile 而非命令行参数;具体用法和安装细节在 Documentation/4.7.5 下的 README.md 与 INSTALL.md,README 本身未展开
cd squashfs-tools && make
sudo make installREADME 未说明
官方 Squashfs 工具集,用来创建和解包只读压缩文件系统镜像
创建和解压 Squashfs 只读文件系统的命令行工具集,常用于制作 Linux 镜像、嵌入式根文件系统和压缩归档包。
核心能力
- 提供 mksquashfs 生成 Squashfs 镜像
- 提供 unsquashfs 解包并提取镜像内容
- 在 squashfs-tools 目录执行 make 即可构建
- 可编辑 Makefile 选择压缩算法与安装路径
- 支持配置 XATTR 与并行读取线程数
容易踩的坑
- 4.7.5Squashfs tools 4.7.5最新正式版2026-03-01 · 2026-03-01 23:05 UTC
4.7.5 (01 MAR 2026): Bug fix release (mostly)
-
New options & improvements
- Mksquashfs/Sqfstar: new -numeric-owner option which uses the numeric uid and gid in the tarfile rather than the user name or the group name.
- Error messages produced by the date command and symbolic mode parser printed by the pager rather than to stderr.
-
Major bug fixes
- Fix possible corruption of Squashfs filesystems if sparse files present (caused by elimination of "fragment block stall" in 4.7).
- Fix pseudo file f/F definition (create file from output of command) when input has greater than a block of contiguous zeros (caused by sparse file reading optimisation in 4.7.3).
- Fix issue where files which are larger than available buffer space will not be found to be a duplicate (caused by elimination of "fragment block stall" in 4.7).
- Fix broken Mksquashfs -max-depth option.
-
Minor bug fixes
- Mksquashfs: segmentation fault if no sources and pseudo file root ("/") definition only defines an Xattr but no metadata.
- Mksquashfs/Sqfstar: -offset should be rejected if -stream option used.
- Mksquashfs: hard links to symbolic links may be ignored (first access to symbolic link after creation).
- Pseudo files: a M (modify with timestamp) definition on a directory causes pseudo file definitions below it in hierarchy to be ignored.
- Pseudo files: a m/M modify definition breaks checks that a directory exists and it is a directory (rather than something else).
- Mksquashfs: -max-depth option marks empty directories as having excluded files.
- Mksquashfs/Sqfstar should produce identical output with only pseudo files.
- Define SEEK_DATA if not defined by C library.
-
- 4.7.4Squashfs tools 4.7.42025-11-09 · 2025-11-09 23:32 UTC
查看更新说明
4.7.4 (09 NOV 2025): Bug fix release
- Fix regression introduced by SEEK_DATA optimisation
- Fix regression introduced by -stream option
- Fix build on big-endian machines (Daniel Néri)
- 4.7.3Squashfs tools 4.7.32025-11-05 · 2025-11-05 23:13 UTC
查看更新说明
Note: please download squashfs-tools-4.7.3.tar.gz, not the auto-generated files. The .gitattributes file unexpectedly deleted README.md in Documentation/4.7.3 in addition to the top-level README.md. The squashfs-tools-4.7.3.tar.gz has this fixed.
4.7.3 (05 NOV 2025): Mksquashfs streaming output, optimised reading of Sparse files using SEEK_DATA, new aligned action, documentation formatted in markdown.
-
Mksquashfs/Sqfstar can now stream output filesystem to STDOUT.
- New -stream option which directs filesystem to STDOUT. This can be used to send the output of Mksquashfs to another computer via ssh, where there isn't enough disk space on the host computer.
- New -fix option to fix-up the streamed filesystem. The streamed filesystem will have the super-block written to the end of the filesystem. The -fix option writes the super-block to the usual start of the filesystem.
- Unsquashfs has been extended to recognise a streamed filesystem with the super-block at the end.
-
Reading of sparse files has been optimised
- If the filesystem supports the SEEK_DATA lseek operation, this is used to skip holes when reading sparse files. This can produce a 240 times speed improvement.
- Holes which are multiple Squashfs data blocks in size are now handled as large multi-block sparse regions, which further speed up sparse file handling. This can produce a six times speed improvement (in total 1500 times).
-
New Align(value) action, which will align file to <value>
- Any file which matches test operator(s) will be aligned to <value> byte boundary, where <value> is a pure power of two and 64 Megabytes or less.
- Any file which has an alignment applied will be separately compressed and not packed into a fragment block.
-
Squashfs tools documentation has been formatted in GitHub markdown
- New CHANGES.md changelog file
- New 4.7.3 README.md
- New USAGE.md, USAGE-MKSQUASHFS.md, USAGE-UNSQUASHFS.md, USAGE-SQFSTAR.md and USAGE-SQFSCAT.md
-
- 4.7.2Squashfs tools 4.7.22025-08-18 · 2025-08-18 20:35 UTC
查看更新说明
4.7.2 18 AUG 2025 Fix build with non-static inline 1. print_pager: make inline quoted_bs_char() static. - 4.7.1Squashfs tools 4.7.12025-08-18 · 2025-08-18 18:04 UTC
查看更新说明
4.7.1 18 AUG 2025 Minor improvements and bug fix release 1. Fix regression in -offset (-o) where it stopped working in Mksquashfs and Sqfstar. 2. Allow arguments (spaces) in the PAGER environment variable, rather than just a command name. Also support quoted strings, string concatenation and backslashes. 3. Don't use a pager to display the help text if the PAGER environment variable is empty. 4. Add -no-pager option which if specified means a pager won't be used to display the help text. 5. Add -cols option which specifies the number of columns used to display the help text. This is useful if output is not to a terminal. 6. Fix regression in tar file reading, where file exclusion would leak cache (memory) leading in some cases to Sqfstar hanging. 7. Handle negative dates in tar files (before the start of the epoch of 1970-01-01), and round them up to the start of the epoch. 8. Add --version spelling in addition to -version, as this appears to be a common mistake. 9. Add missing include files in print_pager.c (Ros Burton). 10. Add missing include file in thread.c (Shiji Yang). 11. Fix BLOCK_READER_THREADS typo in Makefile (Alexandru Ardelean).
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Welcome to Squashfs-tools!
This is the official Squashfs-tools repository.
To build and install the tools please read the Documentation/4.7.5/INSTALL.md file
To find out how use the latest release please start by reading Documentation/4.7.5/README.md
The latest 4.7.5 release may have already been packaged for your distribution, please see "Packaging status" below.
Thanks
Contents of the repository
The top-level directory contains the following files:
- ACKNOWLEDGEMENTS - This contains some historical acknowlegements, this file has mostly been replaced by the Github issues tracker.
- CHANGES - a reverse chronological list of changes from the latest release to the earliest release.
- CHANGES.md - the above file in markdown format.
- CONTRIBUTING.md - how to ask for features (feature requests), and the way to do Pull requests.
- COPYING - GNU general public license file.
- INSTALL - where to get the INSTALL file for your version of squashfs-tools.
- README - where to get the README for your version of squashfs-tools.
- README.md - The file displayed here.
- SECURITY.md - Where to report security issues.
- USAGE - where to get the USAGE files for your version of squashfs-tools.
The top-level directory has the following directories:
- Documentation - this directory contains documentation for various versions of squashfs-tools, and it is split into subdirectories for versions 4.5 through to 4.7.6, the latest released version is 4.7.5, and the development version will become 4.7.6. It also has a directory containing prebuilt manpages for the latest development version of squashfs-tools.
- squashfs-tools - the source code directory, enter this directory and type
maketo build, orsudo make installto install. Edit the Makefile to change the compression algorithms built and other defaults including install PATH, XATTR support, and number of parallel reader threads.