2013-09-13 23:58:59 +02:00
|
|
|
#! @shell@ -e
|
|
|
|
|
|
|
|
chrootenvDest=/run/chrootenv/@name@
|
|
|
|
|
|
|
|
# Remove bind mount points
|
2014-09-09 10:53:52 +02:00
|
|
|
rmdir $chrootenvDest/{dev,nix/store,nix,proc,sys,host-etc,home,var,run,tmp}
|
2013-09-13 23:58:59 +02:00
|
|
|
|
|
|
|
# Remove symlinks to 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
|
|
|
|
rm $chrootenvDest/$(basename $i)
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Remove the remaining folders
|
2014-09-09 10:53:52 +02:00
|
|
|
rm -Rf $chrootenvDest/{etc,root}
|
|
|
|
rm -Rf /tmp/chrootenv-@name@
|
2013-09-13 23:58:59 +02:00
|
|
|
|
|
|
|
# Remove the chroot environment folder
|
|
|
|
rmdir $chrootenvDest
|