It's not review-tools related - instead, it looks like the first resquash of a freshly-unsquashed tree has the weird link/file, whereas the second resquash passes.
It would appear the mere act of reading or even stat'ing the wonky link/file (squashfs-root/snap/hooks/post-refresh) tickles it into being correct.
I wonder if the problem is filesystem-related at a lower level and affects only Focal?
Reproducer using bash only, to be run on a Focal system with squashfs-tools 4.4.
It's not review-tools related - instead, it looks like the first resquash of a freshly-unsquashed tree has the weird link/file, whereas the second resquash passes.
It would appear the mere act of reading or even stat'ing the wonky link/file (squashfs- root/snap/ hooks/post- refresh) tickles it into being correct.
I wonder if the problem is filesystem-related at a lower level and affects only Focal?
Reproducer using bash only, to be run on a Focal system with squashfs-tools 4.4.
(adjust the /path/to/snap, get the snap from here, it's public: https:/ /api.snapcraft. io/api/ v1/snaps/ download/ jtpboSYvTCEyHou tkkRo1SI9ioSMOU b3_1588. snap)
mkdir -p /tmp/review- tools-test2oud6 q5y tools-test2oud6 q5y/squashfs- root /path/to/ jtpboSYvTCEyHou tkkRo1SI9ioSMOU b3_1588. snap tools-test2oud6 q5y/squashfs- root/snap/ hooks/post- refresh tools-test2oud6 q5y/squashfs- root /tmp/review- tools-test2oud6 q5y/repack. snap -fstime 1626625683 -noappend -comp xz -all-root -no-xattrs -no-fragments tools-test2oud6 q5y/squashfs- root /tmp/review- tools-test2oud6 q5y/repack2. snap -fstime 1626625683 -noappend -comp xz -all-root -no-xattrs -no-fragments tools-test2oud6 q5y/*.snap
unsquashfs -no-progress -d /tmp/review-
# Uncomment the following line to make things work / generate same checksum
# stat review-
echo "squashing"
mksquashfs /tmp/review-
mksquashfs /tmp/review-
echo "comparing"
sha512sum /tmp/review-
echo "good sum is b615b403f..."