I was recently surprised when I noticed that unsquashing and re-squashing a squashfs (e.g., a TCL extension) causes its md5sum to change, even if no changes have been made to the squashfs. Give it a try if you don't believe me
Given how much our favorite distro relies on squashfs and md5sums, I decided to investigate.
It turns out that mksquashfs generates some timestamp metadata, which causes the md5sum to change. Given that metadata usually does not have an impact on md5sum (e.g.,
touching a file and changing its ownership and/or permissions does not cause a change in md5sum), mksquashfs's behavior is counterintuitive and feels like a bug in its design.
Some people have created a patch to work around this (see
here, for example). I'm going to start using a patched version of mksquashfs that behaves as expected.
Would the TCL developers like me to update the squashfs-tools.tcz extension with patched version of mksquashfs, where not changing md5sum (i.e., -no-date option) is the default behavior, unless -date is specified?