mergelayers:
Create a merged sfs file from a list of sfs files,
and/or directories, specified on the command line.
Usage:
mergelayers -h
mergelayers <sfs file> <sfs file> [<sfs file>...] <output sfs file>
Notes:
The list is in stack order, i.e. the first sfs is the top of the stack.
<sfs file> must exist.
<sfs file> can be a directory.
<output sfs file> can NOT be a directory.
<output sfs file> is not included in the merge.
<output sfs file> does not need to exist.
If <output sfs file> does exist,
it will be replaced by the sfs file written by the merge.
If a file called "${prefix}*include.lst" exists for a particular sfs,
e.g 'fdrv_include.lst',
the files specified in this file are extracted to,
a directory called "./${prefix}Dir"
e.g. './fdrvDir'
and this diretory is used in the merge instead of the whole sfs.
About:
'mergelayers' is IO efficient, it does the merge by mounting the layers in a stack.
If the first parameter is a directory containg aufs style whiteout files, aufs will be used,
otherwise overlayfs will be used.
'mergelayers' then does a 'mksquashfs' of the stack's mount-point.
If you include a savefolder as the first parameter, make sure that all sfs files are listed in the following parameters.
Otherwise previously "deleted" files in the ommitted sfs files will reappear.
(Relevant whiteout files would have been "lost" in the merge.)
A utility to merge sfs files is not a new concept, there are a few existing utilities that do this.
However, this is my take on implementing the concept.