Index: CLFS/master.sh
===================================================================
--- CLFS/master.sh	(revision ffd8c5a1dbc18f33ac1ece0ef580024f3fed364a)
+++ CLFS/master.sh	(revision 7d4cc81f343f94c144cf76d0b7ce4e5dd188f2b3)
@@ -172,4 +172,5 @@
 	@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
 	touch envars && \\
+	chmod -R a+wt \$(MOUNT_PT) && \\
 	chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
 	touch \$@ && \\
@@ -320,7 +321,7 @@
     # the names of the targets in the Makefile
     case "${this_script}" in
-      *util-linux) : ;;
-      *kernfs) orphan_scripts="${orphan_scripts} ${this_script}"  ;;
-      *)          chroottools="$chroottools $this_script"         ;;
+      *util-linux) orphan_scripts="${orphan_scripts} ${this_script}"  ;;
+      *kernfs)     orphan_scripts="${orphan_scripts} ${this_script}"  ;;
+      *)           chroottools="$chroottools $this_script"            ;;
     esac    
 
@@ -1182,6 +1183,15 @@
 cat << EOF
 
-all: mk_SETUP mk_CROSS mk_TEMP restore_luser_env mk_SYSTOOLS mk_FINAL mk_BOOTSCRIPT mk_BOOTABLE do-housekeeping
+all: ck_UID mk_SETUP mk_CROSS mk_TEMP mk_SUDO mk_SYSTOOLS mk_FINAL mk_BOOTSCRIPT mk_BOOTABLE
+	@sudo make do-housekeeping
 	@\$(call echo_finished,$VERSION)
+
+ck_UID:
+	@if [ \`id -u\` = "0" ]; then \\
+	  echo "--------------------------------------------------"; \\
+	  echo "You cannot run this makefile from the root account"; \\
+	  echo "--------------------------------------------------"; \\
+	  exit 1; \\
+	fi
 
 #---------------AS ROOT
@@ -1194,12 +1204,16 @@
 mk_CROSS: mk_SETUP
 	@\$(call echo_PHASE,Cross Tool)
-	@( \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make CROSS" )
+	@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make CROSS" )
 	@touch \$@
 
 mk_TEMP: mk_CROSS
 	@\$(call echo_PHASE,Temporary Tools)
-	@( \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make TEMP" )
-	@touch \$@
-
+	@(sudo  \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make TEMP" )
+	@sudo make restore-luser-env
+	@touch \$@
+
+mk_SUDO: mk_TEMP
+	@sudo make SUDO
+	@touch \$@
 #
 # The convoluted piece of code below is necessary to provide 'make' with a valid shell in the
@@ -1210,5 +1224,5 @@
 
 #---------------CHROOT JAIL
-mk_SYSTOOLS: mk_TEMP $orphan_scripts
+mk_SYSTOOLS: mk_SUDO 
 	@mkdir \$(MOUNT_PT)/bin && \\
 	cd \$(MOUNT_PT)/bin && \\
@@ -1246,9 +1260,19 @@
 cat << EOF
 
-all:	mk_SETUP mk_CROSS mk_TEMP mk_SYSTOOLS $orphan_scripts restore-luser-env
+all:	ck_UID mk_SETUP mk_CROSS mk_TEMP mk_SYSTOOLS mk_SUDO
+	@sudo make restore-luser-env
 	@\$(call echo_boot_finished,$VERSION)
 
 makesys: mk_FINAL mk_BOOTSCRIPT mk_BOOTABLE
 	@\$(call echo_finished,$VERSION)
+
+
+ck_UID:
+	@if [ \`id -u\` = "0" ]; then \\
+	  echo "--------------------------------------------------"; \\
+	  echo "You cannot run this makefile from the root account"; \\
+	  echo "--------------------------------------------------"; \\
+	  exit 1; \\
+	fi
 
 #---------------AS ROOT
@@ -1263,15 +1287,19 @@
 mk_CROSS: mk_SETUP
 	@\$(call echo_PHASE,Cross Tool)
-	@( \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make CROSS" )
+	@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make CROSS" )
 	@touch \$@
 
 mk_TEMP: mk_CROSS
 	@\$(call echo_PHASE,Temporary Tools)
-	@( \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make TEMP" )
+	@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make TEMP" )
 	@touch \$@
 
 mk_SYSTOOLS: mk_TEMP
 	@\$(call echo_PHASE,Minimal Boot system)
-	@( \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SYSTOOLS" )
+	@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make SYSTOOLS" )
+	@touch \$@
+
+mk_SUDO: mk_SYSTOOLS
+	@sudo make SUDO
 	@touch \$@
 
@@ -1303,4 +1331,5 @@
 CROSS:      $cross_tools
 TEMP:       $temptools
+SUDO:	    $orphan_scripts
 SYSTOOLS:   ${chroottools}${boottools}
 FINAL:      $testsuitetools $basicsystem
