diff options
Diffstat (limited to 'lfs.sh')
-rwxr-xr-x | lfs.sh | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -154,7 +154,44 @@ sudo chroot "${LFS}" /usr/bin/env \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ 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 + + 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 + exit "$retval" +fi + +# Mount virtual kernel filesystems after cleanup and backup +source mountvirtfs.sh + +printf "%b" "\n${CYN}ENTERING ${RED}CHROOT${CYN} ENVIRONMENT...${RST}\n" +sleep 3 + +# Enter CHROOT for chapter 8, 9 and 10 +sudo chroot "${LFS}" /usr/bin/env \ + HOME=/root \ + TERM="${TERM}" \ + PS1='(lfs chroot) \u:\w\$ ' \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + 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" |