Merge pull request #4007 from hrdinka/chrootenv-bind-tmp
build-fhs-chrootenv: bind mount chroots /tmp to hosts /tmp
This commit is contained in:
commit
2c25f3854f
@ -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
|
||||||
|
@ -45,4 +45,5 @@ ln -s ../../../host-etc/static/fonts/conf.d/00-nixos.conf $chrootenvDest/etc/fon
|
|||||||
mkdir $chrootenvDest/root
|
mkdir $chrootenvDest/root
|
||||||
|
|
||||||
# Create tmp folder
|
# Create tmp folder
|
||||||
mkdir -m1777 $chrootenvDest/tmp
|
mkdir -m1777 $chrootenvDest/tmp
|
||||||
|
mkdir -m1777 -p /tmp/chrootenv-@name@
|
||||||
|
@ -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
|
||||||
|
@ -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}
|
||||||
|
Loading…
Reference in New Issue
Block a user