🗜️ fast r/o squashfs implementation written in C. https://gottox.de/sqsh-tools/
  • C 94.7%
  • Meson 2.1%
  • Shell 1.6%
  • Roff 1.2%
  • C++ 0.3%
Find a file
Enno T. Boland 2c0badba16
Some checks are pending
CI / format-check (push) Waiting to run
CI / test (x86_64) (push) Blocked by required conditions
CI / fuzzer (push) Blocked by required conditions
CI / build (x86_64, clang, disabled) (push) Blocked by required conditions
CI / build (x86_64, clang, enabled) (push) Blocked by required conditions
CI / build (x86_64, gcc, disabled) (push) Blocked by required conditions
CI / build (x86_64, gcc, enabled) (push) Blocked by required conditions
CI / build-linux32 (push) Blocked by required conditions
CI / build-openbsd (arm64) (push) Blocked by required conditions
CI / build-openbsd (x86_64) (push) Blocked by required conditions
CI / build-mac (push) Blocked by required conditions
CI / doxygen (push) Blocked by required conditions
CI / release (push) Blocked by required conditions
CodeCov / CodeCov (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
Merge pull request 'unpack: do not set errno to negative values' (#339) from fix/unpack into main
Reviewed-on: #339
2026-03-05 11:12:54 +01:00
.github .github: update openbsd to newest version 2026-02-03 11:40:46 +01:00
common common/reader: reader_iterator_next() should always return true for a non-error case 2025-11-30 09:28:14 +01:00
doc chores: muon reformat 2025-08-11 18:11:52 +02:00
examples examples: do not use deprecated functions in custom mapper 2024-08-18 19:38:35 +02:00
fuzzer reader: make offset uint64_t instead of platform dependend sqsh_index_t 2024-08-12 17:49:25 +02:00
include sqsh_data: deprecate field with typo: SQS_LZ4_FLAG_NONE. Replaced by SQSH_LZ4_FLAG_NONE 2026-02-17 22:10:37 +01:00
libmksqsh utils: fix _log2 return types for platforms where int isn't 32bit 2024-01-07 09:28:13 +01:00
libsqsh file_iterator: fix casting to 32bit too early. 2026-02-27 16:46:33 +01:00
subprojects chores: move subproject wraps to codeberg. 2026-02-03 18:48:41 +01:00
test libsqsh: fix overflow bugs on 32bit systems. 2026-02-07 23:40:12 +01:00
tools unpack: do not set errno to negative values 2026-03-05 11:12:05 +01:00
.cirrus.yml .cirrus.yml: update freebsd image 2026-02-02 19:23:10 +01:00
.clang-format clang-format: indent macros 2022-11-08 10:54:10 +01:00
.clang-tidy chores: update Makefile and tidy configuration 2023-05-16 11:19:55 +02:00
.editorconfig .editorconfig: add settings for yaml files 2023-04-15 20:05:24 +02:00
.gitignore subprojects: pull from git, use static revisions 2024-05-24 17:09:18 +02:00
.mailmap add .mailmap 2023-03-17 08:38:05 +01:00
.Mk.yaml .Mk.yaml: use build modes 2024-06-11 09:09:49 +02:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2023-05-30 08:44:52 +02:00
LICENSE chores: update licenses 2024-01-02 12:06:49 +01:00
meson.build libsqsh: switch from radix trees ot hashmaps 2026-02-02 18:32:54 +01:00
meson_options.txt libsqsh: move posix function to own module 2024-05-30 21:39:26 +02:00
README.md Update links to libsqsh-lzo 2026-02-03 18:57:10 +01:00

sqsh-tools CI codecov Quality Gate Status License

squashfs is an open and free compressed read-only filesystem. It is used in embedded devices, live-CDs, or in packaging. The original implementation resides in the linux kernel, but there are also userspace implementations.

This project provides a userspace implementation of the squashfs filesystem containing a set of command line tools and a C library.

users of sqsh-tools

  • radare2 - A reverse engineering framework. Integrates libsqsh into their virtual filesystem framework to explore inline squashfs archives.
  • Filer - A file manager for Unix systems. Uses libsqsh to show previews of AppImages without mounting them first.
  • sqsh-rs - Rust bindings for libsqsh.

Building

Dependencies

  • libc: Any POSIX compliant libc should work. Open a bug if it doesn't.
  • zlib optional: For gzip compression support.
  • liblz4 optional: For lz4 compression support.
  • liblzma optional: For lzma compression support.
  • libzstd optional: For zstd compression support.
  • fuse3 optional: For mounting squashfs archives.
  • fuse2 optional: For mounting squashfs archives on systems that don't support fuse3. e.g. OpenBSD.
  • libcurl optional: For transparently reading squashfs archives from the internet without downloading them first.

Note that to do anything useful with libsqsh, you need to have at least one of the compression libraries enabled.

Compile & Install

meson setup build
cd build
meson compile
meson install

tools

This project provides a set of command line tools to interact with squashfs archives.

  • sqsh-cat: Prints the content of one or multiple files to stdout.
  • sqsh-ls: Lists the content of a directory.
  • sqsh-stat: Prints the metadata of a file, directory, or the whole archive.
  • sqsh-unpack: Extracts a squashfs archive to a directory.
  • sqsh-xattr: Prints the extended attributes of a file or directory.
  • sqshfs: Mounts a squashfs archive to a directory. There are two versions of this tool, one for fuse3 and one for fuse2.

libsqsh

sqsh-tools also provides a C library to interact with squashfs archives. There are two APIs available:

  • Easy API: This API is designed to be easy to use and provides a simple interface to read the content of a squashfs archive. It is the recommended API to use.

  • Low-level API: This API provides a more fine-grained control over the squashfs archive. It allows zero copy reading of the archive.

For more information, see the libsqsh README.

LZO2

LZO2 is a fast compression algorithm. Unfortunately the current implementation is GPL licensed and therefore not included in this library. If you want to use LZO2 there's and independent glue library called libsqsh-lzo.