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

squashfs support for uuid and label

Open bcarnes opened this issue 9 months ago • 1 comments

Here's working code for #59, the basics of which I've reimplemented a few times over the years.

Curious what @plougher thinks about this approach.

Due to the way squashfs directly stores the offsets to the datablocks and fragments, and the remaining sections having offsets stored in the superblock... no squashfs-mount/unsquashfs/etc implementation I've encountered ever expects or needs the datablocks to start at the next byte after the (optional) compression options metablock.

As such, it has proved to be perfectly backwards compatible wherever I've used it.

See https://github.com/plougher/squashfs-tools/issues/59#issuecomment-1710941443 for how it is used, behaves, and how to build it (and the corresponding changes to libblkid)

Let me know if this approach (or something similar) has a chance of being merged upstream.

Only after the above question is answered... here are some preemptive comments for other things to think about before considering merging:

  • Allow dependency on libuuid? (so we can internally generate random uuids when desired without a shell call to uuidgen)
  • Add support for sqfstar equivalents, update docs, etc.
  • What is the desired -append behavior w/ uuid/labels?
  • Talk about ability to add/remove a uuid/label from an existing squashfs (that has or doesn't have an existing uuid/label).

bcarnes avatar Sep 08 '23 02:09 bcarnes