mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
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@
|
||||
|
||||
# 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
|
||||
|
@ -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@
|
||||
|
@ -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
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user