2023-04-17 07:51:08 -05:00
2021-12-31 00:35:04 -06:00
2020-11-08 11:41:05 -06:00
2023-03-18 07:46:29 +01:00
2023-03-29 12:45:21 -05:00
2023-04-09 20:41:45 -05:00
2023-04-09 20:41:45 -05:00
2020-11-08 11:06:38 -06:00
2022-12-03 02:45:58 -06:00
2023-01-04 06:40:57 -06:00
2023-01-17 10:20:11 -06:00
2023-04-12 08:44:48 -05:00
2022-06-18 01:32:51 -05:00

squashfs

PkgGoDev Go Report Card

A PURE Go library to read squashfs. There is currently no plans to add archive creation support as it will almost always be better to just call mksquashfs. I could see some possible use cases, but probably won't spend time on it unless it's requested (open a discussion fi you want this feature).

Currently has support for reading squashfs files and extracting files and folders.

Special thanks to https://dr-emann.github.io/squashfs/ for some VERY important information in an easy to understand format. Thanks also to distri's squashfs library as I referenced it to figure some things out (and double check others).

TODO

Limitations

  • No Xattr parsing. This is simply because I haven't done any research on it and how to apply these in a pure go way.
  • Socket files are not extracted.
    • From my research, it seems like a socket file would be useless if it could be created.
  • Fifo files are ignored on darwin

Issues

  • Larger, more complex archives have significant issues when doing a full extraction.
    • Seems to be mostly a problem with archives with many deep file trees.
    • It seems to not only take exponentially longer per nested folder, but also will eat all your system's memory as it does so.
    • Observed when tested Arch Linux's live iso's airootfs.sfs.
    • Accessing files / folders without extracting is NOT be effected.
  • Significantly slower then unsquashfs (about 5 ~ 7 times slower on a ~100MB archive using zstd compression)
    • This seems to be related to above along with the general optimization of unsquashfs and it's compression libraries.

Recommendations on Usage

Due to the above issue and performance consideration, this library should only be used to access files within the archive without extraction, or to mount it via Fuse.

  • Neither of these use cases are largely effected by the issues above.
S
Description
A Go library to read squashfs archives.
Readme MIT 15 MiB
2026-03-08 06:11:15 -05:00
Languages
Go 100%