clean up directories after build

This commit is contained in:
YellowJacketLinux 2024-10-08 00:33:13 -07:00
parent aac32fba12
commit c5b37860e6
18 changed files with 175 additions and 38 deletions

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d m4-${m4_version} ] && rm -rf m4-${m4_version} [ -d m4-${m4_version} ] && rm -rf m4-${m4_version}
@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then
myfail "Failed installing m4" myfail "Failed installing m4"
fi fi
popd
# cleanup
pushd ${GLSOURCES}
rm -rf m4-${m4_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d ncurses-${ncurses_version} ] && rm -rf ncurses-${ncurses_version} [ -d ncurses-${ncurses_version} ] && rm -rf ncurses-${ncurses_version}
@ -54,4 +54,12 @@ ln -sv libncursesw.so ${LFS}/usr/lib/libncurses.so
sed -e 's/^#if.*XOPEN.*$/#if 1/' \ sed -e 's/^#if.*XOPEN.*$/#if 1/' \
-i ${LFS}/usr/include/curses.h -i ${LFS}/usr/include/curses.h
popd
# cleanup
pushd ${GLSOURCES}
rm -rf ncurses-${ncurses_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d bash-${bash_version} ] && rm -rf bash-${bash_version} [ -d bash-${bash_version} ] && rm -rf bash-${bash_version}
@ -36,4 +36,12 @@ fi
ln -s bash ${LFS}/bin/sh ln -s bash ${LFS}/bin/sh
popd
# cleanup
pushd ${GLSOURCES}
rm -rf bash-${bash_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d coreutils-${coreutils_version} ] && rm -rf coreutils-${coreutils_version} [ -d coreutils-${coreutils_version} ] && rm -rf coreutils-${coreutils_version}
@ -39,5 +39,12 @@ mkdir -p ${LFS}/usr/share/man/man8
mv ${LFS}/usr/share/man/man1/chroot.1 ${LFS}/usr/share/man/man8/chroot.8 mv ${LFS}/usr/share/man/man1/chroot.1 ${LFS}/usr/share/man/man8/chroot.8
sed -i 's/"1"/"8"/' ${LFS}/usr/share/man/man8/chroot.8 sed -i 's/"1"/"8"/' ${LFS}/usr/share/man/man8/chroot.8
popd
# cleanup
pushd ${GLSOURCES}
rm -rf coreutils-${coreutils_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d diffutils-${diffutils_version} ] && rm -rf diffutils-${diffutils_version} [ -d diffutils-${diffutils_version} ] && rm -rf diffutils-${diffutils_version}
@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then
myfail "Failed installing diffutils" myfail "Failed installing diffutils"
fi fi
popd
# cleanup
pushd ${GLSOURCES}
rm -rf diffutils-${diffutils_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d file-${file_version} ] && rm -rf file-${file_version} [ -d file-${file_version} ] && rm -rf file-${file_version}
@ -45,8 +45,17 @@ fi
make DESTDIR=${LFS} install make DESTDIR=${LFS} install
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
myfail "Failed installing libstdc++" myfail "Failed installing file"
fi fi
rm -f ${LFS}/usr/lib/libmagic.la rm -f ${LFS}/usr/lib/libmagic.la
popd
# cleanup
pushd ${GLSOURCES}
rm -rf file-${file_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d findutils-${findutils_version} ] && rm -rf findutils-${findutils_version} [ -d findutils-${findutils_version} ] && rm -rf findutils-${findutils_version}
@ -33,4 +33,12 @@ if [ $? -ne 0 ]; then
myfail "Failed installing findutils" myfail "Failed installing findutils"
fi fi
popd
# cleanup
pushd ${GLSOURCES}
rm -rf findutils-${findutils_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d gawk-${gawk_version} ] && rm -rf gawk-${gawk_version} [ -d gawk-${gawk_version} ] && rm -rf gawk-${gawk_version}
@ -34,4 +34,12 @@ if [ $? -ne 0 ]; then
myfail "Failed installing gawk" myfail "Failed installing gawk"
fi fi
popd
# cleanup
pushd ${GLSOURCES}
rm -rf gawk-${gawk_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d grep-${grep_version} ] && rm -rf grep-${grep_version} [ -d grep-${grep_version} ] && rm -rf grep-${grep_version}
@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then
myfail "Failed installing grep" myfail "Failed installing grep"
fi fi
popd
# cleanup
pushd ${GLSOURCES}
rm -rf grep-${grep_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d gzip-${gzip_version} ] && rm -rf gzip-${gzip_version} [ -d gzip-${gzip_version} ] && rm -rf gzip-${gzip_version}
@ -31,4 +31,12 @@ if [ $? -ne 0 ]; then
myfail "Failed installing gzip" myfail "Failed installing gzip"
fi fi
popd
# cleanup
pushd ${GLSOURCES}
rm -rf gzip-${gzip_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d make-${make_version} ] && rm -rf make-${make_version} [ -d make-${make_version} ] && rm -rf make-${make_version}
@ -33,4 +33,12 @@ if [ $? -ne 0 ]; then
myfail "Failed installing make" myfail "Failed installing make"
fi fi
popd
# cleanup
pushd ${GLSOURCES}
rm -rf make-${make_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d patch-${patch_version} ] && rm -rf patch-${patch_version} [ -d patch-${patch_version} ] && rm -rf patch-${patch_version}
@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then
myfail "Failed installing patch" myfail "Failed installing patch"
fi fi
popd
# cleanup
pushd ${GLSOURCES}
rm -rf patch-${patch_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d sed-${sed_version} ] && rm -rf sed-${sed_version} [ -d sed-${sed_version} ] && rm -rf sed-${sed_version}
@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then
myfail "Failed installing sed" myfail "Failed installing sed"
fi fi
popd
# cleanup
pushd ${GLSOURCES}
rm -rf sed-${sed_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d tar-${tar_version} ] && rm -rf tar-${tar_version} [ -d tar-${tar_version} ] && rm -rf tar-${tar_version}
@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then
myfail "Failed installing tar" myfail "Failed installing tar"
fi fi
popd
# cleanup
pushd ${GLSOURCES}
rm -rf tar-${tar_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d xz-${xz_version} ] && rm -rf xz-${xz_version} [ -d xz-${xz_version} ] && rm -rf xz-${xz_version}
@ -36,4 +36,12 @@ fi
rm -v ${LFS}/usr/lib/liblzma.la rm -v ${LFS}/usr/lib/liblzma.la
popd
# cleanup
pushd ${GLSOURCES}
rm -rf xz-${xz_version}
popd

View File

@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d binutils-${binutils_version} ] && rm -rf binutils-${binutils_version} [ -d binutils-${binutils_version} ] && rm -rf binutils-${binutils_version}
@ -43,7 +43,14 @@ if [ $? -ne 0 ]; then
myfail "Failed installing binutils" myfail "Failed installing binutils"
fi fi
rm -v ${LFS}/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes,sframe}.{a,la} rm ${LFS}/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes,sframe}.{a,la}
popd
# cleanup
pushd ${GLSOURCES}
rm -rf binutils-${binutils_version}
popd

View File

@ -10,7 +10,7 @@ if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user" myfail "Must run this script as lfs user"
fi fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}" pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d gcc-${gcc_version} ] && rm -rf gcc-${gcc_version} [ -d gcc-${gcc_version} ] && rm -rf gcc-${gcc_version}
@ -44,7 +44,7 @@ mkdir build && cd build
--build=$(../config.guess) \ --build=$(../config.guess) \
--host=${LFS_TGT} \ --host=${LFS_TGT} \
--target=${LFS_TGT} \ --target=${LFS_TGT} \
LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc \ LDFLAGS_FOR_TARGET=-L${PWD}/${LFS_TGT}/libgcc \
--prefix=/usr \ --prefix=/usr \
--with-build-sysroot=${LFS} \ --with-build-sysroot=${LFS} \
--enable-default-pie \ --enable-default-pie \
@ -72,4 +72,14 @@ if [ $? -ne 0 ]; then
myfail "Failed installing gcc pass2" myfail "Failed installing gcc pass2"
fi fi
ln -sv gcc $LFS/usr/bin/cc ln -sv gcc ${LFS}/usr/bin/cc
popd
# cleanup
pushd ${GLSOURCES}
rm -rf gcc-${gcc_version}
popd

View File

@ -8,7 +8,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.01-m4.sh" echo "failed CH06.01-m4.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 M4 Complete" echo "LFS Chapter 6 M4 Complete [1/17]"
sleep 3 sleep 3
fi fi
@ -18,7 +18,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.02-ncurses.sh" echo "failed CH06.02-ncurses.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Ncurses Complete" echo "LFS Chapter 6 Ncurses Complete [2/17]"
sleep 3 sleep 3
fi fi
@ -28,7 +28,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.03-bash.sh" echo "failed CH06.03-bash.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Bash Complete" echo "LFS Chapter 6 Bash Complete [3/17]"
sleep 3 sleep 3
fi fi
@ -38,7 +38,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.04-coreutils.sh" echo "failed CH06.04-coreutils.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Coreutils Complete" echo "LFS Chapter 6 Coreutils Complete [4/17]"
sleep 3 sleep 3
fi fi
@ -48,7 +48,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.05-diffutils.sh" echo "failed CH06.05-diffutils.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Diffutils Complete" echo "LFS Chapter 6 Diffutils Complete [5/17]"
sleep 3 sleep 3
fi fi
@ -58,7 +58,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.06-file.sh" echo "failed CH06.06-file.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 File Complete" echo "LFS Chapter 6 File Complete [6/17]"
sleep 3 sleep 3
fi fi
@ -68,7 +68,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.07-findutils.sh" echo "failed CH06.07-findutils.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Findutils Complete" echo "LFS Chapter 6 Findutils Complete [7/17]"
sleep 3 sleep 3
fi fi
@ -78,7 +78,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.08-gawk.sh" echo "failed CH06.08-gawk.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Gawk Complete" echo "LFS Chapter 6 Gawk Complete [8/17]"
sleep 3 sleep 3
fi fi
@ -88,7 +88,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.09-grep.sh" echo "failed CH06.09-grep.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Grep Complete" echo "LFS Chapter 6 Grep Complete [9/17]"
sleep 3 sleep 3
fi fi
@ -98,7 +98,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.10-gzip.sh" echo "failed CH06.10-gzip.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Gzip Complete" echo "LFS Chapter 6 Gzip Complete [10/17]"
sleep 3 sleep 3
fi fi
@ -108,7 +108,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.11-make.sh" echo "failed CH06.11-make.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Make Complete" echo "LFS Chapter 6 Make Complete [11/17]"
sleep 3 sleep 3
fi fi
@ -118,7 +118,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.12-patch.sh" echo "failed CH06.12-patch.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Patch Complete" echo "LFS Chapter 6 Patch Complete [12/17]"
sleep 3 sleep 3
fi fi
@ -128,7 +128,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.13-sed.sh" echo "failed CH06.13-sed.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Sed Complete" echo "LFS Chapter 6 Sed Complete [13/17]"
sleep 3 sleep 3
fi fi
@ -138,7 +138,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.14-tar.sh" echo "failed CH06.14-tar.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Tar Complete" echo "LFS Chapter 6 Tar Complete [14/17]"
sleep 3 sleep 3
fi fi
@ -148,7 +148,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.15-xz.sh" echo "failed CH06.15-xz.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Xz Complete" echo "LFS Chapter 6 Xz Complete [15/17]"
sleep 3 sleep 3
fi fi
@ -158,7 +158,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.16-binutils-pass2.sh" echo "failed CH06.16-binutils-pass2.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 Binutils Pass 2 Complete" echo "LFS Chapter 6 Binutils Pass 2 Complete [16/17]"
sleep 3 sleep 3
fi fi
@ -168,7 +168,7 @@ if [ $? -ne 0 ]; then
echo "failed CH06.17-gcc-pass2.sh" echo "failed CH06.17-gcc-pass2.sh"
exit 1 exit 1
else else
echo "LFS Chapter 6 GCC Pass 2 Complete" echo "LFS Chapter 6 GCC Pass 2 Complete [17/17]"
sleep 120 sleep 120
fi fi