From 9d68d5da4115353816ab4f6b1c7a4f5db43576f9 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Mon, 22 Mar 2021 19:48:11 -0500 Subject: Prepare chapter 7 build scripts. --- insidechroot.sh | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 152 insertions(+), 1 deletion(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index 3c262e9..529fb1e 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -1,5 +1,156 @@ #!/bin/bash source /sources/colors.sh +source /sources/spinner.sh -echo -e "${GRN}Successfully entered ${RED}CHROOT${RST}!" +echo -e "${GRN}Successfully entered ${RED}CHROOT${RST}!\n" + +echo -e "${GRN}Creating directories...${RST}" +if [ -f /sources/createdirs ]; then + echo -e "${GRN} Directories already created.${RST}" +else + mkdir -p /boot + mkdir -p /home + mkdir -p /mnt + mkdir -p /opt + mkdir -p /srv + + mkdir -p /etc/opt + mkdir -p /etc/opt/sysconfig + mkdir -p /lib/firmware + mkdir -p /media/floppy + mkdir -p /media/cdrom + mkdir -p /usr/bin + mkdir -p /usr/include + mkdir -p /usr/lib + mkdir -p /usr/sbin + mkdir -p /usr/src + mkdir -p /usr/local/bin + mkdir -p /usr/local/include + mkdir -p /usr/local/lib + mkdir -p /usr/local/sbin + mkdir -p /usr/local/src + mkdir -p /usr/share/color + mkdir -p /usr/share/dict + mkdir -p /usr/share/doc + mkdir -p /usr/share/info + mkdir -p /usr/share/locale + mkdir -p /usr/share/man + mkdir -p /usr/share/man/man1 + mkdir -p /usr/share/man/man2 + mkdir -p /usr/share/man/man3 + mkdir -p /usr/share/man/man4 + mkdir -p /usr/share/man/man5 + mkdir -p /usr/share/man/man6 + mkdir -p /usr/share/man/man7 + mkdir -p /usr/share/man/man8 + mkdir -p /usr/share/misc + mkdir -p /usr/share/terminfo + mkdir -p /usr/share/zoneinfo + mkdir -p /usr/local/share/color + mkdir -p /usr/local/share/dict + mkdir -p /usr/local/share/doc + mkdir -p /usr/local/share/info + mkdir -p /usr/local/share/locale + mkdir -p /usr/local/share/man + mkdir -p /usr/local/share/man/man1 + mkdir -p /usr/local/share/man/man2 + mkdir -p /usr/local/share/man/man3 + mkdir -p /usr/local/share/man/man4 + mkdir -p /usr/local/share/man/man5 + mkdir -p /usr/local/share/man/man6 + mkdir -p /usr/local/share/man/man7 + mkdir -p /usr/local/share/man/man8 + mkdir -p /usr/local/share/misc + mkdir -p /usr/local/share/terminfo + mkdir -p /usr/local/share/zoneinfo + mkdir -p /var/cache + mkdir -p /var/local + mkdir -p /var/log + mkdir -p /var/mail + mkdir -p /var/opt + mkdir -p /var/spool + mkdir -p /var/lib/color + mkdir -p /var/lib/misc + mkdir -p /var/lib/locate + + ln -sf /run /var/run + ln -sf /run/lock /var/lock + + install -d -m 0750 /root + install -d -m 1777 /tmp /var/tmp + + echo -e " ${GRN}Directories created${RST}" + touch /sources/createdirs +fi + +echo -e "${GRN}Creating essential files and symbolic links... ${RST}" +if [ -f "/sources/symfiles" ]; then + echo -e " ${GRN}Files and symbolic links already created.${RST}" +else + ln -sf /proc/self/mounts /etc/mtab + echo "127.0.0.1 localhost $(hostname)" > /etc/hosts + + cat > /etc/passwd << "EOF" +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/dev/null:/bin/false +daemon:x:6:6:Daemon User:/dev/null:/bin/false +messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/bin/false +uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/bin/false +nobody:x:99:99:Unprivileged User:/dev/null:/bin/false +EOF + + cat > /etc/group << "EOF" +root:x:0: +bin:x:1:daemon +sys:x:2: +kmem:x:3: +tape:x:4: +tty:x:5: +daemon:x:6: +floppy:x:7: +disk:x:8: +lp:x:9: +dialout:x:10: +audio:x:11: +video:x:12: +utmp:x:13: +usb:x:14: +cdrom:x:15: +adm:x:16: +messagebus:x:18: +input:x:24: +mail:x:34: +kvm:x:61: +uuidd:x:80: +wheel:x:97: +nogroup:x:99: +users:x:999: +EOF + + echo "tester:x:$(ls -n $(tty) | cut -d" " -f3):101::/home/tester:/bin/bash" >> /etc/passwd + echo "tester:x:101:" >> /etc/group + install -o tester -d /home/tester + + touch /var/log/btmp + touch /var/log/lastlog + touch /var/log/faillog + touch /var/log/tmp + chgrp utmp /var/log/lastlog + chmod 664 /var/log/lastlog + chmod 600 /var/log/btmp + + echo -e " ${GRN}Files and symlinks created.${RST}" + touch /sources/symfiles +fi + +cd /sources + +# Chapter 7 +for package in libstdc++ gettext bison perl python texinfo util-linux; do + source packageinstall.sh 7 $package + retval=$? + if [ "$retval" -ne 0 ]; then + exit 1 + fi +done -- cgit v1.2.3-54-g00ecf From b738a9419e20009e9eede93974c35e47b6f847e8 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Tue, 23 Mar 2021 14:14:56 -0500 Subject: Use printf and do some minor cleanup. --- insidechroot.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index 529fb1e..7cbee29 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -3,11 +3,11 @@ source /sources/colors.sh source /sources/spinner.sh -echo -e "${GRN}Successfully entered ${RED}CHROOT${RST}!\n" +printf "%b" "${GRN}Successfully entered ${RED}CHROOT${RST}!\n" -echo -e "${GRN}Creating directories...${RST}" +printf "%b" "${GRN}Creating directories...${RST}\n" if [ -f /sources/createdirs ]; then - echo -e "${GRN} Directories already created.${RST}" + printf "%b" "${GRN} Directories already created.${RST}\n" else mkdir -p /boot mkdir -p /home @@ -80,13 +80,13 @@ else install -d -m 0750 /root install -d -m 1777 /tmp /var/tmp - echo -e " ${GRN}Directories created${RST}" + printf "%b" " ${GRN}Directories created${RST}\n" touch /sources/createdirs fi -echo -e "${GRN}Creating essential files and symbolic links... ${RST}" +printf "%b" "${GRN}Creating essential files and symbolic links... ${RST}\n" if [ -f "/sources/symfiles" ]; then - echo -e " ${GRN}Files and symbolic links already created.${RST}" + printf "%b" " ${GRN}Files and symbolic links already created.${RST}\n" else ln -sf /proc/self/mounts /etc/mtab echo "127.0.0.1 localhost $(hostname)" > /etc/hosts @@ -128,7 +128,7 @@ nogroup:x:99: users:x:999: EOF - echo "tester:x:$(ls -n $(tty) | cut -d" " -f3):101::/home/tester:/bin/bash" >> /etc/passwd + echo "tester:x:$(ls -n "$(tty)" | cut -d" " -f3):101::/home/tester:/bin/bash" >> /etc/passwd echo "tester:x:101:" >> /etc/group install -o tester -d /home/tester @@ -144,7 +144,7 @@ EOF touch /sources/symfiles fi -cd /sources +cd /sources || exit 1 # Chapter 7 for package in libstdc++ gettext bison perl python texinfo util-linux; do -- cgit v1.2.3-54-g00ecf From fb88c0e7e323a761054e5fa95befc87dcefa4564 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Tue, 23 Mar 2021 15:22:53 -0500 Subject: Change message when entering CHROOT. --- insidechroot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index 7cbee29..784a40e 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -3,7 +3,7 @@ source /sources/colors.sh source /sources/spinner.sh -printf "%b" "${GRN}Successfully entered ${RED}CHROOT${RST}!\n" +printf "%b" "${CYN}SUCCESSFULLY ENTERED ${RED}CHROOT${RST}!\n" printf "%b" "${GRN}Creating directories...${RST}\n" if [ -f /sources/createdirs ]; then -- cgit v1.2.3-54-g00ecf From 4e2baae45edab2b18b29f0732ac46ca56bf9e96b Mon Sep 17 00:00:00 2001 From: William Harrington Date: Wed, 24 Mar 2021 11:09:13 -0500 Subject: Call inside root with an argument. 7 for chapter 7. Chapter 7 commands exit with status 7. --- insidechroot.sh | 225 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 117 insertions(+), 108 deletions(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index 784a40e..1863531 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -1,97 +1,100 @@ #!/bin/bash +CHAPTER="$1" + source /sources/colors.sh source /sources/spinner.sh printf "%b" "${CYN}SUCCESSFULLY ENTERED ${RED}CHROOT${RST}!\n" -printf "%b" "${GRN}Creating directories...${RST}\n" -if [ -f /sources/createdirs ]; then - printf "%b" "${GRN} Directories already created.${RST}\n" -else - mkdir -p /boot - mkdir -p /home - mkdir -p /mnt - mkdir -p /opt - mkdir -p /srv - - mkdir -p /etc/opt - mkdir -p /etc/opt/sysconfig - mkdir -p /lib/firmware - mkdir -p /media/floppy - mkdir -p /media/cdrom - mkdir -p /usr/bin - mkdir -p /usr/include - mkdir -p /usr/lib - mkdir -p /usr/sbin - mkdir -p /usr/src - mkdir -p /usr/local/bin - mkdir -p /usr/local/include - mkdir -p /usr/local/lib - mkdir -p /usr/local/sbin - mkdir -p /usr/local/src - mkdir -p /usr/share/color - mkdir -p /usr/share/dict - mkdir -p /usr/share/doc - mkdir -p /usr/share/info - mkdir -p /usr/share/locale - mkdir -p /usr/share/man - mkdir -p /usr/share/man/man1 - mkdir -p /usr/share/man/man2 - mkdir -p /usr/share/man/man3 - mkdir -p /usr/share/man/man4 - mkdir -p /usr/share/man/man5 - mkdir -p /usr/share/man/man6 - mkdir -p /usr/share/man/man7 - mkdir -p /usr/share/man/man8 - mkdir -p /usr/share/misc - mkdir -p /usr/share/terminfo - mkdir -p /usr/share/zoneinfo - mkdir -p /usr/local/share/color - mkdir -p /usr/local/share/dict - mkdir -p /usr/local/share/doc - mkdir -p /usr/local/share/info - mkdir -p /usr/local/share/locale - mkdir -p /usr/local/share/man - mkdir -p /usr/local/share/man/man1 - mkdir -p /usr/local/share/man/man2 - mkdir -p /usr/local/share/man/man3 - mkdir -p /usr/local/share/man/man4 - mkdir -p /usr/local/share/man/man5 - mkdir -p /usr/local/share/man/man6 - mkdir -p /usr/local/share/man/man7 - mkdir -p /usr/local/share/man/man8 - mkdir -p /usr/local/share/misc - mkdir -p /usr/local/share/terminfo - mkdir -p /usr/local/share/zoneinfo - mkdir -p /var/cache - mkdir -p /var/local - mkdir -p /var/log - mkdir -p /var/mail - mkdir -p /var/opt - mkdir -p /var/spool - mkdir -p /var/lib/color - mkdir -p /var/lib/misc - mkdir -p /var/lib/locate - - ln -sf /run /var/run - ln -sf /run/lock /var/lock - - install -d -m 0750 /root - install -d -m 1777 /tmp /var/tmp - - printf "%b" " ${GRN}Directories created${RST}\n" - touch /sources/createdirs -fi +if [ "${CHAPTER}" -eq 7 ]; then + printf "%b" "${GRN}Creating directories...${RST}\n" + if [ -f /sources/createdirs ]; then + printf "%b" "${GRN} Directories already created.${RST}\n" + else + mkdir -p /boot + mkdir -p /home + mkdir -p /mnt + mkdir -p /opt + mkdir -p /srv -printf "%b" "${GRN}Creating essential files and symbolic links... ${RST}\n" -if [ -f "/sources/symfiles" ]; then - printf "%b" " ${GRN}Files and symbolic links already created.${RST}\n" -else - ln -sf /proc/self/mounts /etc/mtab - echo "127.0.0.1 localhost $(hostname)" > /etc/hosts + mkdir -p /etc/opt + mkdir -p /etc/opt/sysconfig + mkdir -p /lib/firmware + mkdir -p /media/floppy + mkdir -p /media/cdrom + mkdir -p /usr/bin + mkdir -p /usr/include + mkdir -p /usr/lib + mkdir -p /usr/sbin + mkdir -p /usr/src + mkdir -p /usr/local/bin + mkdir -p /usr/local/include + mkdir -p /usr/local/lib + mkdir -p /usr/local/sbin + mkdir -p /usr/local/src + mkdir -p /usr/share/color + mkdir -p /usr/share/dict + mkdir -p /usr/share/doc + mkdir -p /usr/share/info + mkdir -p /usr/share/locale + mkdir -p /usr/share/man + mkdir -p /usr/share/man/man1 + mkdir -p /usr/share/man/man2 + mkdir -p /usr/share/man/man3 + mkdir -p /usr/share/man/man4 + mkdir -p /usr/share/man/man5 + mkdir -p /usr/share/man/man6 + mkdir -p /usr/share/man/man7 + mkdir -p /usr/share/man/man8 + mkdir -p /usr/share/misc + mkdir -p /usr/share/terminfo + mkdir -p /usr/share/zoneinfo + mkdir -p /usr/local/share/color + mkdir -p /usr/local/share/dict + mkdir -p /usr/local/share/doc + mkdir -p /usr/local/share/info + mkdir -p /usr/local/share/locale + mkdir -p /usr/local/share/man + mkdir -p /usr/local/share/man/man1 + mkdir -p /usr/local/share/man/man2 + mkdir -p /usr/local/share/man/man3 + mkdir -p /usr/local/share/man/man4 + mkdir -p /usr/local/share/man/man5 + mkdir -p /usr/local/share/man/man6 + mkdir -p /usr/local/share/man/man7 + mkdir -p /usr/local/share/man/man8 + mkdir -p /usr/local/share/misc + mkdir -p /usr/local/share/terminfo + mkdir -p /usr/local/share/zoneinfo + mkdir -p /var/cache + mkdir -p /var/local + mkdir -p /var/log + mkdir -p /var/mail + mkdir -p /var/opt + mkdir -p /var/spool + mkdir -p /var/lib/color + mkdir -p /var/lib/misc + mkdir -p /var/lib/locate + + ln -sf /run /var/run + ln -sf /run/lock /var/lock + + install -d -m 0750 /root + install -d -m 1777 /tmp /var/tmp + + printf "%b" " ${GRN}Directories created${RST}\n" + touch /sources/createdirs + fi - cat > /etc/passwd << "EOF" + printf "%b" "${GRN}Creating essential files and symbolic links... ${RST}\n" + if [ -f "/sources/symfiles" ]; then + printf "%b" " ${GRN}Files and symbolic links already created.${RST}\n" + else + ln -sf /proc/self/mounts /etc/mtab + echo "127.0.0.1 localhost $(hostname)" > /etc/hosts + + cat > /etc/passwd << "EOF" root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/dev/null:/bin/false daemon:x:6:6:Daemon User:/dev/null:/bin/false @@ -100,7 +103,7 @@ uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/bin/false nobody:x:99:99:Unprivileged User:/dev/null:/bin/false EOF - cat > /etc/group << "EOF" + cat > /etc/group << "EOF" root:x:0: bin:x:1:daemon sys:x:2: @@ -128,29 +131,35 @@ nogroup:x:99: users:x:999: EOF - echo "tester:x:$(ls -n "$(tty)" | cut -d" " -f3):101::/home/tester:/bin/bash" >> /etc/passwd - echo "tester:x:101:" >> /etc/group - install -o tester -d /home/tester + echo "tester:x:$(ls -n "$(tty)" | cut -d" " -f3):101::/home/tester:/bin/bash" >> /etc/passwd + echo "tester:x:101:" >> /etc/group + install -o tester -d /home/tester - touch /var/log/btmp - touch /var/log/lastlog - touch /var/log/faillog - touch /var/log/tmp - chgrp utmp /var/log/lastlog - chmod 664 /var/log/lastlog - chmod 600 /var/log/btmp + touch /var/log/btmp + touch /var/log/lastlog + touch /var/log/faillog + touch /var/log/tmp + chgrp utmp /var/log/lastlog + chmod 664 /var/log/lastlog + chmod 600 /var/log/btmp - echo -e " ${GRN}Files and symlinks created.${RST}" - touch /sources/symfiles -fi + echo -e " ${GRN}Files and symlinks created.${RST}" + touch /sources/symfiles + fi + + cd /sources || exit 1 -cd /sources || exit 1 + # Chapter 7 + for package in libstdc++ gettext bison perl python texinfo util-linux; do + source packageinstall.sh 7 $package + retval=$? + if [ "$retval" -ne 0 ]; then + exit 1 + fi + done + + exit 7 +else + printf "%b" "Do Chapter 8, 9 and 10 stuff here.\n" +fi -# Chapter 7 -for package in libstdc++ gettext bison perl python texinfo util-linux; do - source packageinstall.sh 7 $package - retval=$? - if [ "$retval" -ne 0 ]; then - exit 1 - fi -done -- cgit v1.2.3-54-g00ecf From c5175c15f5a32347e7ae86b613c8e29996a714c8 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Fri, 26 Mar 2021 16:51:31 -0500 Subject: source functions while inside chroot. --- insidechroot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index 1863531..8e5ec69 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -3,7 +3,7 @@ CHAPTER="$1" source /sources/colors.sh -source /sources/spinner.sh +source /sources/functions.sh printf "%b" "${CYN}SUCCESSFULLY ENTERED ${RED}CHROOT${RST}!\n" -- cgit v1.2.3-54-g00ecf From 37c2a2caa41c7c67b0a7daf4107d9a2ac12256dd Mon Sep 17 00:00:00 2001 From: William Harrington Date: Fri, 26 Mar 2021 17:18:17 -0500 Subject: Add some curly braces around retval for fun. --- insidechroot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index 8e5ec69..88a5d26 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -153,7 +153,7 @@ EOF for package in libstdc++ gettext bison perl python texinfo util-linux; do source packageinstall.sh 7 $package retval=$? - if [ "$retval" -ne 0 ]; then + if [ "${retval}" -ne 0 ]; then exit 1 fi done -- cgit v1.2.3-54-g00ecf From 24ae50590b533a53cbc254854ec7159c5e02c804 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Mon, 29 Mar 2021 20:43:11 -0500 Subject: Add TESTUSERID when chrooting and use 'id -u' commnd to get user id. Use when adding tester user to passwd. --- insidechroot.sh | 3 +-- lfs.sh | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index 88a5d26..57951ab 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -131,7 +131,7 @@ nogroup:x:99: users:x:999: EOF - echo "tester:x:$(ls -n "$(tty)" | cut -d" " -f3):101::/home/tester:/bin/bash" >> /etc/passwd + echo "tester:x:${TESTERUID}:101::/home/tester:/bin/bash" >> /etc/passwd echo "tester:x:101:" >> /etc/group install -o tester -d /home/tester @@ -162,4 +162,3 @@ EOF else printf "%b" "Do Chapter 8, 9 and 10 stuff here.\n" fi - diff --git a/lfs.sh b/lfs.sh index d1b23a5..fedf71a 100755 --- a/lfs.sh +++ b/lfs.sh @@ -116,6 +116,7 @@ sudo chroot "${LFS}" /usr/bin/env \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ NUMPROCS="${NUMPROCS}" \ MAKEFLAGS="${MAKEFLAGS}" \ + TESTERUID="$(id -u)" \ /bin/bash --login +h -c "/sources/insidechroot.sh 7" retval=$? @@ -147,6 +148,7 @@ sudo chroot "${LFS}" /usr/bin/env \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ NUMPROCS="${NUMPROCS}" \ MAKEFLAGS="${MAKEFLAGS}" \ + TESTERUID="$(id -u)" \ /bin/bash --login +h -c "/sources/insidechroot.sh 8" printf "%b" "${CYN}EXITED ${RED}CHROOT${RST} ENVIRONMENT...${RST}\n" -- cgit v1.2.3-54-g00ecf From 551d2c98ba564e695b6aff09f843861b326f1334 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Tue, 30 Mar 2021 10:02:31 -0500 Subject: Use essential for essential files and symlinks. --- insidechroot.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index 57951ab..6982e4b 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -88,8 +88,8 @@ if [ "${CHAPTER}" -eq 7 ]; then fi printf "%b" "${GRN}Creating essential files and symbolic links... ${RST}\n" - if [ -f "/sources/symfiles" ]; then - printf "%b" " ${GRN}Files and symbolic links already created.${RST}\n" + if [ -f "/sources/essential" ]; then + printf "%b" " ${GRN}Essential files and symbolic links already created.${RST}\n" else ln -sf /proc/self/mounts /etc/mtab echo "127.0.0.1 localhost $(hostname)" > /etc/hosts @@ -143,8 +143,8 @@ EOF chmod 664 /var/log/lastlog chmod 600 /var/log/btmp - echo -e " ${GRN}Files and symlinks created.${RST}" - touch /sources/symfiles + echo -e " ${GRN}Essential files and symlinks created.${RST}" + touch /sources/essential fi cd /sources || exit 1 -- cgit v1.2.3-54-g00ecf From 30bbcceb41eb4b8bd8126039b9a90a8b60faa605 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Thu, 1 Apr 2021 13:57:03 -0500 Subject: Add chapter 7 build message. --- insidechroot.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index 6982e4b..b927c29 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -150,6 +150,9 @@ EOF cd /sources || exit 1 # Chapter 7 + printf "%b" "${IWHT}============ ${IGRN}Building ${IYLW}Chapter 7${IWHT} \ +============${RST}\n" + for package in libstdc++ gettext bison perl python texinfo util-linux; do source packageinstall.sh 7 $package retval=$? -- cgit v1.2.3-54-g00ecf From 7aa6e829ae02e63d9f126581897e906793b38d63 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Thu, 1 Apr 2021 14:34:16 -0500 Subject: Add new line to beginning of building chapter 7 build printf. --- insidechroot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index b927c29..b44e4ca 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -150,7 +150,7 @@ EOF cd /sources || exit 1 # Chapter 7 - printf "%b" "${IWHT}============ ${IGRN}Building ${IYLW}Chapter 7${IWHT} \ + printf "%b" "\n${IWHT}============ ${IGRN}Building ${IYLW}Chapter 7${IWHT} \ ============${RST}\n" for package in libstdc++ gettext bison perl python texinfo util-linux; do -- cgit v1.2.3-54-g00ecf From 35b8da43e8fbe15ecd0114e409bf188d4c39eecf Mon Sep 17 00:00:00 2001 From: William Harrington Date: Thu, 1 Apr 2021 15:15:42 -0500 Subject: Use intense green for already completed tasks which are indented. --- insidechroot.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index b44e4ca..307e990 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -10,7 +10,7 @@ printf "%b" "${CYN}SUCCESSFULLY ENTERED ${RED}CHROOT${RST}!\n" if [ "${CHAPTER}" -eq 7 ]; then printf "%b" "${GRN}Creating directories...${RST}\n" if [ -f /sources/createdirs ]; then - printf "%b" "${GRN} Directories already created.${RST}\n" + printf "%b" "${IGRN} Directories already created.${RST}\n" else mkdir -p /boot mkdir -p /home @@ -89,7 +89,7 @@ if [ "${CHAPTER}" -eq 7 ]; then printf "%b" "${GRN}Creating essential files and symbolic links... ${RST}\n" if [ -f "/sources/essential" ]; then - printf "%b" " ${GRN}Essential files and symbolic links already created.${RST}\n" + printf "%b" " ${IGRN}Essential files and symbolic links already created.${RST}\n" else ln -sf /proc/self/mounts /etc/mtab echo "127.0.0.1 localhost $(hostname)" > /etc/hosts -- cgit v1.2.3-54-g00ecf From 95902f2386e5d79fdcd688aa27737af896b3ac28 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Fri, 2 Apr 2021 11:36:04 -0500 Subject: Use [[ ]] instead of [ ] --- insidechroot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index d943214..c6ce796 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -156,7 +156,7 @@ EOF for package in libstdc++ gettext bison perl python texinfo util-linux; do source packageinstall.sh 7 $package retval=$? - if [ "${retval}" -ne 0 ]; then + if [[ "${retval}" -ne 0 ]]; then exit 1 fi done -- cgit v1.2.3-54-g00ecf From 091055a1f954a780fb9feff6f6b46f78be451ee8 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Sat, 3 Apr 2021 01:50:42 -0500 Subject: Use intensity for OK and adjust message. --- insidechroot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'insidechroot.sh') diff --git a/insidechroot.sh b/insidechroot.sh index 486c252..a2fb9df 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -83,7 +83,7 @@ if [[ "${CHAPTER}" -eq 7 ]]; then install -d -m 0750 /root install -d -m 1777 /tmp /var/tmp - printf "%b" " ${GRN}Directories created${RST}\n" + printf "%b" " ${IGRN}OK${RST}\n" touch /sources/createdirs fi -- cgit v1.2.3-54-g00ecf