2013-09-13 23:58:59 +02:00
|
|
|
#! @shell@ -e
|
|
|
|
|
|
|
|
chrootenvDest=/run/chrootenv/@name@
|
|
|
|
|
|
|
|
# Create some mount points for stuff that must be bind mounted
|
|
|
|
mkdir -p $chrootenvDest/{nix/store,dev,proc,sys,host-etc,home,var,run}
|
|
|
|
|
|
|
|
# Symlink the software that should be part of the chroot system profile
|
|
|
|
for i in @chrootEnv@/sw/*
|
|
|
|
do
|
|
|
|
if [ "$i" != "@chrootEnv@/sw/etc" ] && [ "$i" != "@chrootEnv@/sw/var" ]
|
|
|
|
then
|
|
|
|
ln -s "$i" "$chrootenvDest"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Symlink the contents of the chroot software's /etc
|
|
|
|
|
|
|
|
mkdir $chrootenvDest/etc
|
|
|
|
|
|
|
|
for i in @chrootEnv@/sw/etc/*
|
|
|
|
do
|
|
|
|
ln -s "$i" $chrootenvDest/etc
|
|
|
|
done
|
|
|
|
|
|
|
|
# Symlink some NSS stuff
|
|
|
|
ln -s ../host-etc/passwd $chrootenvDest/etc/passwd
|
|
|
|
ln -s ../host-etc/group $chrootenvDest/etc/group
|
|
|
|
ln -s ../host-etc/shadow $chrootenvDest/etc/shadow
|
|
|
|
ln -s ../host-etc/hosts $chrootenvDest/etc/hosts
|
|
|
|
ln -s ../host-etc/resolv.conf $chrootenvDest/etc/resolv.conf
|
|
|
|
ln -s ../host-etc/nsswitch.conf $chrootenvDest/etc/nsswitch.conf
|
|
|
|
|
|
|
|
# Symlink PAM stuff
|
|
|
|
rm $chrootenvDest/etc/pam.d
|
|
|
|
ln -s ../host-etc/static/pam.d $chrootenvDest/etc/pam.d
|
|
|
|
|
|
|
|
# Symlink Font stuff
|
2014-05-15 08:38:45 +02:00
|
|
|
mkdir -p $chrootenvDest/etc/fonts
|
2013-09-13 23:58:59 +02:00
|
|
|
ln -s ../../host-etc/static/fonts/fonts.conf $chrootenvDest/etc/fonts
|
2014-05-15 08:38:45 +02:00
|
|
|
mkdir -p $chrootenvDest/etc/fonts/conf.d
|
2013-09-13 23:58:59 +02:00
|
|
|
ln -s ../../../host-etc/static/fonts/conf.d/00-nixos.conf $chrootenvDest/etc/fonts/conf.d
|
|
|
|
|
|
|
|
# Create root folder
|
|
|
|
mkdir $chrootenvDest/root
|
|
|
|
|
|
|
|
# Create tmp folder
|
2014-09-09 10:53:52 +02:00
|
|
|
mkdir -m1777 $chrootenvDest/tmp
|
|
|
|
mkdir -m1777 -p /tmp/chrootenv-@name@
|