diff --git a/CH6Build/CH06.01-m4.sh b/CH6Build/CH06.01-m4.sh index b94acc4..f273438 100644 --- a/CH6Build/CH06.01-m4.sh +++ b/CH6Build/CH06.01-m4.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then myfail "Failed installing m4" fi +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf m4-${m4_version} + +popd diff --git a/CH6Build/CH06.02-ncurses.sh b/CH6Build/CH06.02-ncurses.sh index a879181..fa780b4 100644 --- a/CH6Build/CH06.02-ncurses.sh +++ b/CH6Build/CH06.02-ncurses.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -54,4 +54,12 @@ ln -sv libncursesw.so ${LFS}/usr/lib/libncurses.so sed -e 's/^#if.*XOPEN.*$/#if 1/' \ -i ${LFS}/usr/include/curses.h +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf ncurses-${ncurses_version} + +popd diff --git a/CH6Build/CH06.03-bash.sh b/CH6Build/CH06.03-bash.sh index a6e40a9..2973879 100644 --- a/CH6Build/CH06.03-bash.sh +++ b/CH6Build/CH06.03-bash.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -36,4 +36,12 @@ fi ln -s bash ${LFS}/bin/sh +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf bash-${bash_version} + +popd diff --git a/CH6Build/CH06.04-coreutils.sh b/CH6Build/CH06.04-coreutils.sh index 9f9e934..f52c0ac 100644 --- a/CH6Build/CH06.04-coreutils.sh +++ b/CH6Build/CH06.04-coreutils.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -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 sed -i 's/"1"/"8"/' ${LFS}/usr/share/man/man8/chroot.8 +popd +# cleanup +pushd ${GLSOURCES} + +rm -rf coreutils-${coreutils_version} + +popd diff --git a/CH6Build/CH06.05-diffutils.sh b/CH6Build/CH06.05-diffutils.sh index b85fc70..29b51e0 100644 --- a/CH6Build/CH06.05-diffutils.sh +++ b/CH6Build/CH06.05-diffutils.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then myfail "Failed installing diffutils" fi +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf diffutils-${diffutils_version} + +popd diff --git a/CH6Build/CH06.06-file.sh b/CH6Build/CH06.06-file.sh index 9e5acbb..904bbfa 100644 --- a/CH6Build/CH06.06-file.sh +++ b/CH6Build/CH06.06-file.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -45,8 +45,17 @@ fi make DESTDIR=${LFS} install if [ $? -ne 0 ]; then - myfail "Failed installing libstdc++" + myfail "Failed installing file" fi rm -f ${LFS}/usr/lib/libmagic.la +popd + +# cleanup + +pushd ${GLSOURCES} + +rm -rf file-${file_version} + +popd diff --git a/CH6Build/CH06.07-findutils.sh b/CH6Build/CH06.07-findutils.sh index 682e428..14e3818 100644 --- a/CH6Build/CH06.07-findutils.sh +++ b/CH6Build/CH06.07-findutils.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -33,4 +33,12 @@ if [ $? -ne 0 ]; then myfail "Failed installing findutils" fi +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf findutils-${findutils_version} + +popd diff --git a/CH6Build/CH06.08-gawk.sh b/CH6Build/CH06.08-gawk.sh index e4d30d7..a509316 100644 --- a/CH6Build/CH06.08-gawk.sh +++ b/CH6Build/CH06.08-gawk.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -34,4 +34,12 @@ if [ $? -ne 0 ]; then myfail "Failed installing gawk" fi +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf gawk-${gawk_version} + +popd diff --git a/CH6Build/CH06.09-grep.sh b/CH6Build/CH06.09-grep.sh index 9fd5c80..4ce5c97 100644 --- a/CH6Build/CH06.09-grep.sh +++ b/CH6Build/CH06.09-grep.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then myfail "Failed installing grep" fi +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf grep-${grep_version} + +popd diff --git a/CH6Build/CH06.10-gzip.sh b/CH6Build/CH06.10-gzip.sh index 3d737ba..7c2c090 100644 --- a/CH6Build/CH06.10-gzip.sh +++ b/CH6Build/CH06.10-gzip.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -31,4 +31,12 @@ if [ $? -ne 0 ]; then myfail "Failed installing gzip" fi +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf gzip-${gzip_version} + +popd diff --git a/CH6Build/CH06.11-make.sh b/CH6Build/CH06.11-make.sh index ab3ef4b..68273fd 100644 --- a/CH6Build/CH06.11-make.sh +++ b/CH6Build/CH06.11-make.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -33,4 +33,12 @@ if [ $? -ne 0 ]; then myfail "Failed installing make" fi +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf make-${make_version} + +popd diff --git a/CH6Build/CH06.12-patch.sh b/CH6Build/CH06.12-patch.sh index c5e17c5..e538231 100644 --- a/CH6Build/CH06.12-patch.sh +++ b/CH6Build/CH06.12-patch.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then myfail "Failed installing patch" fi +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf patch-${patch_version} + +popd diff --git a/CH6Build/CH06.13-sed.sh b/CH6Build/CH06.13-sed.sh index 39f096a..2bd3449 100644 --- a/CH6Build/CH06.13-sed.sh +++ b/CH6Build/CH06.13-sed.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then myfail "Failed installing sed" fi +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf sed-${sed_version} + +popd diff --git a/CH6Build/CH06.14-tar.sh b/CH6Build/CH06.14-tar.sh index 8580876..c0bd37f 100644 --- a/CH6Build/CH06.14-tar.sh +++ b/CH6Build/CH06.14-tar.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -32,4 +32,12 @@ if [ $? -ne 0 ]; then myfail "Failed installing tar" fi +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf tar-${tar_version} + +popd diff --git a/CH6Build/CH06.15-xz.sh b/CH6Build/CH06.15-xz.sh index 82fc7c7..8a534db 100644 --- a/CH6Build/CH06.15-xz.sh +++ b/CH6Build/CH06.15-xz.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -36,4 +36,12 @@ fi rm -v ${LFS}/usr/lib/liblzma.la +popd +# cleanup + +pushd ${GLSOURCES} + +rm -rf xz-${xz_version} + +popd diff --git a/CH6Build/CH06.16-binutils-pass2.sh b/CH6Build/CH06.16-binutils-pass2.sh index 82abbea..1da63bc 100644 --- a/CH6Build/CH06.16-binutils-pass2.sh +++ b/CH6Build/CH06.16-binutils-pass2.sh @@ -8,7 +8,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -43,7 +43,14 @@ if [ $? -ne 0 ]; then myfail "Failed installing binutils" 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 diff --git a/CH6Build/CH06.17-gcc-pass2.sh b/CH6Build/CH06.17-gcc-pass2.sh index a512a47..727f3ae 100644 --- a/CH6Build/CH06.17-gcc-pass2.sh +++ b/CH6Build/CH06.17-gcc-pass2.sh @@ -10,7 +10,7 @@ if [ "`whoami`" != "lfs" ]; then myfail "Must run this script as lfs user" 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} @@ -44,7 +44,7 @@ mkdir build && cd build --build=$(../config.guess) \ --host=${LFS_TGT} \ --target=${LFS_TGT} \ - LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc \ + LDFLAGS_FOR_TARGET=-L${PWD}/${LFS_TGT}/libgcc \ --prefix=/usr \ --with-build-sysroot=${LFS} \ --enable-default-pie \ @@ -72,4 +72,14 @@ if [ $? -ne 0 ]; then myfail "Failed installing gcc pass2" 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 diff --git a/CH6Build/Master.sh b/CH6Build/Master.sh index 48f2e88..bedb3af 100644 --- a/CH6Build/Master.sh +++ b/CH6Build/Master.sh @@ -8,7 +8,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.01-m4.sh" exit 1 else - echo "LFS Chapter 6 M4 Complete" + echo "LFS Chapter 6 M4 Complete [1/17]" sleep 3 fi @@ -18,7 +18,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.02-ncurses.sh" exit 1 else - echo "LFS Chapter 6 Ncurses Complete" + echo "LFS Chapter 6 Ncurses Complete [2/17]" sleep 3 fi @@ -28,7 +28,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.03-bash.sh" exit 1 else - echo "LFS Chapter 6 Bash Complete" + echo "LFS Chapter 6 Bash Complete [3/17]" sleep 3 fi @@ -38,7 +38,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.04-coreutils.sh" exit 1 else - echo "LFS Chapter 6 Coreutils Complete" + echo "LFS Chapter 6 Coreutils Complete [4/17]" sleep 3 fi @@ -48,7 +48,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.05-diffutils.sh" exit 1 else - echo "LFS Chapter 6 Diffutils Complete" + echo "LFS Chapter 6 Diffutils Complete [5/17]" sleep 3 fi @@ -58,7 +58,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.06-file.sh" exit 1 else - echo "LFS Chapter 6 File Complete" + echo "LFS Chapter 6 File Complete [6/17]" sleep 3 fi @@ -68,7 +68,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.07-findutils.sh" exit 1 else - echo "LFS Chapter 6 Findutils Complete" + echo "LFS Chapter 6 Findutils Complete [7/17]" sleep 3 fi @@ -78,7 +78,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.08-gawk.sh" exit 1 else - echo "LFS Chapter 6 Gawk Complete" + echo "LFS Chapter 6 Gawk Complete [8/17]" sleep 3 fi @@ -88,7 +88,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.09-grep.sh" exit 1 else - echo "LFS Chapter 6 Grep Complete" + echo "LFS Chapter 6 Grep Complete [9/17]" sleep 3 fi @@ -98,7 +98,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.10-gzip.sh" exit 1 else - echo "LFS Chapter 6 Gzip Complete" + echo "LFS Chapter 6 Gzip Complete [10/17]" sleep 3 fi @@ -108,7 +108,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.11-make.sh" exit 1 else - echo "LFS Chapter 6 Make Complete" + echo "LFS Chapter 6 Make Complete [11/17]" sleep 3 fi @@ -118,7 +118,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.12-patch.sh" exit 1 else - echo "LFS Chapter 6 Patch Complete" + echo "LFS Chapter 6 Patch Complete [12/17]" sleep 3 fi @@ -128,7 +128,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.13-sed.sh" exit 1 else - echo "LFS Chapter 6 Sed Complete" + echo "LFS Chapter 6 Sed Complete [13/17]" sleep 3 fi @@ -138,7 +138,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.14-tar.sh" exit 1 else - echo "LFS Chapter 6 Tar Complete" + echo "LFS Chapter 6 Tar Complete [14/17]" sleep 3 fi @@ -148,7 +148,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.15-xz.sh" exit 1 else - echo "LFS Chapter 6 Xz Complete" + echo "LFS Chapter 6 Xz Complete [15/17]" sleep 3 fi @@ -158,7 +158,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.16-binutils-pass2.sh" exit 1 else - echo "LFS Chapter 6 Binutils Pass 2 Complete" + echo "LFS Chapter 6 Binutils Pass 2 Complete [16/17]" sleep 3 fi @@ -168,7 +168,7 @@ if [ $? -ne 0 ]; then echo "failed CH06.17-gcc-pass2.sh" exit 1 else - echo "LFS Chapter 6 GCC Pass 2 Complete" + echo "LFS Chapter 6 GCC Pass 2 Complete [17/17]" sleep 120 fi