AgentD / squashfs-tools-ng

A new set of tools and libraries for working with SquashFS images
Other
194 stars 30 forks source link

gensquashfs: please consider adding equivalent of mksquashfs -wildcards -ef <exclude_file> #95

Closed intrigeri closed 2 years ago

intrigeri commented 2 years ago

Hi,

In Tails we use mksquashfs -wildcards -ef <exclude_file>, where <exclude_file> contains a list of filenames and globs (one per line) that may be present in the packed directory, but won't be included in the generated SquashFS.

I understand we could achieve something similar by manually generating a file listing we could pass to --pack-file, but that's not very convenient (and very pragmatically, to be honest: requires more work from us, so lower chances that we manage to allocate resources to migrating to gensquashfs soon).

Do you think this would be a valuable addition to the feature set of gensquashfs?

(I'm ready to hear "no" as an answer: as a software/OS maintainer myself, I'm aware that every newly added feature has a long term cost :)

AgentD commented 2 years ago

I'd rather not add something like that, since the whole tool has been designed from the start to work the exact other way around: listing explicitly what should be packed, rather than pack everything with a list of exceptions. Directory scan and the pack file can already be combined (see below). When adding an exclusion list on top of that, it would IMO create a few rather confusing corner cases.

On that note, version 1.1.x does support a glob keyword in the pack file. A find-style syntax and fnmatch based patterns can be used to search and add things from the pack directory. Would it be possible to use several, sufficiently narrow glob operations, to only add the things you need?

intrigeri commented 2 years ago

Hi,

Thanks again for the quick reply. I can't promise I'll be as fast on my side.

I'd rather not add something like that, since the whole tool has been designed from the start to work the exact other way around: listing explicitly what should be packed, rather than pack everything with a list of exceptions. Directory scan and the pack file can already be combined (see below). When adding an exclusion list on top of that, it would IMO create a few rather confusing corner cases.

I understand.

I'll see if we can work with this: I'm not sure the build software we're using allows us to hook at the exact right time to generate a pack file and apply our desired list of exclusions to it. If it does not, I have a couple other solutions in mind so I'm not worried.

On that note, version 1.1.x does support a glob keyword in the pack file. A find-style syntax and fnmatch based patterns can be used to search and add things from the pack directory. Would it be possible to use several, sufficiently narrow glob operations, to only add the things you need?

Thanks for the pointer. Looking at our current exclude list, it seems this is not going to help us.

Feel free to close this feature request as rejected :)