unionfs: Add mount helper (mount.unionfs-fuse)
This makes it possible to mount unionfs directly with mount or fstab. Example fstab entry: none /mnt/union unionf-fuse allow-other,dirs=/source1=RW,/source2=RW Note, the dirs= option need to be the last option, due to limitations in the mount helper provided by unionfs-fuse. Maybe we should write a better helper ourselves. Also, you need to specify your branches as dirs= option, NOT as the device, since the latest version of libmount always interprets "=" characters in the device name as a tag (like LABEL, UUID etc) and will try to resolve the tag before calling the mount helper. This will of course not succeed and the mount will fail.
This commit is contained in:
parent
08f1b426bc
commit
7870db8b10
1 changed files with 13 additions and 1 deletions
|
@ -5,12 +5,24 @@ stdenv.mkDerivation rec {
|
|||
|
||||
src = fetchurl {
|
||||
url = "http://podgorny.cz/unionfs-fuse/releases/${name}.tar.xz";
|
||||
|
||||
sha256 = "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d";
|
||||
};
|
||||
|
||||
buildInputs = [ cmake fuse ];
|
||||
|
||||
# Put the unionfs mount helper in place as mount.unionfs-fuse. This makes it
|
||||
# possible to do:
|
||||
# mount -t unionfs-fuse none /dest -o dirs=/source1=RW,/source2=RO
|
||||
#
|
||||
# This must be done in preConfigure because the build process removes
|
||||
# helper from the source directory during the build.
|
||||
preConfigure = ''
|
||||
ensureDir $out/sbin
|
||||
cp -a mount.unionfs $out/sbin/mount.unionfs-fuse
|
||||
substituteInPlace $out/sbin/mount.unionfs-fuse --replace mount.fuse ${fuse}/sbin/mount.fuse
|
||||
substituteInPlace $out/sbin/mount.unionfs-fuse --replace unionfs $out/bin/unionfs
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "FUSE UnionFS implementation";
|
||||
homepage = http://podgorny.cz/moin/UnionFsFuse;
|
||||
|
|
Loading…
Reference in a new issue