Closed ncw closed 1 year ago
Fixed with v0.8.2
.
In theory mksquashfs
should only have sparse blocks (only zero blocks) if they are a full blocksize, but evidently that isn't necessarily true. I simply added a check that if it is asking for a sparse block on a file that is less then a block in size then it only creates a file of the file size. It's possible that this isn't a clean fix since it seems that mksquashfs
is doing things with sparse files that the documentation I use doesn't cover. Particularly it's possible that a block that's less then blocksize at the end of a larger file (such as if never fragment is specified) that's sparse could have a similar issue. That being said, that would take a bit more work then a quick fix so I'll worry about that when/if it shows up.
I can confirm this fixes my problem - thank you for a super quick fix :-)
Summary: A file with 321 NULLs unpacks as 128k of NULLs.
I've made a small test archive - unzip the
bug.sqsh
to demonstrate:bug.sqfs.zip
Comparing the two extractions
vs
file2
is 321 bytes of NULLs where it seems to have unpacked as 131072 bytes (so one block) of NULLs with go-unsquashfsbug.sqsh
was made like this, so with default options formksquashfs
.