Index: CLFS/master.sh
===================================================================
--- CLFS/master.sh	(revision 3fed5860369d3019685c8cc25cb1f50cf71e5e7b)
+++ CLFS/master.sh	(revision df41521ba64fb5c4b2df2b5e8372b280e40ecc4d)
@@ -19,5 +19,5 @@
 023-creatingtoolsdir:
 	@\$(call echo_message, Building)
-	@mkdir \$(MOUNT_PT)/tools && \\
+	@install -dv \$(MOUNT_PT)/tools && \\
 	rm -f /tools && \\
 	ln -s \$(MOUNT_PT)/tools /
@@ -26,5 +26,5 @@
 024-creatingcrossdir: 023-creatingtoolsdir
 	@\$(call echo_message, Building)
-	@mkdir -v \$(MOUNT_PT)/cross-tools && \\
+	@install -dv \$(MOUNT_PT)/cross-tools && \\
 	rm -f /cross-tools && \\
 	ln -s \$(MOUNT_PT)/cross-tools /
@@ -34,11 +34,13 @@
 	@\$(call echo_message, Building)
 	@if [ ! -d \$(LUSER_HOME) ]; then \\
-		groupadd \$(LGROUP); \\
-		useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
+	    groupadd \$(LGROUP); \\
+	    useradd -s /bin/bash -g \$(LGROUP) -d \$(LUSER_HOME) \$(LUSER); \\
+	    mkdir -pv \$(LUSER_HOME); \\
+	    chown -v \$(LUSER):\$(LGROUP) \$(LUSER_HOME); \\
 	else \\
-		touch luser-exist; \\
-	fi;
-	@chown \$(LUSER) \$(MOUNT_PT)/tools && \\
-	chown \$(LUSER) \$(MOUNT_PT)/cross-tools && \\
+	    touch luser-exist; \\
+	fi
+	@chown -v \$(LUSER) \$(MOUNT_PT)/tools && \\
+	chown -v \$(LUSER) \$(MOUNT_PT)/cross-tools && \\
 	chmod -R a+wt \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
 	chmod a+wt \$(SRCSDIR)
@@ -49,5 +51,5 @@
 	@if [ -f \$(LUSER_HOME)/.bashrc -a ! -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
 		mv \$(LUSER_HOME)/.bashrc \$(LUSER_HOME)/.bashrc.XXX; \\
-	fi;
+	fi
 	@if [ -f \$(LUSER_HOME)/.bash_profile  -a ! -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
 		mv \$(LUSER_HOME)/.bash_profile \$(LUSER_HOME)/.bash_profile.XXX; \\
@@ -68,7 +70,10 @@
 	echo "source $JHALFSDIR/envars" >> \$(LUSER_HOME)/.bashrc
 	@chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bashrc && \\
+	chmod a+wt \$(MOUNT_PT) && \\
+	if [ -d \$(MOUNT_PT)/var ]; then \\
+	  chown -R \$(LUSER) \$(MOUNT_PT)/var; \\
+	fi && \\
 	touch envars && \\
-	chmod -R a+wt \$(MOUNT_PT) && \\
-	chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT)
+	chown \$(LUSER):\$(LGROUP) envars
 	@\$(call housekeeping)
 EOF
@@ -557,5 +562,5 @@
       # If the testsuites must be run, initialize the log file
       case $name in
-        binutils | gcc | glibc | eglibc )
+        binutils | gcc | glibc | eglibc | gmp | mpfr | mpc | isl | cloog )
           [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
           ;;
@@ -846,15 +851,9 @@
 build_Makefile() {                     # Construct a Makefile from the book scripts
 #--------------------------------------#
-  #
-  # Script crashes if error trapping is on
-  #
-set +e
-  declare -f  method_cmds
-set -e
 
   echo "...Creating Makefile... ${BOLD}START${OFF}"
 
   cd $JHALFSDIR/${PROGNAME}-commands
-  # Start with a clean files
+  # Start with clean files
   >$MKFILE
   >$MKFILE.tmp
@@ -880,6 +879,4 @@
   # Add the CUSTOM_TOOLS targets, if needed
   [[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
-  # Add the BLFS_TOOL targets, if needed
-  [[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
 
   # Add a header, some variables and include the function file
@@ -916,5 +913,6 @@
 	@sudo make do-housekeeping
 	@echo "$VERSION - jhalfs build" > clfs-release && \\
-	sudo mv clfs-release \$(MOUNT_PT)/etc
+	sudo mv clfs-release \$(MOUNT_PT)/etc && \\
+	sudo chown root:root \$(MOUNT_PT)/etc/clfs-release
 	@\$(call echo_finished,$VERSION)
 
@@ -936,5 +934,5 @@
 mk_CROSS: mk_SETUP
 	@\$(call echo_PHASE,Cross and Temporary Tools)
-	@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
+	@( \$(SU_LUSER) "make -C \$(MOUNT_PT)/\$(SCRIPT_ROOT) BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
 	@sudo make restore-luser-env
 	@touch \$@
@@ -952,17 +950,16 @@
 	@touch \$@
 
-mk_CUSTOM_TOOLS: create-sbu_du-report
+mk_BLFS_TOOL: create-sbu_du-report
+	@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
+	  \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
+	  (sudo \$(CHROOT1) "make -C $BLFS_ROOT/work"); \\
+	fi;
+	@touch \$@
+
+mk_CUSTOM_TOOLS: mk_BLFS_TOOL
 	@if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
 	  \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
 	  sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
 	  (sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CUSTOM_TOOLS"); \\
-	fi;
-	@touch \$@
-
-mk_BLFS_TOOL: mk_CUSTOM_TOOLS
-	@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
-	  \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
-	  sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
-	  sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL"; \\
 	fi;
 	@touch \$@
@@ -976,5 +973,4 @@
 CHROOT_JAIL:      $testsuitetools $basicsystem  $bootscripttools  $bootabletools
 CUSTOM_TOOLS:     $custom_list
-BLFS_TOOL:        $blfs_tool
 
 
@@ -989,5 +985,11 @@
 do-housekeeping:
 	@-umount \$(MOUNT_PT)/dev/pts
-	@-umount \$(MOUNT_PT)/dev/shm
+	@-if [ -h \$(MOUNT_PT)/dev/shm ]; then \\
+	  link=\$\$(readlink \$(MOUNT_PT)/dev/shm); \\
+	  umount \$(MOUNT_PT)/\$\$link; \\
+	  unset link; \\
+	else \\
+	  umount \$(MOUNT_PT)/dev/shm; \\
+	fi
 	@-umount \$(MOUNT_PT)/dev
 	@-umount \$(MOUNT_PT)/sys
@@ -1027,5 +1029,5 @@
 	  echo "| the command you are looking for is               |"; \\
 	  echo "|   make makesys                                   |"; \\
-	  echo "| to finish off the build                          |"; \\
+	  echo "| to complete the build                            |"; \\
 	  echo "+--------------------------------------------------+"; \\
 	  exit 1; \\
@@ -1043,5 +1045,5 @@
 mk_CROSS: mk_SETUP
 	@\$(call echo_PHASE,Cross Tool)
-	@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
+	@( \$(SU_LUSER) "make -C \$(MOUNT_PT)/\$(SCRIPT_ROOT) BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
 	@touch \$@
 
@@ -1057,5 +1059,12 @@
 	@touch \$@
 
-mk_CUSTOM_TOOLS: mk_FINAL
+mk_BLFS_TOOL: mk_FINAL
+	@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
+	  \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
+	  ( make -C $BLFS_ROOT/work ); \\
+	fi;
+	@touch \$@
+
+mk_CUSTOM_TOOLS: mk_BLFS_TOOL
 	@if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
 	  \$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
@@ -1065,12 +1074,4 @@
 	@touch \$@
 
-mk_BLFS_TOOL: mk_CUSTOM_TOOLS
-	@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
-	  \$(call sh_echo_PHASE,Building BLFS_TOOL); \\
-	  mkdir -p $TRACKING_DIR; \\
-	  ( source /root/.bash_profile && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL ); \\
-	fi
-	@touch \$@
-
 SETUP:        $host_prep
 AS_LUSER:     $cross_tools $temptools ${boottools}
@@ -1079,5 +1080,4 @@
 AS_ROOT:      $testsuitetools $basicsystem $bootscripttools $bootabletools
 CUSTOM_TOOLS: $custom_list
-BLFS_TOOL:    $blfs_tool
 
 do-housekeeping:
