Mount unionfs-fuse filesystems using the normal fileSystems option

This commit is contained in:
Eelco Dolstra
2014-07-30 16:04:15 +02:00
parent d45dcf348e
commit e68b0c7f5f
6 changed files with 52 additions and 38 deletions
+9 -1
View File
@@ -4,7 +4,8 @@ targetRoot=/mnt-root
console=tty1
export LD_LIBRARY_PATH=@extraUtils@/lib
export PATH=@extraUtils@/bin:@extraUtils@/sbin
export PATH=@extraUtils@/bin
ln -s @extraUtils@/bin /bin
fail() {
@@ -262,6 +263,13 @@ mountFS() {
checkFS "$device" "$fsType"
# Create backing directories for unionfs-fuse.
if [ "$fsType" = unionfs-fuse ]; then
for i in $(IFS=:; echo ${options##*,dirs=}); do
mkdir -m 0700 -p /mnt-root"${i%=*}"
done
fi
echo "mounting $device on $mountPoint..."
mkdir -p "/mnt-root$mountPoint" || true
+4 -4
View File
@@ -35,6 +35,7 @@ let
}
''
mkdir -p $out/bin $out/lib
ln -s $out/bin $out/sbin
# Copy what we need from Glibc.
cp -pv ${pkgs.glibc}/lib/ld*.so.? $out/lib
@@ -46,11 +47,10 @@ let
cp -pv ${pkgs.gcc.gcc}/lib*/libgcc_s.so.* $out/lib
# Copy BusyBox.
cp -rvd ${pkgs.busybox}/{bin,sbin} $out/
chmod -R u+w $out
cp -pvd ${pkgs.busybox}/bin/* ${pkgs.busybox}/sbin/* $out/bin/
# Copy some utillinux stuff.
cp -v ${pkgs.utillinux}/sbin/blkid $out/bin
cp -vf ${pkgs.utillinux}/sbin/blkid $out/bin
cp -pdv ${pkgs.utillinux}/lib/libblkid*.so.* $out/lib
cp -pdv ${pkgs.utillinux}/lib/libuuid*.so.* $out/lib
@@ -73,7 +73,7 @@ let
# Copy modprobe.
cp -v ${pkgs.kmod}/bin/kmod $out/bin/
ln -s kmod $out/bin/modprobe
ln -sf kmod $out/bin/modprobe
${config.boot.initrd.extraUtilsCommands}