diff options
author | Sander van der Burg <svanderburg@gmail.com> | 2014-09-09 21:17:50 +0200 |
---|---|---|
committer | Sander van der Burg <svanderburg@gmail.com> | 2014-09-09 21:17:50 +0200 |
commit | 2c25f3854f321c705fe7a0c6b614a8f4f7b987f0 (patch) | |
tree | b86dbbeef74d2c95b1025f8c0455ea4fa328cad6 /pkgs | |
parent | 70c27cfc3d24dd6d47ddef7f077380a0971ac8d2 (diff) | |
parent | 4f5b4ceb858c36f77a83dbcd7e5ecccae36696d0 (diff) | |
download | nixlib-2c25f3854f321c705fe7a0c6b614a8f4f7b987f0.tar nixlib-2c25f3854f321c705fe7a0c6b614a8f4f7b987f0.tar.gz nixlib-2c25f3854f321c705fe7a0c6b614a8f4f7b987f0.tar.bz2 nixlib-2c25f3854f321c705fe7a0c6b614a8f4f7b987f0.tar.lz nixlib-2c25f3854f321c705fe7a0c6b614a8f4f7b987f0.tar.xz nixlib-2c25f3854f321c705fe7a0c6b614a8f4f7b987f0.tar.zst nixlib-2c25f3854f321c705fe7a0c6b614a8f4f7b987f0.zip |
Merge pull request #4007 from hrdinka/chrootenv-bind-tmp
build-fhs-chrootenv: bind mount chroots /tmp to hosts /tmp
Diffstat (limited to 'pkgs')
4 files changed, 9 insertions, 4 deletions
diff --git a/pkgs/build-support/build-fhs-chrootenv/destroy.sh.in b/pkgs/build-support/build-fhs-chrootenv/destroy.sh.in index 30b51cb5068f..8ddf350913eb 100644 --- a/pkgs/build-support/build-fhs-chrootenv/destroy.sh.in +++ b/pkgs/build-support/build-fhs-chrootenv/destroy.sh.in @@ -3,7 +3,7 @@ chrootenvDest=/run/chrootenv/@name@ # Remove bind mount points -rmdir $chrootenvDest/{dev,nix/store,nix,proc,sys,host-etc,home,var,run} +rmdir $chrootenvDest/{dev,nix/store,nix,proc,sys,host-etc,home,var,run,tmp} # Remove symlinks to the software that should be part of the chroot system profile for i in @chrootEnv@/sw/* @@ -15,7 +15,8 @@ do done # Remove the remaining folders -rm -Rf $chrootenvDest/{etc,root,tmp} +rm -Rf $chrootenvDest/{etc,root} +rm -Rf /tmp/chrootenv-@name@ # Remove the chroot environment folder rmdir $chrootenvDest diff --git a/pkgs/build-support/build-fhs-chrootenv/init.sh.in b/pkgs/build-support/build-fhs-chrootenv/init.sh.in index 5b0ab94bc4eb..079ec09d60f7 100644 --- a/pkgs/build-support/build-fhs-chrootenv/init.sh.in +++ b/pkgs/build-support/build-fhs-chrootenv/init.sh.in @@ -45,4 +45,5 @@ ln -s ../../../host-etc/static/fonts/conf.d/00-nixos.conf $chrootenvDest/etc/fon mkdir $chrootenvDest/root # Create tmp folder -mkdir -m1777 $chrootenvDest/tmp +mkdir -m1777 $chrootenvDest/tmp +mkdir -m1777 -p /tmp/chrootenv-@name@ diff --git a/pkgs/build-support/build-fhs-chrootenv/mount.sh.in b/pkgs/build-support/build-fhs-chrootenv/mount.sh.in index 225d9dbc4f72..c64f9356283b 100644 --- a/pkgs/build-support/build-fhs-chrootenv/mount.sh.in +++ b/pkgs/build-support/build-fhs-chrootenv/mount.sh.in @@ -21,3 +21,6 @@ mount --rbind /run $chrootenvDest/run # Bind mount the host system's /etc mount --bind /etc $chrootenvDest/host-etc + +# Bind mount /tmp +mount --bind /tmp/chrootenv-@name@ /run/chrootenv/steam/tmp diff --git a/pkgs/build-support/build-fhs-chrootenv/umount.sh.in b/pkgs/build-support/build-fhs-chrootenv/umount.sh.in index 5089141c0aa4..b8222a4121ab 100644 --- a/pkgs/build-support/build-fhs-chrootenv/umount.sh.in +++ b/pkgs/build-support/build-fhs-chrootenv/umount.sh.in @@ -3,4 +3,4 @@ chrootenvDest=/run/chrootenv/@name@ # Unmount all (r)bind mounts -umount -l $chrootenvDest/{dev/pts,dev/shm,dev,nix/store,proc,sys,host-etc,home,var,run} +umount -l $chrootenvDest/{dev/pts,dev/shm,dev,nix/store,proc,sys,host-etc,home,var,tmp,run} |