Remove /tools and /cross-tools when cleaning

If we stop a build before the "do-housekeeping" target is executed, there
may be symlinks of the type /tools->/mnt/lfs/tools. If we want to restart,
for example after fixing something else, and we run the "creatingtoolsdir"
target (or similar one in CLFS) again, it will fail. It's better to clean
those symlinks when cleaning the build directory.
This commit is contained in:
Pierre Labastie 2020-03-29 13:05:48 +00:00
parent 20e3fcdec2
commit 5e4a124e3d

View file

@ -93,6 +93,9 @@ if [ "${CLEAN}" = "y" ]; then
echo -n "Cleaning remaining extracted sources in $BUILDDIR/sources ..." echo -n "Cleaning remaining extracted sources in $BUILDDIR/sources ..."
sudo rm -rf `find $BUILDDIR/sources -maxdepth 1 -mindepth 1 -type d` sudo rm -rf `find $BUILDDIR/sources -maxdepth 1 -mindepth 1 -type d`
echo "done" echo "done"
echo -n "Removing dangling symlinks in / ..."
sudo rm -f /tools /cross-tools
echo "done"
fi fi
fi fi
fi fi