Merge pull request #4007 from hrdinka/chrootenv-bind-tmp

build-fhs-chrootenv: bind mount chroots /tmp to hosts /tmp
This commit is contained in:
Sander van der Burg 2014-09-09 21:17:50 +02:00
commit 2c25f3854f
4 changed files with 9 additions and 4 deletions

View File

@ -3,7 +3,7 @@
chrootenvDest=/run/chrootenv/@name@ chrootenvDest=/run/chrootenv/@name@
# Remove bind mount points # 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 # Remove symlinks to the software that should be part of the chroot system profile
for i in @chrootEnv@/sw/* for i in @chrootEnv@/sw/*
@ -15,7 +15,8 @@ do
done done
# Remove the remaining folders # 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 # Remove the chroot environment folder
rmdir $chrootenvDest rmdir $chrootenvDest

View File

@ -46,3 +46,4 @@ mkdir $chrootenvDest/root
# Create tmp folder # Create tmp folder
mkdir -m1777 $chrootenvDest/tmp mkdir -m1777 $chrootenvDest/tmp
mkdir -m1777 -p /tmp/chrootenv-@name@

View File

@ -21,3 +21,6 @@ mount --rbind /run $chrootenvDest/run
# Bind mount the host system's /etc # Bind mount the host system's /etc
mount --bind /etc $chrootenvDest/host-etc mount --bind /etc $chrootenvDest/host-etc
# Bind mount /tmp
mount --bind /tmp/chrootenv-@name@ /run/chrootenv/steam/tmp

View File

@ -3,4 +3,4 @@
chrootenvDest=/run/chrootenv/@name@ chrootenvDest=/run/chrootenv/@name@
# Unmount all (r)bind mounts # 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}