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
|
2015-02-05 16:12:14 +01:00
|
|
|
for i in @chrootEnv@/*
|
2013-09-13 23:58:59 +02:00
|
|
|
do
|
2015-02-05 16:12:14 +01:00
|
|
|
if [ "$i" != "@chrootEnv@/etc" ] && [ "$i" != "@chrootEnv@/var" ]
|
2013-09-13 23:58:59 +02:00
|
|
|
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
|