2013-09-13 22:58:59 +01:00
|
|
|
#! @shell@ -e
|
|
|
|
|
|
|
|
chrootenvDest=/run/chrootenv/@name@
|
|
|
|
|
|
|
|
# Remove bind mount points
|
2014-09-09 09:53:52 +01:00
|
|
|
rmdir $chrootenvDest/{dev,nix/store,nix,proc,sys,host-etc,home,var,run,tmp}
|
2013-09-13 22:58:59 +01:00
|
|
|
|
|
|
|
# Remove symlinks to the software that should be part of the chroot system profile
|
2015-02-05 15:12:14 +00:00
|
|
|
for i in @chrootEnv@/*
|
2013-09-13 22:58:59 +01:00
|
|
|
do
|
2015-02-05 15:12:14 +00:00
|
|
|
if [ "$i" != "@chrootEnv@/etc" ] && [ "$i" != "@chrootEnv@/var" ]
|
2013-09-13 22:58:59 +01:00
|
|
|
then
|
|
|
|
rm $chrootenvDest/$(basename $i)
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Remove the remaining folders
|
2014-09-09 09:53:52 +01:00
|
|
|
rm -Rf $chrootenvDest/{etc,root}
|
|
|
|
rm -Rf /tmp/chrootenv-@name@
|
2013-09-13 22:58:59 +01:00
|
|
|
|
|
|
|
# Remove the chroot environment folder
|
|
|
|
rmdir $chrootenvDest
|