squashfs-tools icon indicating copy to clipboard operation
squashfs-tools copied to clipboard

mksquashfs and unsquashfs as a library

Open flxo opened this issue 2 years ago • 3 comments

The project today is binary centric around the mksquashfs and unsquashfs binaries. Calling this binaries during a build can be annoying since the binaries need to be present on the system in the correct version. Calling foreign binaries is also something that may fail easily.

The idea is to split the two binaries into tree parts:

  • libsquashfs: Library for creating and unpacking squashfs images with a (to be defined) C API
  • mksquashfs: CLI tool to create squashfs images (uses libsquashfs)
  • unsquashfs: CLI tool to unpack squashfs images (uses libsquashfs)

flxo avatar Aug 02 '21 07:08 flxo

So basically something like libsquashfs, which has a C API?

AgentD avatar Aug 02 '21 12:08 AgentD

So basically something like libsquashfs, which has a C API?

Exactly. We tried to use squashfs-tools-ng but experienced various problems compared to the images created with the "old" mksquashfs. The API of squashfs-tools-ng is super powerful but hard to use if you just want to pack a dir with some pseudo files.

flxo avatar Aug 02 '21 13:08 flxo

A high level abstraction wrapper is implemented in squashfs-tools-ng internally, but it was not move to libsquashfs as there were some open questions regarding a generic enough design, and it was assumed that any filesystem manipulation code would already have it's own such layer that libsquashfs would be integrated into, rather than the other way around.

I opened a ticket for this. Additional feedback is always welcome.

AgentD avatar Aug 03 '21 10:08 AgentD