From 95106e41d0abc92a05384092c93f266dbd1bd9e7 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Mon, 5 Apr 2021 14:01:56 -0500 Subject: Create directories and essential files outside of chroot. Then chroot. When stripping, exit status is not 0 when strip finds uknown formats. Just return true. Make createdirs, umountvirtfs and essential files as separate scripts. --- lfs.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'lfs.sh') diff --git a/lfs.sh b/lfs.sh index 55bdfb6..0d2a894 100755 --- a/lfs.sh +++ b/lfs.sh @@ -143,6 +143,8 @@ chmod ugo+x insidechroot.sh printf "%b" "\n${CYN}PREPARING ${RED}CHROOT${CYN} ENVIRONMENT${RST}...\n" sudo ./preparechroot.sh "${LFS}" +source createdirs.sh +source essential.sh printf "%b" "\n${CYN}ENTERING ${RED}CHROOT${CYN} ENVIRONMENT${RST}...\n" sleep 3 @@ -155,19 +157,13 @@ sudo chroot "${LFS}" /usr/bin/env \ NUMPROCS="${NUMPROCS}" \ MAKEFLAGS="${MAKEFLAGS}" \ SPINNER="${SPINNER}" \ - TESTERUID="$(id -u)" \ /bin/bash --login +h -c "/sources/insidechroot.sh 7" retval=$? printf "%b" "\n${CYN}EXITED ${RED}CHROOT${RST} ENVIRONMENT...${RST}\n" # Cleanup and Backup if chapter 7 successfully finished -if [[ "$retval" -eq 7 ]]; then - printf "%b" "${GRN}Unmounting Virtual Kernel Filesystems...\n" - sudo umount "${LFS}"/dev/pts - sudo umount "${LFS}"/dev/ - sudo umount "${LFS}"/run - sudo umount "${LFS}"/sys - sudo umount "${LFS}"/proc +if [[ "$retval" -eq 0 ]]; then + source umountvirtfs.sh printf "%b" "\n${IWHT}======= ${IYLW}Chapter 7 ${IGRN}Cleanup and Backup \ ${IWHT}=======${RST}\n" @@ -192,7 +188,6 @@ sudo chroot "${LFS}" /usr/bin/env \ NUMPROCS="${NUMPROCS}" \ MAKEFLAGS="${MAKEFLAGS}" \ SPINNER="${SPINNER}" \ - TESTERUID="$(id -u)" \ /bin/bash --login +h -c "/sources/insidechroot.sh 8" printf "%b" "\n${CYN}EXITED ${RED}CHROOT${CYN} ENVIRONMENT${RST}...\n" -- cgit v1.2.3-54-g00ecf