diff options
Diffstat (limited to 'lfs.sh')
-rwxr-xr-x | lfs.sh | 34 |
1 files changed, 33 insertions, 1 deletions
@@ -137,5 +137,37 @@ sudo chroot "${LFS}" /usr/bin/env \ MAKEFLAGS="${MAKEFLAGS}" \ TESTERUID="$(id -u)" \ /bin/bash --login +h -c "/sources/insidechroot.sh 7" +retval=$? + +printf "%b" "${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" "${GRN}Cleaning and backing up before starting Chapter 8.\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 + +# 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}" \ + TESTERUID="$(id -u)" \ + /bin/bash --login +h -c "/sources/insidechroot.sh 8" -printf "%b" "${CYN}EXITED ${RED}CHROOT${CYN} ENVIRONMENT...${RST}\n" +printf "%b" "${CYN}EXITED ${RED}CHROOT${RST} ENVIRONMENT...${RST}\n" |