2013-09-13 23:58:59 +02:00
|
|
|
#! @shell@ -e
|
|
|
|
|
|
|
|
chrootenvDest=/run/chrootenv/@name@
|
|
|
|
|
|
|
|
# Bind mount the Nix store
|
|
|
|
mount --bind /nix/store $chrootenvDest/nix/store
|
|
|
|
|
|
|
|
# Bind mount some kernel related stuff
|
|
|
|
mount --bind /dev $chrootenvDest/dev
|
|
|
|
mount --bind /dev/pts $chrootenvDest/dev/pts
|
|
|
|
mount --bind /dev/shm $chrootenvDest/dev/shm
|
|
|
|
mount --bind /proc $chrootenvDest/proc
|
|
|
|
mount --bind /sys $chrootenvDest/sys
|
|
|
|
|
|
|
|
# Bind mount home directories
|
|
|
|
mount --bind /home $chrootenvDest/home
|
|
|
|
|
|
|
|
# Bind mount state directories
|
|
|
|
mount --bind /var $chrootenvDest/var
|
2014-05-22 22:01:00 +02:00
|
|
|
mount --rbind /run $chrootenvDest/run
|
2013-09-13 23:58:59 +02:00
|
|
|
|
|
|
|
# Bind mount the host system's /etc
|
|
|
|
mount --bind /etc $chrootenvDest/host-etc
|
2014-09-09 10:53:52 +02:00
|
|
|
|
2015-08-24 00:42:40 +02:00
|
|
|
# Bind mount the host system's /tmp
|
|
|
|
mount --bind /tmp $chrootenvDest/host-tmp
|
|
|
|
|
2014-09-09 10:53:52 +02:00
|
|
|
# Bind mount /tmp
|
2014-10-22 10:39:17 +02:00
|
|
|
mount --bind /tmp/chrootenv-@name@ $chrootenvDest/tmp
|
2015-08-24 00:42:40 +02:00
|
|
|
|
|
|
|
# Expose sockets in /tmp
|
|
|
|
for i in /tmp/.*-unix; do
|
|
|
|
ln -s "/host-tmp/$(basename "$i")" "$chrootenvDest/$i"
|
|
|
|
done
|