Fixed clean_buildir function to handle properly dev, proc, and sys directories.
This commit is contained in:
parent
e4f732cf50
commit
a5e3400f3a
1 changed files with 14 additions and 2 deletions
|
@ -12,7 +12,7 @@ ${DD_BORDER}
|
||||||
|
|
||||||
${tab_}${tab_}${BOLD}${RED}W A R N I N G${OFF}
|
${tab_}${tab_}${BOLD}${RED}W A R N I N G${OFF}
|
||||||
Looks like the \$BUILDDIR directory contains subdirectories
|
Looks like the \$BUILDDIR directory contains subdirectories
|
||||||
from a previous HLFS build.
|
from a previous build.
|
||||||
|
|
||||||
Please format the partition mounted on \$BUILDDIR or set
|
Please format the partition mounted on \$BUILDDIR or set
|
||||||
a different build directory before running jhalfs.
|
a different build directory before running jhalfs.
|
||||||
|
@ -52,10 +52,22 @@ clean_builddir() { #
|
||||||
if [ ! -d $JHALFSDIR ] || [ ! -d $BUILDDIR/sources ] ; then
|
if [ ! -d $JHALFSDIR ] || [ ! -d $BUILDDIR/sources ] ; then
|
||||||
echo "Looks like $BUILDDIR was not populated by a previous jhalfs run."
|
echo "Looks like $BUILDDIR was not populated by a previous jhalfs run."
|
||||||
exit 1
|
exit 1
|
||||||
|
# Test that dev filesystems are not mounted in $BUILDDIR
|
||||||
|
elif mount | grep $BUILDDIR/dev > /dev/null ; then
|
||||||
|
echo "Looks like kernel fylesystems are yet mounted on $BUILDDIR."
|
||||||
|
exit 1
|
||||||
else
|
else
|
||||||
# Clean the build directory
|
# Clean the build directory
|
||||||
echo -n "Cleaning $BUILDDIR ..."
|
echo -n "Cleaning $BUILDDIR ..."
|
||||||
sudo rm -rf $BUILDDIR/{bin,boot,etc,home,lib,media,mnt,opt,root,sbin,srv,tmp,tools,cross-tools,usr,var}
|
# First delete proc and sys directories, if exit.
|
||||||
|
# Both should be empty, if not be sure to exit.
|
||||||
|
if [ -d $BUILDDIR/proc ] ; then
|
||||||
|
sudo rmdir $BUILDDIR/proc || exit 1
|
||||||
|
fi
|
||||||
|
if [ -d $BUILDDIR/sys ] ; then
|
||||||
|
sudo rmdir $BUILDDIR/sys || exit 1
|
||||||
|
fi
|
||||||
|
sudo rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,root,sbin,srv,tmp,tools,cross-tools,usr,var}
|
||||||
echo "done"
|
echo "done"
|
||||||
echo -n "Cleaning $JHALFSDIR ..."
|
echo -n "Cleaning $JHALFSDIR ..."
|
||||||
sudo rm -rf $JHALFSDIR
|
sudo rm -rf $JHALFSDIR
|
||||||
|
|
Reference in a new issue