diff --git a/CLFS/master.sh b/CLFS/master.sh index 8d535ef..4e5a258 100755 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -1016,7 +1016,7 @@ EOF if [[ "${METHOD}" = "chroot" ]]; then ( cat << EOF -all: chapter2 chapter3 chapter4 chapter5 chapter6 chapter7 chapter8 +all: chapter2 chapter3 chapter4 chapter5 chapter6 chapter7 chapter8 do-housekeeping @\$(call echo_finished,$VERSION) chapter2: 023-creatingtoolsdir 024-creatingcrossdir 025-addinguser 026-settingenvironment @@ -1077,6 +1077,17 @@ restore-lfs-env: @chown lfs:lfs /home/lfs/.bash* && \\ touch \$@ +do-housekeeping: + -umount \$(MOUNT_PT)/dev/pts + -umount \$(MOUNT_PT)/dev/shm + -umount \$(MOUNT_PT)/dev + -umount \$(MOUNT_PT)/sys + -umount \$(MOUNT_PT)/proc + -if [ ! -f user-lfs-exist ]; then \\ + userdel lfs; \\ + rm -rf /home/lfs; \\ + fi; + EOF ) >> $MKFILE fi @@ -1146,6 +1157,7 @@ restore-lfs-env: @chown lfs:lfs /home/lfs/.bash* && \\ touch \$@ + EOF ) >> $MKFILE fi diff --git a/HLFS/master.sh b/HLFS/master.sh index 0b935ad..52c71e7 100755 --- a/HLFS/master.sh +++ b/HLFS/master.sh @@ -561,6 +561,17 @@ restore-lfs-env: @chown lfs:lfs /home/lfs/.bash* && \\ touch \$@ +do-housekeeping: + -umount \$(MOUNT_PT)/dev/pts + -umount \$(MOUNT_PT)/dev/shm + -umount \$(MOUNT_PT)/dev + -umount \$(MOUNT_PT)/sys + -umount \$(MOUNT_PT)/proc + -if [ ! -f user-lfs-exist ]; then \\ + userdel lfs; \\ + rm -rf /home/lfs; \\ + fi; + EOF ) >> $MKFILE diff --git a/LFS/master.sh b/LFS/master.sh index 359bf3b..f41c0fc 100755 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -376,7 +376,7 @@ EOF # as a dependency. ( cat << EOF -all: chapter4 chapter5 chapter6 chapter789 +all: chapter4 chapter5 chapter6 chapter789 do_housekeeping @\$(call echo_finished,$VERSION) chapter4: 020-creatingtoolsdir 021-addinguser 022-settingenvironment @@ -431,7 +431,18 @@ restore-lfs-env: fi; @chown lfs:lfs /home/lfs/.bash* && \\ touch \$@ - + +do_housekeeping: + -umount \$(MOUNT_PT)/sys + -umount \$(MOUNT_PT)/proc + -umount \$(MOUNT_PT)/dev/shm + -umount \$(MOUNT_PT)/dev/pts + -umount \$(MOUNT_PT)/dev + -if [ ! -f user-lfs-exist ]; then \\ + userdel lfs; \\ + rm -rf /home/lfs; \\ + fi; + EOF ) >> $MKFILE