vaeth / squashmount

Init and management script for mounting rewritable squashfs-compressed data
43 stars 3 forks source link

Check for squashfs support before deleting source dir #1

Closed hrk closed 10 years ago

hrk commented 10 years ago

I just run into an issue w/ the latest release available on the gentoo overlay.

I called squashmount start w/ default values on a system w/o squashfs support either compiled in or as a module (but squashfs-tools and union-fuse installed). squashmount performed the compression (mksquashfs), purged the source directories and then notified the failure to mount the squashfs image, moving on to the next directory (db, src, portage).

I have my blame (all my systems have squashfs support, I wonder why this one lacked it even though squashfs-tools were installed!) but I guess a check before starting up would be a plus.

vaeth commented 10 years ago

You can easily use "unsquash" to regenerate the directory, so the behaviour should not cause severe damage. Anyway, to the new release 4.4 I added a sanity check (attempting to mount the squashfile to a temporary directory) before wiping the old directory; this sanity check is done only when a fresh squashfile is created (not whenever a squashfile is just updated).

hrk commented 10 years ago

Yes, indeed, I "unsquash"-ed the kernel source tree and compiled squashfs as a module, now able to mount everything as it should. :) I agree that the sanity check is done only on a fresh squashfs file: the latter case would mean a miscompile of a new kernel, but the directories would be empty already. Thanks for your quick fix, I'm sync-ing the overlay as I reply. :)