From 9d68d5da4115353816ab4f6b1c7a4f5db43576f9 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Mon, 22 Mar 2021 19:48:11 -0500 Subject: Prepare chapter 7 build scripts. --- chapter7/bison.sh | 3 +++ chapter7/gettext.sh | 5 +++++ chapter7/libstdc++.sh | 12 ++++++++++++ chapter7/perl.sh | 11 +++++++++++ chapter7/python.sh | 5 +++++ chapter7/texinfo.sh | 3 +++ chapter7/util-linux.sh | 15 +++++++++++++++ 7 files changed, 54 insertions(+) create mode 100644 chapter7/bison.sh create mode 100644 chapter7/gettext.sh create mode 100644 chapter7/libstdc++.sh create mode 100644 chapter7/perl.sh create mode 100644 chapter7/python.sh create mode 100644 chapter7/texinfo.sh create mode 100644 chapter7/util-linux.sh (limited to 'chapter7') diff --git a/chapter7/bison.sh b/chapter7/bison.sh new file mode 100644 index 0000000..a2344a6 --- /dev/null +++ b/chapter7/bison.sh @@ -0,0 +1,3 @@ +./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.7.5 && +make && +make -j1 install diff --git a/chapter7/gettext.sh b/chapter7/gettext.sh new file mode 100644 index 0000000..85bc7f4 --- /dev/null +++ b/chapter7/gettext.sh @@ -0,0 +1,5 @@ +./configure --disable-shared +make && +cp -v gettext-tools/src/msgfmt /usr/bin +cp -v gettext-tools/src/msgmerge /usr/bin +cp -v gettext-tools/src/xgettext /usr/bin diff --git a/chapter7/libstdc++.sh b/chapter7/libstdc++.sh new file mode 100644 index 0000000..5e81693 --- /dev/null +++ b/chapter7/libstdc++.sh @@ -0,0 +1,12 @@ +ln -s gthr-posix.h libgcc/gthr-default.h +mkdir build +cd build +../libstdc++-v3/configure \ + CXXFLAGS="-g -O2 -D_GNU_SOURCE" \ + --prefix=/usr \ + --disable-multilib \ + --disable-nls \ + --host=$(uname -m)-lfs-linux-gnu \ + --disable-libstdcxx-pch && +make && +make -j1 install diff --git a/chapter7/perl.sh b/chapter7/perl.sh new file mode 100644 index 0000000..2cb5245 --- /dev/null +++ b/chapter7/perl.sh @@ -0,0 +1,11 @@ +sh Configure -des \ + -Dprefix=/usr \ + -Dvendorprefix=/usr \ + -Dprivlib=/usr/lib/perl5/5.32/core_perl \ + -Darchlib=/usr/lib/perl5/5.32/core_perl \ + -Dsitelib=/usr/lib/perl5/5.32/site_perl \ + -Dsitearch=/usr/lib/perl5/5.32/site_perl \ + -Dvendorlib=/usr/lib/perl5/5.32/vendor_perl \ + -Dvendorarch=/usr/lib/perl5/5.32/vendor_perl && +make && +make -j1 install diff --git a/chapter7/python.sh b/chapter7/python.sh new file mode 100644 index 0000000..7d158b1 --- /dev/null +++ b/chapter7/python.sh @@ -0,0 +1,5 @@ +./configure --prefix=/usr \ + --enable-shared \ + --without-ensurepip && +make && +make -j1 install diff --git a/chapter7/texinfo.sh b/chapter7/texinfo.sh new file mode 100644 index 0000000..7f133fe --- /dev/null +++ b/chapter7/texinfo.sh @@ -0,0 +1,3 @@ +./configure --prefix=/usr && +make && +make -j1 install diff --git a/chapter7/util-linux.sh b/chapter7/util-linux.sh new file mode 100644 index 0000000..170e3f5 --- /dev/null +++ b/chapter7/util-linux.sh @@ -0,0 +1,15 @@ +mkdir -p /var/lib/hwclock && +./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ + --docdir=/usr/share/doc/util-linux-2.36.2 \ + --disable-chfn-chsh \ + --disable-login \ + --disable-nologin \ + --disable-su \ + --disable-setpriv \ + --disable-runuser \ + --disable-pylibmount \ + --disable-static \ + --without-python \ + runstatedir=/run && +make && +make -j1 install -- cgit v1.2.3-54-g00ecf From 483f5b37f796bf217572768f241081ffc9a19cd8 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Wed, 24 Mar 2021 09:49:07 -0500 Subject: Adjust from chapter6 back for chapter7 backup. Add additional directories. --- chapter7/backup.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 chapter7/backup.sh (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh new file mode 100644 index 0000000..a32aeb4 --- /dev/null +++ b/chapter7/backup.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +FILE="${LFS_VER}-ch7-backup.tar.xz" +DIRS=(bin dev etc lib lib64 proc run sbin sources sys tools usr var) + +if [ -f "${LFS}/sources/chapter7/backup" ]; then + echo -e "${GRN}Backup found. Remove manually to backup again.${RST}" +else + + echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${FILE}${RST}... " + pushd "${LFS}" > /dev/null || exit 1 + sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${FILE}" "${DIRS[@]}" & pid=$! + spinner "$pid" + retval=$? + if [ "$retval" -ne 0 ]; then + echo -e "${RED}Backup FAILED!${RST}" + else + sudo chown "${USER}" /home/"${USER}"/"${FILE}" + echo -e "${GRN}OK${RST}" + fi + popd > /dev/null || exit 1 + + touch "${LFS}/sources/chapter7/backup" +fi + -- cgit v1.2.3-54-g00ecf From 3c627ee8dd4f714b402b19eb577313951147a91d Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Wed, 24 Mar 2021 11:07:41 -0500 Subject: Adjust backup script for chapter 7 --- chapter7/backup.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh index a32aeb4..71ad3a0 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -4,7 +4,7 @@ FILE="${LFS_VER}-ch7-backup.tar.xz" DIRS=(bin dev etc lib lib64 proc run sbin sources sys tools usr var) if [ -f "${LFS}/sources/chapter7/backup" ]; then - echo -e "${GRN}Backup found. Remove manually to backup again.${RST}" + echo -e "${YLW}Chapter 7 ${GRN}Backup found. Remove manually to backup again.${RST}" else echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${FILE}${RST}... " @@ -15,7 +15,6 @@ else if [ "$retval" -ne 0 ]; then echo -e "${RED}Backup FAILED!${RST}" else - sudo chown "${USER}" /home/"${USER}"/"${FILE}" echo -e "${GRN}OK${RST}" fi popd > /dev/null || exit 1 -- cgit v1.2.3-54-g00ecf From 48c0449eca92fdfb2ebb980fef779642effc28cd Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Wed, 24 Mar 2021 11:08:02 -0500 Subject: Add clean up script for chapter 7 --- chapter7/cleanup.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 chapter7/cleanup.sh (limited to 'chapter7') diff --git a/chapter7/cleanup.sh b/chapter7/cleanup.sh new file mode 100644 index 0000000..b300e7e --- /dev/null +++ b/chapter7/cleanup.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ -f "${LFS}/sources/chapter7/cleanup" ]; then + echo -e "${YLW}Chapter 7 ${GRN}cleanup already performed.${RST}" +else + + echo -ne "${GRN}Cleaning up ${YLW}${LFS}${RST}... " + + sudo find "${LFS}"/usr/lib -name \*.la -delete >/dev/null 2>&1 + sudo find "${LFS}"/usr/libexec -name \*.la -delete >/dev/null 2>&1 + + sudo rm -rf "${LFS}"/usr/share/doc >/dev/null 2>&1 + sudo rm -rf "${LFS}"/usr/share/info >/dev/null 2>&1 + sudo rm -rf "${LFS}"/usr/share/man >/dev/null 2>&1 + + sudo strip --strip-debug "${LFS}"/usr/lib/* >/dev/null 2>&1 + sudo strip --strip-unneeded "${LFS}"/usr/bin/* >/dev/null 2>&1 + sudo strip --strip-unneeded "${LFS}"/usr/sbin/* >/dev/null 2>&1 + sudo strip --strip-unneeded "${LFS}"/tools/bin/* >/dev/null 2>&1 + + echo -e "${GRN}OK${RST}" + touch "${LFS}"/sources/chapter7/cleanup >/dev/null 2>&1 +fi -- cgit v1.2.3-54-g00ecf From 26ea60dac803ce9526f7f73dbd2866b06680d5d7 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Thu, 25 Mar 2021 11:17:41 -0500 Subject: Change case of FILE to lower case file and rename DIRS to directories. --- chapter7/backup.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh index 71ad3a0..8cba32d 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -1,15 +1,15 @@ #!/bin/bash -FILE="${LFS_VER}-ch7-backup.tar.xz" -DIRS=(bin dev etc lib lib64 proc run sbin sources sys tools usr var) +file="${LFS_VER}-ch7-backup.tar.xz" +directories=(bin dev etc lib lib64 proc run sbin sources sys tools usr var) if [ -f "${LFS}/sources/chapter7/backup" ]; then echo -e "${YLW}Chapter 7 ${GRN}Backup found. Remove manually to backup again.${RST}" else - echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${FILE}${RST}... " + echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${file}${RST}... " pushd "${LFS}" > /dev/null || exit 1 - sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${FILE}" "${DIRS[@]}" & pid=$! + sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${file}" "${directories[@]}" & pid=$! spinner "$pid" retval=$? if [ "$retval" -ne 0 ]; then @@ -22,3 +22,4 @@ else touch "${LFS}/sources/chapter7/backup" fi +unset file directories -- cgit v1.2.3-54-g00ecf From 105789821259880e1eb035d9506eac3cab82e624 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Fri, 26 Mar 2021 17:17:43 -0500 Subject: Direct all tar output to /dev/null and return FAILED and exit upon failure. --- chapter7/backup.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh index 8cba32d..2e980c5 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -9,11 +9,12 @@ else echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${file}${RST}... " pushd "${LFS}" > /dev/null || exit 1 - sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${file}" "${directories[@]}" & pid=$! + sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${file}" "${directories[@]}" >/dev/null 2>&1 & pid=$! spinner "$pid" retval=$? - if [ "$retval" -ne 0 ]; then - echo -e "${RED}Backup FAILED!${RST}" + if [ "${retval}" -ne 0 ]; then + echo -e "${RED}FAILED!${RST}" + exit "${retval}" else echo -e "${GRN}OK${RST}" fi @@ -21,5 +22,3 @@ else touch "${LFS}/sources/chapter7/backup" fi - -unset file directories -- cgit v1.2.3-54-g00ecf From 1e4bef0e5d4447acc7f1ed9d7ae84d388c0c78a7 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Tue, 30 Mar 2021 12:58:51 -0500 Subject: User VERSION variable for the versioned doc directory. --- chapter7/util-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chapter7') diff --git a/chapter7/util-linux.sh b/chapter7/util-linux.sh index 170e3f5..e70fbfa 100644 --- a/chapter7/util-linux.sh +++ b/chapter7/util-linux.sh @@ -1,6 +1,6 @@ mkdir -p /var/lib/hwclock && ./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ - --docdir=/usr/share/doc/util-linux-2.36.2 \ + --docdir=/usr/share/doc/util-linux-"${VERSION}" \ --disable-chfn-chsh \ --disable-login \ --disable-nologin \ -- cgit v1.2.3-54-g00ecf From 57671253b64d9144d7f39137d654edb7555df62c Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Tue, 30 Mar 2021 12:59:05 -0500 Subject: User VERSION variable for the versioned doc directory. --- chapter7/bison.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chapter7') diff --git a/chapter7/bison.sh b/chapter7/bison.sh index a2344a6..3112d1f 100644 --- a/chapter7/bison.sh +++ b/chapter7/bison.sh @@ -1,3 +1,3 @@ -./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.7.5 && +./configure --prefix=/usr --docdir=/usr/share/doc/bison-"${VERSION}" && make && make -j1 install -- cgit v1.2.3-54-g00ecf From 661a2ab5a84b70f3075777599b27e19f06b49e8a Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Tue, 30 Mar 2021 12:59:40 -0500 Subject: Create a variable with only the major minor of the perl version and use it in the configure options. --- chapter7/perl.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'chapter7') diff --git a/chapter7/perl.sh b/chapter7/perl.sh index 2cb5245..970e17c 100644 --- a/chapter7/perl.sh +++ b/chapter7/perl.sh @@ -1,11 +1,15 @@ +#!/bin/bash + +MAJMIN="$(cut -d\. -f1,2 <<< "${VERSION}")" + sh Configure -des \ -Dprefix=/usr \ -Dvendorprefix=/usr \ - -Dprivlib=/usr/lib/perl5/5.32/core_perl \ - -Darchlib=/usr/lib/perl5/5.32/core_perl \ - -Dsitelib=/usr/lib/perl5/5.32/site_perl \ - -Dsitearch=/usr/lib/perl5/5.32/site_perl \ - -Dvendorlib=/usr/lib/perl5/5.32/vendor_perl \ - -Dvendorarch=/usr/lib/perl5/5.32/vendor_perl && + -Dprivlib=/usr/lib/perl5/"${MAJMIN}"/core_perl \ + -Darchlib=/usr/lib/perl5/"${MAJMIN}"/core_perl \ + -Dsitelib=/usr/lib/perl5/"${MAJMIN}"/site_perl \ + -Dsitearch=/usr/lib/perl5/"${MAJMIN}"/site_perl \ + -Dvendorlib=/usr/lib/perl5/"${MAJMIN}"/vendor_perl \ + -Dvendorarch=/usr/lib/perl5/"${MAJMIN}"/vendor_perl && make && make -j1 install -- cgit v1.2.3-54-g00ecf From dc161b4d4f5c37c2e72a953e639641b112fb68a0 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Tue, 30 Mar 2021 13:03:52 -0500 Subject: Add shebangs and cleanup libstdc++.sh --- chapter7/bison.sh | 2 ++ chapter7/gettext.sh | 2 ++ chapter7/libstdc++.sh | 6 ++++-- chapter7/python.sh | 2 ++ chapter7/texinfo.sh | 2 ++ chapter7/util-linux.sh | 2 ++ 6 files changed, 14 insertions(+), 2 deletions(-) (limited to 'chapter7') diff --git a/chapter7/bison.sh b/chapter7/bison.sh index 3112d1f..2385d22 100644 --- a/chapter7/bison.sh +++ b/chapter7/bison.sh @@ -1,3 +1,5 @@ +#!/bin/bash + ./configure --prefix=/usr --docdir=/usr/share/doc/bison-"${VERSION}" && make && make -j1 install diff --git a/chapter7/gettext.sh b/chapter7/gettext.sh index 85bc7f4..49fbf15 100644 --- a/chapter7/gettext.sh +++ b/chapter7/gettext.sh @@ -1,3 +1,5 @@ +#!/bin/bash + ./configure --disable-shared make && cp -v gettext-tools/src/msgfmt /usr/bin diff --git a/chapter7/libstdc++.sh b/chapter7/libstdc++.sh index 5e81693..c2ef63b 100644 --- a/chapter7/libstdc++.sh +++ b/chapter7/libstdc++.sh @@ -1,12 +1,14 @@ +#!/bin/bash + ln -s gthr-posix.h libgcc/gthr-default.h mkdir build -cd build +cd build || exit 1 ../libstdc++-v3/configure \ CXXFLAGS="-g -O2 -D_GNU_SOURCE" \ --prefix=/usr \ --disable-multilib \ --disable-nls \ - --host=$(uname -m)-lfs-linux-gnu \ + --host="$(uname -m)"-lfs-linux-gnu \ --disable-libstdcxx-pch && make && make -j1 install diff --git a/chapter7/python.sh b/chapter7/python.sh index 7d158b1..daf1677 100644 --- a/chapter7/python.sh +++ b/chapter7/python.sh @@ -1,3 +1,5 @@ +#!/bin/bash + ./configure --prefix=/usr \ --enable-shared \ --without-ensurepip && diff --git a/chapter7/texinfo.sh b/chapter7/texinfo.sh index 7f133fe..1935156 100644 --- a/chapter7/texinfo.sh +++ b/chapter7/texinfo.sh @@ -1,3 +1,5 @@ +#!/bin/bash + ./configure --prefix=/usr && make && make -j1 install diff --git a/chapter7/util-linux.sh b/chapter7/util-linux.sh index e70fbfa..7a00c8c 100644 --- a/chapter7/util-linux.sh +++ b/chapter7/util-linux.sh @@ -1,3 +1,5 @@ +#!/bin/bash + mkdir -p /var/lib/hwclock && ./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ --docdir=/usr/share/doc/util-linux-"${VERSION}" \ -- cgit v1.2.3-54-g00ecf From fc856c4c50dbb349732c84319ca53c1af3059b20 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Thu, 1 Apr 2021 15:14:31 -0500 Subject: Remove sources from backup dirs array. --- chapter7/backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh index 2e980c5..d34e383 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -1,7 +1,7 @@ #!/bin/bash file="${LFS_VER}-ch7-backup.tar.xz" -directories=(bin dev etc lib lib64 proc run sbin sources sys tools usr var) +directories=(bin dev etc lib lib64 proc run sbin sys tools usr var) if [ -f "${LFS}/sources/chapter7/backup" ]; then echo -e "${YLW}Chapter 7 ${GRN}Backup found. Remove manually to backup again.${RST}" -- cgit v1.2.3-54-g00ecf From 2b3ad233705d788ef0ea0ba65a6197cb8120e688 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Thu, 1 Apr 2021 16:10:13 -0500 Subject: Pass SPINNER variable to spinner for spinnertype. --- chapter7/backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh index d34e383..4bdb206 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -10,7 +10,7 @@ else echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${file}${RST}... " pushd "${LFS}" > /dev/null || exit 1 sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${file}" "${directories[@]}" >/dev/null 2>&1 & pid=$! - spinner "$pid" + spinner "$pid" "${SPINNER}" retval=$? if [ "${retval}" -ne 0 ]; then echo -e "${RED}FAILED!${RST}" -- cgit v1.2.3-54-g00ecf From 1624434cc39a74b36881aa657f4cea38b9bfba77 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Thu, 1 Apr 2021 16:21:00 -0500 Subject: Use intense colors for already completed message. --- chapter7/cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chapter7') diff --git a/chapter7/cleanup.sh b/chapter7/cleanup.sh index b300e7e..f4a8333 100644 --- a/chapter7/cleanup.sh +++ b/chapter7/cleanup.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ -f "${LFS}/sources/chapter7/cleanup" ]; then - echo -e "${YLW}Chapter 7 ${GRN}cleanup already performed.${RST}" + echo -e " ${IYLW}Chapter 7 ${IGRN}cleanup already performed.${RST}" else echo -ne "${GRN}Cleaning up ${YLW}${LFS}${RST}... " -- cgit v1.2.3-54-g00ecf From 35d43dceb238ecd5a61c3fdc9035844e8146c940 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Thu, 1 Apr 2021 16:34:38 -0500 Subject: Use intense colors for backup found message and indent. Change cleanup and backup message for chapter 7 in lfs.sh. --- chapter7/backup.sh | 2 +- lfs.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh index 4bdb206..8b0944d 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -4,7 +4,7 @@ file="${LFS_VER}-ch7-backup.tar.xz" directories=(bin dev etc lib lib64 proc run sbin sys tools usr var) if [ -f "${LFS}/sources/chapter7/backup" ]; then - echo -e "${YLW}Chapter 7 ${GRN}Backup found. Remove manually to backup again.${RST}" + echo -e " ${IYLW}Chapter 7 ${IGRN}Backup found. Remove manually to backup again.${RST}" else echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${file}${RST}... " diff --git a/lfs.sh b/lfs.sh index aaa27af..64ca920 100755 --- a/lfs.sh +++ b/lfs.sh @@ -118,6 +118,7 @@ for package in m4 ncurses bash coreutils diffutils file findutils gawk grep gzip fi done +printf "%b" "\n${YLW}Chapter 6 ${GRN}cleanup and backup${RST}\n" source chapter6/cleanup.sh source chapter6/backup.sh @@ -153,7 +154,7 @@ if [ "$retval" -eq 7 ]; then sudo umount "${LFS}"/sys sudo umount "${LFS}"/proc - printf "%b" "${GRN}Cleaning and backing up before starting Chapter 8.\n" + printf "%b" "\n${YLW}Chapter 7 ${GRN}cleanup and backup${RST}\n" source "${LFS}"/sources/chapter7/cleanup.sh source "${LFS}"/sources/chapter7/backup.sh else -- cgit v1.2.3-54-g00ecf From d9af1744baa9db3b6c9c7eb9df057b965aa6e3ed Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Thu, 1 Apr 2021 17:17:00 -0500 Subject: Change cleanup and backup already performed messages. --- chapter7/backup.sh | 2 +- chapter7/cleanup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh index 8b0944d..68b9824 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -4,7 +4,7 @@ file="${LFS_VER}-ch7-backup.tar.xz" directories=(bin dev etc lib lib64 proc run sbin sys tools usr var) if [ -f "${LFS}/sources/chapter7/backup" ]; then - echo -e " ${IYLW}Chapter 7 ${IGRN}Backup found. Remove manually to backup again.${RST}" + echo -e " ${IGRN}Backup found. Remove manually to backup again.${RST}" else echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${file}${RST}... " diff --git a/chapter7/cleanup.sh b/chapter7/cleanup.sh index f4a8333..95e1449 100644 --- a/chapter7/cleanup.sh +++ b/chapter7/cleanup.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ -f "${LFS}/sources/chapter7/cleanup" ]; then - echo -e " ${IYLW}Chapter 7 ${IGRN}cleanup already performed.${RST}" + echo -e " ${IGRN}Cleanup already performed.${RST}" else echo -ne "${GRN}Cleaning up ${YLW}${LFS}${RST}... " -- cgit v1.2.3-54-g00ecf From eb35696e9b37f041ee4ddc606910abc5218fc9b4 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Fri, 2 Apr 2021 12:32:29 -0500 Subject: Format FAIL and OK messages with intense color. Reset colors before new line. Try to keep a sane style in the scripts. --- chapter7/backup.sh | 4 ++-- chapter7/cleanup.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh index 68b9824..2aac08e 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -13,10 +13,10 @@ else spinner "$pid" "${SPINNER}" retval=$? if [ "${retval}" -ne 0 ]; then - echo -e "${RED}FAILED!${RST}" + echo -e "${IRED}FAILED!${RST}\n" exit "${retval}" else - echo -e "${GRN}OK${RST}" + echo -e "${IGRN}OK${RST}\n" fi popd > /dev/null || exit 1 diff --git a/chapter7/cleanup.sh b/chapter7/cleanup.sh index 95e1449..60a934f 100644 --- a/chapter7/cleanup.sh +++ b/chapter7/cleanup.sh @@ -18,6 +18,6 @@ else sudo strip --strip-unneeded "${LFS}"/usr/sbin/* >/dev/null 2>&1 sudo strip --strip-unneeded "${LFS}"/tools/bin/* >/dev/null 2>&1 - echo -e "${GRN}OK${RST}" + echo -e "${IGRN}OK${RST}\n" touch "${LFS}"/sources/chapter7/cleanup >/dev/null 2>&1 fi -- cgit v1.2.3-54-g00ecf From d15a78517dfa18948aaf9ae91b19cdc2de5df998 Mon Sep 17 00:00:00 2001 From: William Harrington <kb0iic@berzerkula.org> Date: Fri, 2 Apr 2021 13:36:51 -0500 Subject: Cleanup information messages for chapater 7 backup and cleanup and change from echo to printf. --- chapter7/backup.sh | 8 ++++---- chapter7/cleanup.sh | 6 +++--- lfs.sh | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh index 2aac08e..a6abb86 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -4,19 +4,19 @@ file="${LFS_VER}-ch7-backup.tar.xz" directories=(bin dev etc lib lib64 proc run sbin sys tools usr var) if [ -f "${LFS}/sources/chapter7/backup" ]; then - echo -e " ${IGRN}Backup found. Remove manually to backup again.${RST}" + printf "%b" " ${IGRN}Backup previously completed${RST}\n" else - echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${file}${RST}... " + printf "%b" "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${file}${RST}... " pushd "${LFS}" > /dev/null || exit 1 sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${file}" "${directories[@]}" >/dev/null 2>&1 & pid=$! spinner "$pid" "${SPINNER}" retval=$? if [ "${retval}" -ne 0 ]; then - echo -e "${IRED}FAILED!${RST}\n" + printf "%b" "${IRED}FAILED!${RST}\n" exit "${retval}" else - echo -e "${IGRN}OK${RST}\n" + printf "%b" "${IGRN}OK${RST}\n" fi popd > /dev/null || exit 1 diff --git a/chapter7/cleanup.sh b/chapter7/cleanup.sh index 60a934f..0a5ec86 100644 --- a/chapter7/cleanup.sh +++ b/chapter7/cleanup.sh @@ -1,10 +1,10 @@ #!/bin/bash if [ -f "${LFS}/sources/chapter7/cleanup" ]; then - echo -e " ${IGRN}Cleanup already performed.${RST}" + printf "%b" " ${IGRN}Cleanup already performed${RST}\n" else - echo -ne "${GRN}Cleaning up ${YLW}${LFS}${RST}... " + printf "%b" "${GRN}Cleaning up ${YLW}${LFS}${RST}... " sudo find "${LFS}"/usr/lib -name \*.la -delete >/dev/null 2>&1 sudo find "${LFS}"/usr/libexec -name \*.la -delete >/dev/null 2>&1 @@ -18,6 +18,6 @@ else sudo strip --strip-unneeded "${LFS}"/usr/sbin/* >/dev/null 2>&1 sudo strip --strip-unneeded "${LFS}"/tools/bin/* >/dev/null 2>&1 - echo -e "${IGRN}OK${RST}\n" + printf "%b" "${IGRN}OK${RST}\n" touch "${LFS}"/sources/chapter7/cleanup >/dev/null 2>&1 fi diff --git a/lfs.sh b/lfs.sh index bdd8659..55bdfb6 100755 --- a/lfs.sh +++ b/lfs.sh @@ -169,7 +169,8 @@ if [[ "$retval" -eq 7 ]]; then sudo umount "${LFS}"/sys sudo umount "${LFS}"/proc - printf "%b" "\n${YLW}Chapter 7 ${GRN}cleanup and backup${RST}\n" + printf "%b" "\n${IWHT}======= ${IYLW}Chapter 7 ${IGRN}Cleanup and Backup \ +${IWHT}=======${RST}\n" source "${LFS}"/sources/chapter7/cleanup.sh source "${LFS}"/sources/chapter7/backup.sh else -- cgit v1.2.3-54-g00ecf