r3146 - in jhalfs/trunk: . CLFS CLFS2 HLFS LFS common common/blfs-tool-deps

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Mon Oct 2 12:32:11 PDT 2006


Author: manuel
Date: 2006-10-02 13:32:06 -0600 (Mon, 02 Oct 2006)
New Revision: 3146

Added:
   jhalfs/trunk/README.HLFS
   jhalfs/trunk/common/blfs-tool-deps/903-tidy
   jhalfs/trunk/common/blfs-tool-deps/904-unzip
   jhalfs/trunk/common/blfs-tool-deps/905-docbook-xml
   jhalfs/trunk/common/blfs-tool-deps/906-docbook-xsl
   jhalfs/trunk/common/blfs-tool-deps/907-gpm
   jhalfs/trunk/common/blfs-tool-deps/908-links
   jhalfs/trunk/common/blfs-tool-deps/909-sudo
   jhalfs/trunk/common/blfs-tool-deps/910-wget
   jhalfs/trunk/common/blfs-tool-deps/911-subversion
Removed:
   jhalfs/trunk/common/blfs-tool-deps/903-docbook-xsl
   jhalfs/trunk/common/blfs-tool-deps/904-gpm
   jhalfs/trunk/common/blfs-tool-deps/905-links
   jhalfs/trunk/common/blfs-tool-deps/906-sudo
   jhalfs/trunk/common/blfs-tool-deps/907-wget
   jhalfs/trunk/common/blfs-tool-deps/908-subversion
Modified:
   jhalfs/trunk/CLFS/master.sh
   jhalfs/trunk/CLFS2/master.sh
   jhalfs/trunk/Config.in
   jhalfs/trunk/HLFS/master.sh
   jhalfs/trunk/LFS/master.sh
   jhalfs/trunk/blfs-tool
   jhalfs/trunk/common/common-functions
   jhalfs/trunk/common/create-sbu_du-report.sh
   jhalfs/trunk/common/func_check_version.sh
   jhalfs/trunk/common/func_compare.sh
   jhalfs/trunk/common/func_validate_configs.sh
   jhalfs/trunk/common/makefile-functions
   jhalfs/trunk/common/progress_bar.sh
   jhalfs/trunk/jhalfs
Log:
Merged r3043:3145 from experimental:
New Makefile code and other improvements.

Modified: jhalfs/trunk/CLFS/master.sh
===================================================================
--- jhalfs/trunk/CLFS/master.sh	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/CLFS/master.sh	2006-10-02 19:32:06 UTC (rev 3146)
@@ -1,17 +1,110 @@
 #!/bin/sh
 # $Id$
 
+
+orphan_scripts="" # 2 scripts do not fit BOOT_Makefiles LUSER environment
+
 ###################################
 ###          FUNCTIONS          ###
 ###################################
 
+#--------------------------------------#
+BOOT_wrt_target() {                    # "${this_script}" "$PREV"
+#--------------------------------------#
+  local i=$1
+  local PREV=$2
+  case $i in
+    iteration* ) local LOGFILE=$this_script.log ;;
+             * ) local LOGFILE=$this_script ;;
+  esac
+(
+cat << EOF
 
-#----------------------------#
-host_prep_Makefiles() {      # Initialization of the system
-#----------------------------#
+$i:  $PREV
+	@\$(call echo_message, Building)
+	@./progress_bar.sh \$@ \$\$PPID &
+	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
+EOF
+) >> $MKFILE.tmp
+}
+
+#--------------------------------------#
+BOOT_wrt_Unpack() {                    # "$pkg_tarball"
+#--------------------------------------#
+  local FILE=$1
+  local optSAVE_PREVIOUS=$2
+
+  if [ "${optSAVE_PREVIOUS}" != "1" ]; then
+(
+cat << EOF
+	@\$(call remove_existing_dirs2,$FILE)
+EOF
+) >> $MKFILE.tmp
+  fi
+(
+cat  << EOF
+	@\$(call unpack3,$FILE)
+	@\$(call get_pkg_root2)
+EOF
+) >> $MKFILE.tmp
+}
+
+#----------------------------------#
+BOOT_wrt_RunAsRoot() {             # "${this_script}" "${file}"
+#----------------------------------#
+  local this_script=$1
+  local file=$2
+(
+cat << EOF
+	@( time { source envars && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
+	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \`\n" >>logs/\$@
+EOF
+) >> $MKFILE.tmp
+}
+
+#--------------------------------------#
+BOOT_wrt_RemoveBuildDirs() {           # "${name}"
+#--------------------------------------#
+  local name=$1
+(
+cat << EOF
+	@\$(call remove_build_dirs2,$name)
+EOF
+) >> $MKFILE.tmp
+}
+
+#----------------------------------#
+BOOT_wrt_test_log() {              #
+#----------------------------------#
+  local TESTLOGFILE=$1
+(
+cat  << EOF
+	@echo "export TEST_LOG=/\$(SCRIPT_ROOT)/test-logs/$TESTLOGFILE" >> envars && \\
+	echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
+EOF
+) >> $MKFILE.tmp
+}
+
+#----------------------------------#
+BOOT_wrt_CopyFstab() {             #
+#----------------------------------#
+(
+cat << EOF
+	@( time { cp -v /sources/fstab /etc/fstab >>logs/${this_script} 2>&1 ; } ) 2>>logs/${this_script}
+EOF
+) >> $MKFILE.tmp
+}
+
+
+########################################
+
+
+#--------------------------------------#
+host_prep_Makefiles() {                #
+#--------------------------------------#
   local   CLFS_HOST
 
-  echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files  ( SETUP ) ${R_arrow}"
 
   # defined here, only for ease of reading
   CLFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
@@ -78,21 +171,22 @@
 	echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc
 	@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
 	touch envars && \\
+	chmod -R a+wt \$(MOUNT_PT) && \\
+	chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
 EOF
 ) >> $MKFILE.tmp
+  host_prep=" 023-creatingtoolsdir 024-creatingcrossdir 026-settingenvironment"
 
 }
 
+#--------------------------------------#
+cross_tools_Makefiles() {              #
+#--------------------------------------#
+  echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools  ( LUSER ) ${R_arrow}"
 
-
-#-----------------------------#
-cross_tools_Makefiles() {     #
-#-----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools${R_arrow}"
-
   for file in cross-tools/* ; do
     # Keep the script file name
     this_script=`basename $file`
@@ -126,15 +220,15 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    LUSER_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
     #
-    wrt_RunAsUser "${this_script}" "${file}"
+    LUSER_wrt_RunAsUser "${file}"
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -149,12 +243,11 @@
   done # for file in ....
 }
 
+#--------------------------------------#
+temptools_Makefiles() {                #
+#--------------------------------------#
+  echo "${tab_}${GREEN}Processing... ${L_arrow}temp system  ( LUSER ) ${R_arrow}"
 
-#-----------------------------#
-temptools_Makefiles() {       #
-#-----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}temp system${R_arrow}"
-
   for file in temp-system/* ; do
     # Keep the script file name
     this_script=`basename $file`
@@ -184,17 +277,17 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    LUSER_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and to set the PKGDIR variable.
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
     [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
-    wrt_RunAsUser "${this_script}" "${file}"
+    LUSER_wrt_RunAsUser "${file}"
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -209,76 +302,77 @@
 }
 
 
-#-----------------------------#
-boot_Makefiles() {            #
-#-----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}boot${R_arrow}"
+#--------------------------------------#
+chroot_Makefiles() {                   #
+#--------------------------------------#
+  echo "${tab_}${GREEN}Processing... ${L_arrow}tmptools CHROOT        ( CHROOT ) ${R_arrow}"
 
-  for file in boot/* ; do
+  for file in chroot/* ; do
     # Keep the script file name
     this_script=`basename $file`
-
-    # A little housekeeping on the scripts
+    #
+    # Skipping scripts is done now and not included in the build tree.
     case $this_script in
-      *grub | *aboot | *colo | *silo | *arcload | *lilo )     continue     ;;
-      *whatnext*) continue     ;;
-      *kernel)    # if there is no kernel config file do not build the kernel
-                [[ -z $CONFIG ]] && continue
-                  # Copy the config file to /sources with a standardized name
-                cp $BOOT_CONFIG $BUILDDIR/sources/bootkernel-config
-          ;;
+      *chroot*) continue ;;
     esac
+
     #
     # First append each name of the script files to a list (this will become
     # the names of the targets in the Makefile
-    boottools="$boottools $this_script"
-    #
-    # Grab the name of the target, strip id number and misc words.
-    case $this_script in
-      *kernel)        name=linux                   ;;
-      *bootscripts)   name="bootscripts-cross-lfs" ;;
-      *udev-rules)    name="udev-cross-lfs"        ;;
-      *grub-build)    name=grub                    ;;
-      *-aboot-build)  name=aboot                   ;;
-      *yaboot-build)  name=yaboot                  ;;
-      *colo-build)    name=colo                    ;;
-      *silo-build)    name=silo                    ;;
-      *arcload-build) name=arcload                 ;;
-      *lilo-build)    name=lilo                    ;;
-      *)              name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's at -build@@' ` ;;
+    case "${this_script}" in
+      *util-linux) orphan_scripts="${orphan_scripts} ${this_script}"  ;;
+      *kernfs)     orphan_scripts="${orphan_scripts} ${this_script}"  ;;
+      *)           chroottools="$chroottools $this_script"            ;;
     esac
-      # Identify the unique version naming scheme for the clfs bootscripts..(bad boys)
+
+    # Grab the name of the target, strip id number, XXX-script
+    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
+
     pkg_tarball=$(get_package_tarball_name $name)
 
+    # This is very ugly:: util-linux is in /chroot but must be run under LUSER
+    # .. Customized makefile entry
+    case "${this_script}" in
+      *util-linux)
+         LUSER_wrt_target "${this_script}" "$PREV"
+         LUSER_wrt_unpack "$pkg_tarball"
+         [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
+         LUSER_wrt_RunAsUser "${file}"
+         LUSER_RemoveBuildDirs "${name}"
+         wrt_touch
+	 temptools="$temptools $this_script"
+	 continue ;;
+     esac
+
+
     #--------------------------------------------------------------------#
     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     #--------------------------------------------------------------------#
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    CHROOT_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
-    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
+    if [ "$pkg_tarball" != "" ] ; then
+      case $this_script in
+        *util-linux)      ROOT_Unpack  "$pkg_tarball"  ;;
+        *)              CHROOT_Unpack "$pkg_tarball"  ;;
+      esac
+      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
+    fi
     #
     # Select a script execution method
     case $this_script in
-      *changingowner*)  wrt_RunAsRoot "${this_script}" "${file}"    ;;
-      *devices*)        wrt_RunAsRoot "${this_script}" "${file}"    ;;
-      *fstab*)   if [[ -n "$FSTAB" ]]; then
-                   wrt_copy_fstab "${this_script}"
-                 else
-                   wrt_RunAsUser  "${this_script}" "${file}"
-                 fi
-         ;;
-      *)         wrt_RunAsUser  "${this_script}" "${file}"       ;;
+      *kernfs)      wrt_RunAsRoot         "${this_script}" "${file}"  ;;
+      *util-linux)  ROOT_RunAsRoot        "${file}"  ;;
+      *)            CHROOT_wrt_RunAsRoot  "${file}"  ;;
     esac
     #
-    # Housekeeping...remove any build directory(ies) except if the package build fails.
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
+    # Housekeeping...remove the build directory(ies), except if the package build fails.
+    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -290,32 +384,58 @@
     # Keep the script file name for Makefile dependencies.
     PREV=$this_script
 
-  done
+  done # for file in...
 }
 
 
-#-----------------------------#
-chroot_Makefiles() {          #
-#-----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}chroot${R_arrow}"
+#--------------------------------------#
+boot_Makefiles() {                     #
+#--------------------------------------#
 
-  for file in chroot/* ; do
+  echo "${tab_}${GREEN}Processing... ${L_arrow}tmptools BOOT  ( LUSER ) ${R_arrow}"
+  #
+  # Create a target bootable partition containing a compile environment. Later
+  #  on we boot into this environment and contine the build.
+  #
+  for file in boot/* ; do
     # Keep the script file name
     this_script=`basename $file`
-    #
-    # Skipping scripts is done now and not included in the build tree.
+
+    # A little housekeeping on the scripts
     case $this_script in
-      *chroot*) continue ;;
+      *grub | *aboot | *colo | *silo | *arcload | *lilo )     continue     ;;
+      *whatnext*) continue     ;;
+      *fstab)   [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
+      *kernel)  # if there is no kernel config file do not build the kernel
+                [[ -z $CONFIG ]] && continue
+                  # Copy the config file to /sources with a standardized name
+                cp $BOOT_CONFIG $BUILDDIR/sources/bootkernel-config
+          ;;
     esac
-
     #
     # First append each name of the script files to a list (this will become
     # the names of the targets in the Makefile
-    chroottools="$chroottools $this_script"
-
-    # Grab the name of the target, strip id number, XXX-script
-    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
-
+    case "${this_script}" in
+      *changingowner)  orphan_scripts="${orphan_scripts} ${this_script}"  ;;
+      *devices)        orphan_scripts="${orphan_scripts} ${this_script}"  ;;
+      *)               boottools="$boottools $this_script" ;;
+    esac
+    #
+    # Grab the name of the target, strip id number and misc words.
+    case $this_script in
+      *kernel)        name=linux                   ;;
+      *bootscripts)   name="bootscripts-cross-lfs" ;;
+      *udev-rules)    name="udev-cross-lfs"        ;;
+      *grub-build)    name=grub                    ;;
+      *-aboot-build)  name=aboot                   ;;
+      *yaboot-build)  name=yaboot                  ;;
+      *colo-build)    name=colo                    ;;
+      *silo-build)    name=silo                    ;;
+      *arcload-build) name=arcload                 ;;
+      *lilo-build)    name=lilo                    ;;
+      *)              name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's at -build@@' ` ;;
+    esac
+      # Identify the unique version naming scheme for the clfs bootscripts..(bad boys)
     pkg_tarball=$(get_package_tarball_name $name)
 
     #--------------------------------------------------------------------#
@@ -324,28 +444,31 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    LUSER_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     #
-    if [ "$pkg_tarball" != "" ] ; then
-      case $this_script in
-        *util-linux)    wrt_unpack  "$pkg_tarball"  ;;
-        *)              wrt_unpack2 "$pkg_tarball"  ;;
-      esac
-      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
-    fi
+    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
     # Select a script execution method
     case $this_script in
-      *kernfs)      wrt_RunAsRoot "${this_script}" "${file}"  ;;
-      *util-linux)  wrt_RunAsUser "${this_script}" "${file}"  ;;
-      *)            wrt_run_as_chroot1  "${this_script}" "${file}"  ;;
+       # The following 2 scripts are defined in the /boot directory but need
+       # to be run as a root user. Set them up here but run them in another phase
+      *changingowner*)  wrt_RunAsRoot "${this_script}" "${file}"    ;;
+      *devices*)        wrt_RunAsRoot "${this_script}" "${file}"    ;;
+      *fstab*)   if [[ -n "$FSTAB" ]]; then
+                   LUSER_wrt_CopyFstab
+                 else
+                   LUSER_wrt_RunAsUser  "${file}"
+                 fi
+         ;;
+      *)         LUSER_wrt_RunAsUser  "${file}"       ;;
     esac
     #
-    # Housekeeping...remove the build directory(ies), except if the package build fails.
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
+    # Housekeeping...remove any build directory(ies) except if the package build fails.
+    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -357,14 +480,14 @@
     # Keep the script file name for Makefile dependencies.
     PREV=$this_script
 
-  done # for file in...
+  done
 }
 
 
-#-----------------------------#
-testsuite_tools_Makefiles() { #
-#-----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) testsuite tools${R_arrow}"
+#--------------------------------------#
+chroot_testsuite_tools_Makefiles() {   #
+#--------------------------------------#
+  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) testsuite tools  ( CHROOT ) ${R_arrow}"
 
   for file in testsuite-tools/* ; do
     # Keep the script file name
@@ -389,14 +512,14 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    CHROOT_wrt_target "${this_script}" "$PREV"
     #
-    wrt_unpack2 "$pkg_tarball"
+    CHROOT_Unpack "$pkg_tarball"
     [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
-    wrt_run_as_chroot1 "${this_script}" "${file}"
+    CHROOT_wrt_RunAsRoot "${file}"
     #
-    wrt_remove_build_dirs "${name}"
+    CHROOT_wrt_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -411,12 +534,10 @@
   done
 }
 
-
-#--------------------------------#
-bm_testsuite_tools_Makefiles() { #
-#--------------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) testsuite tools${R_arrow}"
-
+#--------------------------------------#
+boot_testsuite_tools_Makefiles() {     #
+#--------------------------------------#
+  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) testsuite tools ( ROOT ) ${R_arrow}"
   for file in testsuite-tools/* ; do
     # Keep the script file name
     this_script=`basename $file`
@@ -441,14 +562,14 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target_boot "${this_script}" "$PREV"
+    BOOT_wrt_target "${this_script}" "$PREV"
     #
-    wrt_unpack3 "$pkg_tarball"
+    BOOT_wrt_Unpack "$pkg_tarball"
     [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
-    wrt_run_as_root2 "${this_script}" "${file}"
+    BOOT_wrt_RunAsRoot "${this_script}" "${file}"
     #
-    wrt_remove_build_dirs2 "${name}"
+    BOOT_wrt_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -461,12 +582,13 @@
     PREV=$this_script
 
   done
+
 }
 
 
-#-----------------------------#
-final_system_Makefiles() {    #
-#-----------------------------#
+#--------------------------------------#
+chroot_final_system_Makefiles() {      #
+#--------------------------------------#
   # Set envars and scripts for iteration targets
   LOGS="" # Start with an empty global LOGS envar
   if [[ -z "$1" ]] ; then
@@ -488,7 +610,7 @@
     sed -e 's at make install@&\nrm -v /lib/lib{history,readline}*old@' -i final-system$N/*-readline
   fi
 
-  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) final system$N${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) final system$N ( CHROOT ) ${R_arrow}"
 
   for file in final-system$N/* ; do
     # Keep the script file name
@@ -535,27 +657,27 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}${N}" "$PREV"
+    CHROOT_wrt_target "${this_script}${N}" "$PREV"
 
     # If $pkg_tarball isn't empty, we've got a package...
     if [ "$pkg_tarball" != "" ] ; then
-      wrt_unpack2 "$pkg_tarball"
+      CHROOT_Unpack "$pkg_tarball"
       # If the testsuites must be run, initialize the log file
       case $name in
         binutils | gcc | glibc )
-          [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
+          [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
           ;;
         * )
-          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}"
+          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}"
           ;;
       esac
       # If using optimizations, write the instructions
       [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
     #
-    wrt_run_as_chroot1 "${this_script}" "${file}"
+    CHROOT_wrt_RunAsRoot  "${file}"
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -571,10 +693,9 @@
   done  # for file in final-system/* ...
 }
 
-
-#-----------------------------#
-bm_final_system_Makefiles() { #
-#-----------------------------#
+#--------------------------------------#
+boot_final_system_Makefiles() {        #
+#--------------------------------------#
   # Set envars and scripts for iteration targets
   LOGS="" # Start with an empty global LOGS envar
   if [[ -z "$1" ]] ; then
@@ -598,7 +719,7 @@
     sed -e 's at make install@&\nrm -v /lib/lib{history,readline}*old@' -i final-system$N/*-readline
   fi
 
-  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) final system$N${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) final system$N  ( ROOT ) ${R_arrow}"
 
   for file in final-system$N/* ; do
     # Keep the script file name
@@ -646,28 +767,28 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target_boot "${this_script}${N}" "$PREV"
+    BOOT_wrt_target "${this_script}${N}" "$PREV"
 
     # If $pkg_tarball isn't empty, we've got a package...
     if [ "$pkg_tarball" != "" ] ; then
       FILE="$pkg_tarball"
-      wrt_unpack3 "$FILE"
+      BOOT_wrt_Unpack "$FILE"
       # If the testsuites must be run, initialize the log file
       case $name in
         binutils | gcc | glibc )
-          [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
+          [[ "$TEST" != "0" ]] && BOOT_wrt_test_log "${this_script}"
           ;;
         * )
-          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}"
+          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && BOOT_wrt_test_log "${this_script}"
           ;;
       esac
       # If using optimizations, write the instructions
       [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
     #
-    wrt_run_as_root2 "${this_script}" "${file}"
+    BOOT_wrt_RunAsRoot "${this_script}" "${file}"
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
+    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -681,14 +802,14 @@
     # Set system_build envar for iteration targets
     system_build=$basicsystem
   done  # for file in final-system/* ...
+
 }
 
+#--------------------------------------#
+chroot_bootscripts_Makefiles() {       #
+#--------------------------------------#
+  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) bootscripts   ( CHROOT ) ${R_arrow}"
 
-#-----------------------------#
-bootscripts_Makefiles() {     #
-#-----------------------------#
-    echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) bootscripts${R_arrow}"
-
   for file in bootscripts/* ; do
     # Keep the script file name
     this_script=`basename $file`
@@ -722,15 +843,15 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    CHROOT_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
     #
-    wrt_run_as_chroot1 "${this_script}" "${file}"
+    CHROOT_wrt_RunAsRoot "${file}"
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -743,13 +864,12 @@
     PREV=$this_script
 
   done  # for file in bootscripts/* ...
-
 }
 
-#-----------------------------#
-bm_bootscripts_Makefiles() {  #
-#-----------------------------#
-    echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) bootscripts${R_arrow}"
+#--------------------------------------#
+boot_bootscripts_Makefiles() {         #
+#--------------------------------------#
+  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) bootscripts     ( ROOT ) ${R_arrow}"
 
   for file in bootscripts/* ; do
     # Keep the script file name
@@ -784,15 +904,15 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target_boot "${this_script}" "$PREV"
+    BOOT_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_Unpack "$pkg_tarball"
     #
-    wrt_run_as_root2 "${this_script}" "${file}"
+    BOOT_wrt_RunAsRoot "${this_script}" "${file}"
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
+    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -805,16 +925,13 @@
     PREV=$this_script
 
   done  # for file in bootscripts/* ...
-
 }
 
+#--------------------------------------#
+chroot_bootable_Makefiles() {          #
+#--------------------------------------#
+  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) make bootable ( CHROOT ) ${R_arrow}"
 
-
-#-----------------------------#
-bootable_Makefiles() {        #
-#-----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}(chroot) make bootable${R_arrow}"
-
   for file in {bootable,the-end}/* ; do
     # Keep the script file name
     this_script=`basename $file`
@@ -822,6 +939,7 @@
     # A little housekeeping on the scripts
     case $this_script in
       *grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* )  continue ;;
+      *fstab)  [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
       *kernel) # if there is no kernel config file do not build the kernel
                [[ -z $CONFIG ]] && continue
                  # Copy the config file to /sources with a standardized name
@@ -848,26 +966,27 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    CHROOT_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
     #
     # Select a script execution method
     case $this_script in
-      *fstab*)  if [[ -n "$FSTAB" ]]; then
-                  wrt_copy_fstab "${this_script}"
-                else
-                  wrt_run_as_chroot1  "${this_script}" "${file}"
-                fi
-          ;;
-      *)  wrt_run_as_chroot1  "${this_script}" "${file}"   ;;
+      *fstab*)   if [[ -n "$FSTAB" ]]; then
+                   CHROOT_wrt_CopyFstab
+                 else
+                   CHROOT_wrt_RunAsRoot  "${file}"
+                 fi
+        ;;
+      *)  CHROOT_wrt_RunAsRoot  "${file}"
+        ;;
     esac
     #
     # Housekeeping...remove any build directory(ies) except if the package build fails.
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -881,18 +1000,13 @@
 
   done
 
-  # Add SBU-disk_usage report target if required
-  if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
-
 }
 
+#--------------------------------------#
+boot_bootable_Makefiles() {            #
+#--------------------------------------#
+  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) make bootable   ( ROOT ) ${R_arrow}"
 
-
-#-----------------------------#
-bm_bootable_Makefiles() {     #
-#-----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}(boot) make bootable${R_arrow}"
-
   for file in {bootable,the-end}/* ; do
     # Keep the script file name
     this_script=`basename $file`
@@ -925,28 +1039,28 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target_boot "${this_script}" "$PREV"
+    BOOT_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_Unpack "$pkg_tarball"
     #
     # Select a script execution method
     case $this_script in
       *fstab*)  if [[ -n "$FSTAB" ]]; then
                   # Minimal boot mode has no access to original file, store in /sources
                   cp $FSTAB $BUILDDIR/sources/fstab
-                  wrt_copy_fstab2 "${this_script}"
+                  BOOT_wrt_CopyFstab "${this_script}"
                 else
-                  wrt_run_as_root2  "${this_script}" "${file}"
+                  BOOT_wrt_RunAsRoot  "${this_script}" "${file}"
                 fi
           ;;
-      *)  wrt_run_as_root2  "${this_script}" "${file}"   ;;
+      *)  BOOT_wrt_RunAsRoot  "${this_script}" "${file}"   ;;
     esac
     #
     # Housekeeping...remove any build directory(ies) except if the package build fails.
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
+    [[ "$pkg_tarball" != "" ]] && BOOT_wrt_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -957,51 +1071,51 @@
     #
     # Keep the script file name for Makefile dependencies.
     PREV=$this_script
-
   done
 
-  # Add SBU-disk_usage report target if required
-  if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
-
 }
 
 
-#-----------------------------#
-build_Makefile() {            # Construct a Makefile from the book scripts
-#-----------------------------#
-  echo "Creating Makefile... ${BOLD}START${OFF}"
+#--------------------------------------#
+build_Makefile() {                     # Construct a Makefile from the book scripts
+#--------------------------------------#
+  #
+  # Script crashes if error trapping is on
+  #
+set +e
+  declare -f  method_cmds
+  declare -f  testsuite_cmds
+  declare -f  final_sys_cmds
+  declare -f  bootscripts_cmds
+  declare -f  bootable_cmds
+set -e
 
+  echo "...Creating Makefile... ${BOLD}START${OFF}"
+
   cd $JHALFSDIR/${PROGNAME}-commands
-  # Start with a clean Makefile.tmp file
+  # Start with a clean files
+  >$MKFILE
   >$MKFILE.tmp
 
-  host_prep_Makefiles
-  cross_tools_Makefiles            # $cross_tools
-  temptools_Makefiles              # $temptools
-  if [[ $METHOD = "chroot" ]]; then
-    chroot_Makefiles               # $chroottools
-    if [[ ! $TEST = "0" ]]; then
-      testsuite_tools_Makefiles    # $testsuitetools
-    fi
-    final_system_Makefiles         # $basicsystem
+       method_cmds=${METHOD}_Makefiles
+    testsuite_cmds=${METHOD}_testsuite_tools_Makefiles
+    final_sys_cmds=${METHOD}_final_system_Makefiles
+  bootscripts_cmds=${METHOD}_bootscripts_Makefiles
+     bootable_cmds=${METHOD}_bootable_Makefiles
+
+  host_prep_Makefiles        # mk_SETUP      (SETUP)  $host_prep
+  cross_tools_Makefiles      # mk_CROSS      (LUSER)  $cross_tools
+  temptools_Makefiles        # mk_TEMP       (LUSER)  $temptools
+  $method_cmds               # mk_SYSTOOLS   (CHROOT) $chroottools/$boottools
+  if [[ ! $TEST = "0" ]]; then
+    $testsuite_cmds          # mk_SYSTOOLS   (CHROOT) $testsuitetools
+  fi
+  $final_sys_cmds            # mk_FINAL      (CHROOT) $basicsystem
     # Add the iterations targets, if needed
-    [[ "$COMPARE" = "y" ]] && wrt_compare_targets
-    bootscripts_Makefiles          # $bootscripttools
-    bootable_Makefiles             # $bootabletools
-  else
-    boot_Makefiles                 # $boottools
-    if [[ ! $TEST = "0" ]]; then
-      bm_testsuite_tools_Makefiles # $testsuitetools
-    fi
-    bm_final_system_Makefiles      # $basicsystem
-    # Add the iterations targets, if needed
-    [[ "$COMPARE" = "y" ]] && wrt_compare_targets
-    bm_bootscripts_Makefiles       # $bootscipttools
-    bm_bootable_Makefiles          # $bootabletoosl
-  fi
-#  the_end_Makefiles
+  [[ "$COMPARE" = "y" ]] && wrt_compare_targets
+  $bootscripts_cmds          # mk_BOOTSCRIPT (CHROOT) $bootscripttools
+  $bootable_cmds             # mk_BOOTABLE   (CHROOT) $bootabletools
 
-
   # Add a header, some variables and include the function file
   # to the top of the real Makefile.
 (
@@ -1029,8 +1143,9 @@
 SU_LUSER     = su - \$(LUSER) -c
 LUSER_HOME   = /home/\$(LUSER)
 PRT_DU       = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
-PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n"
+PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n"
 
+export PATH := \${PATH}:/usr/sbin
 
 include makefile-functions
 
@@ -1056,83 +1171,75 @@
     echo -e "CHROOT1= $chroot\n" >> $MKFILE
   fi
 
-  # Drop in the main target 'all:' and the chapter targets with each sub-target
-  # as a dependency.
+################## CHROOT ####################
+
 if [[ "${METHOD}" = "chroot" ]]; then
 (
-	cat << EOF
-all:  chapter2 chapter3 chapter4 chapter5 chapter6 chapter7 chapter8 do-housekeeping
+cat << EOF
+
+all: ck_UID mk_SETUP mk_CROSS mk_SUDO mk_SYSTOOLS create-sbu_du-report
+	@sudo make do-housekeeping
 	@\$(call echo_finished,$VERSION)
 
-chapter2:  023-creatingtoolsdir 024-creatingcrossdir 025-addinguser 026-settingenvironment
+ck_UID:
+	@if [ \`id -u\` = "0" ]; then \\
+	  echo "+--------------------------------------------------+"; \\
+	  echo "|You cannot run this makefile from the root account|"; \\
+	  echo "+--------------------------------------------------+"; \\
+	  exit 1; \\
+	fi
 
-chapter3:  chapter2 $cross_tools
+#---------------AS ROOT
+mk_SETUP:
+	@\$(call echo_SU_request)
+	@sudo make SETUP
+	@touch \$@
 
-chapter4:  chapter3 $temptools
+#---------------AS LUSER
+mk_CROSS: mk_SETUP
+	@\$(call echo_PHASE,Cross and Temporary Tools)
+	@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make AS_LUSER" )
+	@sudo make restore-luser-env
+	@touch \$@
 
-chapter5:  chapter4 $chroottools restore-luser-env $testsuitetools
+mk_SUDO: mk_CROSS
+	@sudo make SUDO
+	@touch \$@
+#
+# The convoluted piece of code below is necessary to provide 'make' with a valid shell in the
+# chroot environment. (Unless someone knows a different way)
+# Manually create the /bin directory and provide link to the /tools dir.
+# Also change the original symlink creation to include (f)orce to prevent failure due to
+#  pre-existing links.
 
-chapter6:  chapter5 $basicsystem
-
-chapter7:  chapter6 $bootscripttools
-
-chapter8:  chapter7 $bootabletools
-
-clean-all:  clean
-	rm -rf ./{clfs-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
-
-clean:  clean-chapter4 clean-chapter3 clean-chapter2
-
-restart:
-	@echo "This feature does not exist for the CLFS makefile. (yet)"
-
-clean-chapter2:
-	-if [ ! -f luser-exist ]; then \\
-		userdel \$(LUSER); \\
-		rm -rf /home/\$(LUSER); \\
+#---------------CHROOT JAIL
+mk_SYSTOOLS: mk_SUDO
+	@if [ ! -e \$(MOUNT_PT)/bin ]; then \\
+	  mkdir \$(MOUNT_PT)/bin; \\
+	  cd \$(MOUNT_PT)/bin && \\
+	  ln -svf /tools/bin/bash bash; ln -sf bash sh; \\
+	  sudo chown -R 0:0 \$(MOUNT_PT)/bin; \\
 	fi;
-	rm -rf \$(MOUNT_PT)/tools
-	rm -f /tools
-	rm -rf \$(MOUNT_PT)/cross-tools
-	rm -f /cross-tools
-	rm -f envars luser-exist
-	rm -f 02* logs/02*.log
+	@sudo sed -e 's|^ln -sv |ln -svf |' -i \$(CMDSDIR)/chroot/082-createfiles
+	@\$(call echo_CHROOT_request)
+	@\$(call echo_PHASE, CHROOT JAIL )
+	@( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT_JAIL")
+	@touch \$@
 
-clean-chapter3:
-	rm -rf \$(MOUNT_PT)/tools/*
-	rm -f $cross_tools sources-dir
-	cd logs && rm -f $cross_tools && cd ..
 
-clean-chapter4:
-	-umount \$(MOUNT_PT)/sys
-	-umount \$(MOUNT_PT)/proc
-	-umount \$(MOUNT_PT)/dev/shm
-	-umount \$(MOUNT_PT)/dev/pts
-	-umount \$(MOUNT_PT)/dev
-	rm -rf \$(MOUNT_PT)/{bin,boot,dev,etc,home,lib,lib64,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}
-	rm -f $temptools
-	cd logs && rm -f $temptools && cd ..
 
+SETUP:       $host_prep
+AS_LUSER:    $cross_tools $temptools
+SUDO:	     $orphan_scripts
+CHROOT_JAIL: ${chroottools}${boottools} $testsuitetools $basicsystem  $bootscripttools  $bootabletools
 
-restore-luser-env:
-	@\$(call echo_message, Building)
-	@if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
-		mv -f /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
-	fi;
-	@if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
-		mv /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
-	fi;
-	@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
-	touch \$@ && \\
-	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
-	echo --------------------------------------------------------------------------------\$(WHITE)
-
 do-housekeeping:
 	@-umount \$(MOUNT_PT)/dev/pts
 	@-umount \$(MOUNT_PT)/dev/shm
 	@-umount \$(MOUNT_PT)/dev
 	@-umount \$(MOUNT_PT)/sys
 	@-umount \$(MOUNT_PT)/proc
+	@-rm /tools /cross-tools
 	@-if [ ! -f luser-exist ]; then \\
 		userdel \$(LUSER); \\
 		rm -rf /home/\$(LUSER); \\
@@ -1140,87 +1247,120 @@
 
 EOF
 ) >> $MKFILE
+
+  # Add SBU-disk_usage report target
+  echo "create-sbu_du-report:" >> $MKFILE
+  if [[ "$REPORT" = "y" ]] ; then
+(
+    cat << EOF
+	@\$(call echo_message, Building)
+	@./create-sbu_du-report.sh logs $VERSION
+	@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
+	@touch  \$@
+
+EOF
+) >> $MKFILE
+  else echo -e "\t at true\n" >> $MKFILE; fi
+
 fi
 
+################### BOOT #####################
 
 if [[ "${METHOD}" = "boot" ]]; then
 (
-	cat << EOF
+cat << EOF
 
-all:	makeboot
-
-makeboot: 023-creatingtoolsdir 024-creatingcrossdir 025-addinguser 026-settingenvironment \
-	$cross_tools\
-	$temptools \
-	$chroottools \
-	$boottools restore-luser-env
+all:	ck_UID mk_SETUP mk_CROSS mk_SUDO
+	@sudo make restore-luser-env
+	@sudo make do-housekeeping
 	@\$(call echo_boot_finished,$VERSION)
 
-makesys:  $testsuitetools $basicsystem $bootscripttools $bootabletools
+makesys: mk_FINAL
 	@\$(call echo_finished,$VERSION)
 
 
-clean-all:  clean
-	rm -rf ./{clfs-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
+ck_UID:
+	@if [ \`id -u\` = "0" ]; then \\
+	  echo "+--------------------------------------------------+"; \\
+	  echo "|You cannot run this makefile from the root account|"; \\
+	  echo "|However, if this is the boot environment          |"; \\
+	  echo "| the command you are looking for is               |"; \\
+	  echo "|   make makesys                                   |"; \\
+	  echo "| to finish off the build                          |"; \\
+	  echo "+--------------------------------------------------+"; \\
+	  exit 1; \\
+	fi
 
-clean:  clean-makesys clean-makeboot clean-jhalfs
+#---------------AS ROOT
 
-restart:
-	@echo "This feature does not exist for the CLFS makefile. (yet)"
+mk_SETUP:
+	@\$(call echo_SU_request)
+	@sudo make SETUP
+	@touch \$@
 
-clean-jhalfs:
-	-if [ ! -f luser-exist ]; then \\
+#---------------AS LUSER
+
+mk_CROSS: mk_SETUP
+	@\$(call echo_PHASE,Cross Tool)
+	@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make AS_LUSER" )
+	@touch \$@
+
+mk_SUDO: mk_SYSTOOLS
+	@sudo make SUDO
+	@touch \$@
+
+#---------------AS ROOT
+
+mk_FINAL:
+	@\$(call echo_PHASE,Final System)
+	@( make AS_ROOT )
+	@touch \$@
+
+SETUP:      $host_prep
+AS_LUSER:   $cross_tools $temptools ${chroottools}${boottools}
+SUDO:	    $orphan_scripts
+AS_ROOT:    $testsuitetools $basicsystem $bootscripttools $bootabletools
+
+do-housekeeping:
+	@-rm /tools /cross-tools
+	@-if [ ! -f luser-exist ]; then \\
 		userdel \$(LUSER); \\
 		rm -rf /home/\$(LUSER); \\
 	fi;
-	rm -rf \$(MOUNT_PT)/tools
-	rm -f /tools
-	rm -rf \$(MOUNT_PT)/cross-tools
-	rm -f /cross-tools
-	rm -f envars luser-exist
-	rm -f 02* logs/02*.log
 
-clean-makeboot:
-	rm -rf /tools/*
-	rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools
-	rm -f restore-luser-env sources-dir
-	cd logs && rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools && cd ..
+EOF
+) >> $MKFILE
+fi
 
-clean-makesys:
-	-umount \$(MOUNT_PT)/sys
-	-umount \$(MOUNT_PT)/proc
-	-umount \$(MOUNT_PT)/dev/shm
-	-umount \$(MOUNT_PT)/dev/pts
-	-umount \$(MOUNT_PT)/dev
-	rm -rf \$(MOUNT_PT)/{bin,boot,dev,etc,home,lib,lib64,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}
-	rm -f $basicsystem
-	rm -f $bootscripttools
-	rm -f $bootabletools
-	cd logs && rm -f $basicsystem && rm -f $bootscripttools && rm -f $bootabletools && cd ..
+(
+ cat << EOF
 
 
+restart:
+	@echo "This feature does not exist for the CLFS makefile. (yet)"
+
 restore-luser-env:
 	@\$(call echo_message, Building)
 	@if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
-		mv -fv /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
+		mv -f /home/\$(LUSER)/.bashrc.XXX /home/\$(LUSER)/.bashrc; \\
 	fi;
 	@if [ -f /home/\$(LUSER)/.bash_profile.XXX ]; then \\
-		mv -v /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
+		mv /home/\$(LUSER)/.bash_profile.XXX /home/\$(LUSER)/.bash_profile; \\
 	fi;
 	@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bash* && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
 
+########################################################
 
+
 EOF
 ) >> $MKFILE
-fi
 
   # Bring over the items from the Makefile.tmp
   cat $MKFILE.tmp >> $MKFILE
   rm $MKFILE.tmp
+
   echo "Creating Makefile... ${BOLD}DONE${OFF}"
-
 }
-

Modified: jhalfs/trunk/CLFS2/master.sh
===================================================================
--- jhalfs/trunk/CLFS2/master.sh	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/CLFS2/master.sh	2006-10-02 19:32:06 UTC (rev 3146)
@@ -11,7 +11,7 @@
 #----------------------------#
   local   CLFS_HOST
 
-  echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files ( SETUP ) ${R_arrow}"
 
   # defined here, only for ease of reading
   CLFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
@@ -35,7 +35,7 @@
 	else \\
 		touch luser-exist; \\
 	fi;
-	@chown \$(LUSER) \$(MOUNT_PT) && \\
+	@chown -R \$(LUSER) \$(MOUNT_PT) && \\
 	chown \$(LUSER) \$(MOUNT_PT)/sources
 	@touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
@@ -64,7 +64,9 @@
 	echo "export CLFS_TARGET32=\"${TARGET32}\"" >> /home/\$(LUSER)/.bashrc && \\
 	echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc
 	@chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
-	touch envars
+	touch envars && \\
+	chown \$(LUSER):\$(LGROUP) envars && \\
+	chmod -R a+wt \$(MOUNT_PT)
 	@touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
@@ -122,13 +124,15 @@
 
 EOF
 ) >> $MKFILE.tmp
+
+  host_prep=" 023-creatingtoolsdir 025-addinguser 026-settingenvironment 027-create-directories 028-creating-sysfile"
 }
 
 
 #-----------------------------#
 cross_tools_Makefiles() {     #
 #-----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}cross tools     ( LUSER ) ${R_arrow}"
 
   for file in cross-tools/* ; do
     # Keep the script file name
@@ -175,18 +179,18 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    LUSER_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
     if [ "$pkg_tarball" != "" ] ; then
-       wrt_unpack "$pkg_tarball"
+       LUSER_wrt_unpack "$pkg_tarball"
        # If using optimizations, write the instructions
        [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
     #
-    wrt_RunAsUser "${this_script}" "${file}"
+    LUSER_wrt_RunAsUser "${file}"
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -206,7 +210,7 @@
 #-----------------------------#
 final_system_Makefiles() {    #
 #-----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}final system${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}final system    ( LUSER ) ${R_arrow}"
 
   for file in final-system/* ; do
     # Keep the script file name
@@ -240,18 +244,18 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    LUSER_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
     if [ "$pkg_tarball" != "" ] ; then
-      wrt_unpack "$pkg_tarball"
+      LUSER_wrt_unpack "$pkg_tarball"
       # If using optimizations, write the instructions
       [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
     #
-    wrt_RunAsUser "${this_script}" "${file}"
+    LUSER_wrt_RunAsUser "${file}"
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -270,7 +274,7 @@
 #-----------------------------#
 bootscripts_Makefiles() {     #
 #-----------------------------#
-    echo "${tab_}${GREEN}Processing... ${L_arrow}bootscripts${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}bootscripts     ( LUSER ) ${R_arrow}"
 
   for file in bootscripts/* ; do
     # Keep the script file name
@@ -306,14 +310,14 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    LUSER_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
-    [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
     #
-    wrt_RunAsUser "${this_script}" "${file}"
+    LUSER_wrt_RunAsUser "${file}"
     #
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -333,7 +337,7 @@
 #-----------------------------#
 bootable_Makefiles() {        #
 #-----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}make bootable${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}make bootable   ( LUSER ) ${R_arrow}"
 
   for file in bootable/* ; do
     # Keep the script file name
@@ -342,6 +346,7 @@
     # A little housekeeping on the scripts
     case $this_script in
       *grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* )  continue ;;
+      *fstab)  [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
       *kernel) # if there is no kernel config file do not build the kernel
                [[ -z $CONFIG ]] && continue
                  # Copy the config file to /sources with a standardized name
@@ -351,7 +356,12 @@
     #
     # First append each name of the script files to a list (this will become
     # the names of the targets in the Makefile
-    bootable="$bootable $this_script"
+    # NOTE: new makfile format forces the last script, *chowning, into a separate
+    #  phase.
+    case ${this_script} in
+      *chowning) chowning=${this_script}   ;;
+              *) bootable="$bootable $this_script"  ;;
+    esac
     #
     # Grab the name of the target, strip id number and misc words.
     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's at -build@@' `
@@ -368,27 +378,27 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    LUSER_wrt_target "${this_script}" "$PREV"
     #
     # If $pkg_tarball isn't empty, we've got a package...
-    [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
     #
     # Select a script execution method
     case $this_script in
       *fstab*)  if [[ -n "$FSTAB" ]]; then
-                  wrt_copy_fstab "${this_script}"
+                  LUSER_wrt_CopyFstab
                 else
-                  wrt_RunAsUser "${this_script}" "${file}"
+                  LUSER_wrt_RunAsUser "${file}"
                 fi
           ;;
       *chowning)  wrt_RunAsRoot "${this_script}" "${file}"
           ;;
-              *)  wrt_RunAsUser "${this_script}" "${file}"
+              *)  LUSER_wrt_RunAsUser "${file}"
           ;;
     esac
     #
     # Housekeeping...remove any build directory(ies) except if the package build fails.
-    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -402,9 +412,6 @@
 
   done
 
-  # Add SBU-disk_usage report target if required
-  if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
-
 }
 
 
@@ -446,6 +453,8 @@
 PRT_DU     = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
 LUSER_HOME = /home/\$(LUSER)
 
+export PATH := \${PATH}:/usr/sbin
+
 include makefile-functions
 
 EOF
@@ -454,27 +463,44 @@
   # Drop in the main target 'all:' and the chapter targets with each sub-target
   # as a dependency.
 (
-	cat << EOF
-all:  chapter2 chapter3 chapter4 chapter5 chapter6 restore-luser-env do-housekeeping
+cat << EOF
+
+all:	ck_UID mk_SETUP mk_LUSER mk_ROOT create-sbu_du-report
+	@sudo make do-housekeeping
 	@\$(call echo_finished,$VERSION)
 
-chapter2:  023-creatingtoolsdir 025-addinguser 026-settingenvironment 027-create-directories 028-creating-sysfile
+ck_UID:
+	@if [ \`id -u\` = "0" ]; then \\
+	  echo "--------------------------------------------------"; \\
+	  echo "You cannot run this makefile from the root account"; \\
+	  echo "--------------------------------------------------"; \\
+	  exit 1; \\
+	fi
 
-chapter3:  chapter2 $cross_tools
+mk_SETUP:
+	@\$(call echo_SU_request)
+	@sudo make SETUP
+	@touch \$@
 
-chapter4:  chapter3 $basicsystem
+mk_LUSER: mk_SETUP
+	@\$(call echo_SULUSER_request)
+	@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make LUSER" )
+	@sudo make restore-luser-env
+	@touch \$@
 
-chapter5:  chapter4 $bootscripttools
+mk_ROOT:
+	@sudo make ROOT
+	@touch \$@
 
-chapter6:  chapter5 $bootable
+SETUP:  $host_prep
 
-clean-all:  clean
-	rm -rf ./{clfs2-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
+LUSER:	$cross_tools $basicsystem $bootscripttools $bootable
 
-clean:
+ROOT:	$chowning
 
+
 restart:
-	@echo "This feature does not exist for the CLFS makefile. (yet)"
+	@echo "This feature does not exist for the CLFS-2 makefile. (yet)"
 
 restore-luser-env:
 	@\$(call echo_message, Building)
@@ -498,6 +524,21 @@
 EOF
 ) >> $MKFILE
 
+  # Add SBU-disk_usage report target
+  echo "create-sbu_du-report:" >> $MKFILE
+  if [[ "$REPORT" = "y" ]] ; then
+(
+    cat << EOF
+	@\$(call echo_message, Building)
+	@./create-sbu_du-report.sh logs $VERSION
+	@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
+	@touch  \$@
+
+
+EOF
+) >> $MKFILE
+  else echo -e "\t at true\n\n" >> $MKFILE; fi
+
   # Bring over the items from the Makefile.tmp
   cat $MKFILE.tmp >> $MKFILE
   rm $MKFILE.tmp

Modified: jhalfs/trunk/Config.in
===================================================================
--- jhalfs/trunk/Config.in	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/Config.in	2006-10-02 19:32:06 UTC (rev 3146)
@@ -325,6 +325,19 @@
 		bool	"libxslt (required)"
 		default	y
 
+		config	DEP_TIDY
+		bool	"tidy (required)"
+		default	y
+
+		config	DEP_DBXML
+		bool	"DocBook XML DTD (required)"
+		default	y
+
+		config	DEP_UNZIP
+		bool	"UnZip (required to install DocBook XML DTD)"
+		default	y
+		depends on DEP_DBXML
+
 		config	DEP_DBXSL
 		bool	"DocBook XSL (required)"
 		default	y
@@ -707,6 +720,7 @@
 	#--- End ICA/farce
 
 	#--- Optimizations
+if !BOOK_CLFS2
 	config	CONFIG_OPTIMIZE
 		bool	"Use optimization (see help)"
 		default	n
@@ -740,6 +754,7 @@
 		default	"0"	if !CONFIG_OPTIMIZE
 		default	"1"	if OPT_1
 		default	"2"	if OPT_2
+endif
 	#--- End Optimizations
 
 	#-- Internal Settings

Modified: jhalfs/trunk/HLFS/master.sh
===================================================================
--- jhalfs/trunk/HLFS/master.sh	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/HLFS/master.sh	2006-10-02 19:32:06 UTC (rev 3146)
@@ -7,73 +7,80 @@
 ###          FUNCTIONS          ###
 ###################################
 
+
 #----------------------------#
 process_toolchain() {        # embryo,cocoon and butterfly need special handling
 #----------------------------#
   local toolchain=$1
-  local this_script=$2
-  local  tc_phase
+  local this_file=$2
+  local tc_phase
   local binutil_tarball
   local gcc_core_tarball
-  
-  echo "${tab_}${tab_}${GREEN}toolchain ${L_arrow}${toolchain}${R_arrow}"
+  local TC_MountPT
+  local remove_existing
 
+  tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's at -toolchain@@'`
+  case $tc_phase in
+    embryo | \
+    cocoon)    # Vars for LUSER phase
+       remove_existing="remove_existing_dirs"
+            TC_MountPT="\$(MOUNT_PT)\$(SRC)"
+       ;;
+    butterfly) # Vars for CHROOT phase
+       remove_existing="remove_existing_dirs2"
+            TC_MountPT="\$(SRC)"
+       ;;
+  esac
+
   #
   # Safe method to remove existing toolchain dirs
   binutil_tarball=$(get_package_tarball_name "binutils")
   gcc_core_tarball=$(get_package_tarball_name "gcc-core")
 (
 cat << EOF
-	@\$(call remove_existing_dirs,$binutil_tarball)
-	@\$(call remove_existing_dirs,$gcc_core_tarball)
+	@\$(call ${remove_existing},$binutil_tarball)
+	@\$(call ${remove_existing},$gcc_core_tarball)
 EOF
 ) >> $MKFILE.tmp
 
   #
   # Manually remove the toolchain directories..
-  tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's at -toolchain@@'`
 (
 cat << EOF
-	@rm -rf \$(MOUNT_PT)\$(SRC)/${tc_phase}-toolchain && \\
-	rm  -rf \$(MOUNT_PT)\$(SRC)/${tc_phase}-build
+	@rm -rf ${TC_MountPT}/${tc_phase}-toolchain && \\
+	rm  -rf ${TC_MountPT}/${tc_phase}-build
 EOF
 ) >> $MKFILE.tmp
 
-  case ${toolchain} in
-    *butterfly*)
+
 (
 cat << EOF
-	@echo "export PKGDIR=\$(SRC)" > envars
+	@echo "export PKGDIR=${TC_MountPT}" > envars
 EOF
 ) >> $MKFILE.tmp
-      [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
-      wrt_run_as_chroot1 "$toolchain" "$this_script"
-      ;;
 
-    *)
-(
-cat << EOF
-	@echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)" > envars
-EOF
-) >> $MKFILE.tmp
-      wrt_RunAsUser "$toolchain" "$this_script"
+  case ${tc_phase} in
+    butterfly)
+        [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${toolchain}"
+        CHROOT_wrt_RunAsRoot "$this_file"
       ;;
+    *)  LUSER_wrt_RunAsUser  "$this_file"
+      ;;
   esac
   #
 (
 cat << EOF
-	@\$(call remove_existing_dirs,$binutil_tarball)
-	@\$(call remove_existing_dirs,$gcc_core_tarball)
+	@\$(call ${remove_existing},$binutil_tarball)
+	@\$(call ${remove_existing},$gcc_core_tarball)
 EOF
 ) >> $MKFILE.tmp
 
   #
   # Manually remove the toolchain directories..
-  tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's at -toolchain@@'`
 (
 cat << EOF
-	@rm -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-toolchain && \\
-	rm  -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-build
+	@rm -rf ${TC_MountPT}/${tc_phase}-toolchain && \\
+	rm  -rf ${TC_MountPT}/${tc_phase}-build
 EOF
 ) >> $MKFILE.tmp
 
@@ -84,13 +91,13 @@
 chapter3_Makefiles() {       # Initialization of the system
 #----------------------------#
 
-  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter3${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter3     ( SETUP ) ${R_arrow}"
 
   # Define a few model dependant variables
   if [[ ${MODEL} = "uclibc" ]]; then
     TARGET="pc-linux-gnu"; LOADER="ld-uClibc.so.0"
   else
-    TARGET="pc-linux-gnu";    LOADER="ld-linux.so.2"
+    TARGET="pc-linux-gnu"; LOADER="ld-linux.so.2"
   fi
 
   # If /home/$LUSER is already present in the host, we asume that the
@@ -120,6 +127,7 @@
 		touch luser-exist; \\
 	fi;
 	@chown \$(LUSER) \$(MOUNT_PT)/tools && \\
+	chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
 	chown \$(LUSER) \$(MOUNT_PT)/sources && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
@@ -145,13 +153,15 @@
 	echo "export target ldso" >> /home/\$(LUSER)/.bashrc && \\
 	echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc && \\
 	chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
+	chmod -R a+wt \$(MOUNT_PT) && \\
 	touch envars && \\
+	chown \$(LUSER) envars && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
 EOF
 ) >> $MKFILE.tmp
-
+  chapter3=" 020-creatingtoolsdir 021-addinguser 022-settingenvironment"
 }
 
 #----------------------------#
@@ -160,7 +170,7 @@
   local file
   local this_script
 
-  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5     ( LUSER ) ${R_arrow}"
 
   for file in chapter05/* ; do
     # Keep the script file name
@@ -205,32 +215,32 @@
     # NO Optimization allowed
     if [[ ${name} = "embryo-toolchain" ]] || \
        [[ ${name} = "cocoon-toolchain" ]]; then
-       wrt_target "$this_script" "$PREV"
+       LUSER_wrt_target "$this_script" "$PREV"
          process_toolchain "${this_script}" "${file}"
        wrt_touch
        PREV=$this_script
        continue
     fi
     #
-    wrt_target "$this_script" "$PREV"
+    LUSER_wrt_target "$this_script" "$PREV"
     # Find the version of the command files, if it corresponds with the building of
     # a specific package
     pkg_tarball=$(get_package_tarball_name $name)
     # If $pkg_tarball isn't empty, we've got a package...
     if [ "$pkg_tarball" != "" ] ; then
       # Insert instructions for unpacking the package and to set the PKGDIR variable.
-      wrt_unpack "$pkg_tarball"
+      LUSER_wrt_unpack "$pkg_tarball"
       # If using optimizations, write the instructions
       [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
     # Insert date and disk usage at the top of the log file, the script run
     # and date and disk usage again at the bottom of the log file.
-    wrt_RunAsUser "$this_script" "${file}"
+    LUSER_wrt_RunAsUser "${file}"
 
     # Remove the build directory(ies) except if the package build fails
     # (so we can review config.cache, config.log, etc.)
     if [ "$pkg_tarball" != "" ] ; then
-       wrt_remove_build_dirs "$name"
+      LUSER_RemoveBuildDirs "$name"
     fi
 
     # Include a touch of the target name so make can check if it's already been made.
@@ -275,7 +285,7 @@
     sed -e '/groupadd/d' -i chapter06$N/*-udev
   fi
 
-  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N     ( CHROOT ) ${R_arrow}"
 
   for file in chapter06$N/* ; do
     # Keep the script file name
@@ -324,25 +334,25 @@
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
     if [[ ${name} = "butterfly-toolchain" ]]; then
-       wrt_target "${this_script}${N}" "$PREV"
+       CHROOT_wrt_target "${this_script}${N}" "$PREV"
          process_toolchain "${this_script}" "${file}"
        wrt_touch
        PREV=$this_script
        continue
     fi
 
-    wrt_target "${this_script}${N}" "$PREV"
+    CHROOT_wrt_target "${this_script}${N}" "$PREV"
 
     # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     if [ "$pkg_tarball" != "" ] ; then
-      wrt_unpack2 "$pkg_tarball"
+      CHROOT_Unpack "$pkg_tarball"
       # If the testsuites must be run, initialize the log file
       # butterfly-toolchain tests are enabled in 'process_tookchain' function
       case $name in
-        glibc ) [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
+        glibc ) [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
           ;;
-	    * ) [[ "$TEST" > "1" ]] && wrt_test_log2 "${this_script}"
+	    * ) [[ "$TEST" > "1" ]]  && CHROOT_wrt_test_log "${this_script}"
           ;;
       esac
       # If using optimizations, write the instructions
@@ -351,17 +361,17 @@
 
     # In the mount of kernel filesystems we need to set HLFS and not to use chroot.
     case "${this_script}" in
-      *kernfs*)
+      *kernfs* | *changingowner*)
         wrt_RunAsRoot "${this_script}" "${file}"
         ;;
       *)   # The rest of Chapter06
-        wrt_run_as_chroot1 "${this_script}" "${file}"
+        CHROOT_wrt_RunAsRoot "${file}"
        ;;
     esac
     #
     # Remove the build directory(ies) except if the package build fails.
     if [ "$pkg_tarball" != "" ] ; then
-      wrt_remove_build_dirs "$name"
+      CHROOT_wrt_RemoveBuildDirs "$name"
     fi
     #
     # Include a touch of the target name so make can check if it's already been made.
@@ -385,7 +395,7 @@
   local file
   local this_script
 
-  echo  "${tab_}${GREEN}Processing... ${L_arrow}Chapter7${R_arrow}"
+  echo  "${tab_}${GREEN}Processing... ${L_arrow}Chapter7     ( BOOT ) ${R_arrow}"
   for file in chapter07/*; do
     # Keep the script file name
     this_script=`basename $file`
@@ -398,12 +408,12 @@
       *usage)   continue  ;; # Contains example commands
       *grub)    continue  ;;
       *console) continue  ;; # Use the file generated by lfs-bootscripts
-
-      *kernel)
-          # If no .config file is supplied, the kernel build is skipped
-        [[ -z $CONFIG ]] && continue
-	cp $CONFIG $BUILDDIR/sources/kernel-config
-         ;;
+      *fstab)   [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab
+        ;;
+      *kernel)  # If no .config file is supplied, the kernel build is skipped
+                [[ -z $CONFIG ]] && continue
+                cp $CONFIG $BUILDDIR/sources/kernel-config
+        ;;
     esac
 
     # First append then name of the script file to a list (this will become
@@ -416,11 +426,11 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "$this_script" "$PREV"
+    CHROOT_wrt_target "$this_script" "$PREV"
 
     case "${this_script}" in
       *bootscripts*)
-        wrt_unpack2 $(get_package_tarball_name "lfs-bootscripts")
+        CHROOT_Unpack $(get_package_tarball_name "lfs-bootscripts")
         blfs_bootscripts=$(get_package_tarball_name "blfs-bootscripts" | sed -e 's/.tar.*//' )
         echo -e "\t at echo \"\$(MOUNT_PT)\$(SRC)/$blfs_bootscripts\" >> sources-dir" >> $MKFILE.tmp
         ;;
@@ -429,13 +439,13 @@
     case "${this_script}" in
       *fstab*) # Check if we have a real /etc/fstab file
         if [[ -n "$FSTAB" ]] ; then
-          wrt_copy_fstab "$this_script"
-        else  # Initialize the log and run the script
-          wrt_run_as_chroot2 "${this_script}" "${file}"
+           CHROOT_wrt_CopyFstab
+        else
+           CHROOT_wrt_RunAsRoot "$file"
         fi
         ;;
       *)  # All other scripts
-        wrt_run_as_chroot2 "${this_script}" "${file}"
+        CHROOT_wrt_RunAsRoot "${file}"
         ;;
     esac
 
@@ -444,8 +454,8 @@
       *bootscripts*)
 (
 cat << EOF
-	@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	rm -r \$(MOUNT_PT)\$(SRC)/\$\$ROOT
+	@ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
+	rm -r \$(SRC)/\$\$ROOT
 	@rm -r \`cat sources-dir\` && \\
 	rm sources-dir
 EOF
@@ -512,8 +522,10 @@
 SU_LUSER     = su - \$(LUSER) -c
 LUSER_HOME   = /home/\$(LUSER)
 PRT_DU       = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
-PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n"
+PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n"
 
+export PATH := \${PATH}:/usr/sbin
+
 include makefile-functions
 
 EOF
@@ -545,53 +557,65 @@
   # as a dependency.
 (
   cat << EOF
-all:  chapter3 chapter5 chapter6 chapter7 do-housekeeping
+
+all:	ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report
+	@sudo make do-housekeeping
 	@\$(call echo_finished,$VERSION)
 
-chapter3:  020-creatingtoolsdir 021-addinguser 022-settingenvironment
+ck_UID:
+	@if [ \`id -u\` = "0" ]; then \\
+	  echo "--------------------------------------------------"; \\
+	  echo "You cannot run this makefile from the root account"; \\
+	  echo "--------------------------------------------------"; \\
+	  exit 1; \\
+	fi
 
-chapter5:  chapter3 $chapter5 restore-luser-env
+mk_SETUP:
+	@\$(call echo_SU_request)
+	@sudo make SETUP
+	@touch \$@
 
-chapter6:  chapter5 $chapter6
+mk_LUSER: mk_SETUP
+	@\$(call echo_SULUSER_request)
+	@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make LUSER" )
+	@sudo make restore-luser-env
+	@touch \$@
 
-chapter7:  chapter6 $chapter7
+mk_SUDO: mk_LUSER
+	@sudo make SUDO
+	@touch \$@
 
-clean-all:  clean
-	rm -rf ./{hlfs-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
+mk_CHROOT: mk_SUDO
+	@if [ ! -e \$(MOUNT_PT)/bin ]; then \\
+	  mkdir \$(MOUNT_PT)/bin; \\
+	  cd \$(MOUNT_PT)/bin && \\
+	  ln -sf /tools/bin/bash bash; ln -sf bash sh; \\
+	  sudo chown -R 0:0 \$(MOUNT_PT)/bin; \\
+	fi;
+	@sudo sed -e 's|^ln -sv |ln -svf |' -i \$(CMDSDIR)/chapter06/064-createfiles
+	@\$(call echo_CHROOT_request)
+	@( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT")
+	@touch \$@
 
-clean:  clean-chapter7 clean-chapter6 clean-chapter5 clean-chapter3
+mk_BOOT: mk_CHROOT
+	@\$(call echo_CHROOT_request)
+	@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BOOT")
+	@touch \$@
 
-restart: restart_code all
 
-clean-chapter3:
-	-if [ ! -f luser-exist ]; then \\
-		userdel \$(LUSER); \\
-		rm -rf /home/\$(LUSER); \\
-	fi;
-	rm -rf \$(MOUNT_PT)/tools
-	rm -f /tools
-	rm -f envars luser-exist
-	rm -f 02* logs/02*.log
+SETUP:	$chapter3
 
-clean-chapter5:
-	rm -rf \$(MOUNT_PT)/tools/*
-	rm -f $chapter5 restore-luser-env sources-dir
-	cd logs && rm -f $chapter5 && cd ..
+LUSER:	$chapter5
 
-clean-chapter6:
-	-umount \$(MOUNT_PT)/sys
-	-umount \$(MOUNT_PT)/proc
-	-umount \$(MOUNT_PT)/dev/shm
-	-umount \$(MOUNT_PT)/dev/pts
-	-umount \$(MOUNT_PT)/dev
-	rm -rf \$(MOUNT_PT)/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}
-	rm -f $chapter6
-	cd logs && rm -f $chapter6 && cd ..
+SUDO:	060-kernfs 062-changingowner
 
-clean-chapter7:
-	rm -f $chapter7
-	cd logs && rm -f $chapter7 && cd ..
+CHROOT:	$chapter6
 
+BOOT:	$chapter7
+
+
+#restart: restart_code all
+
 restore-luser-env:
 	@\$(call echo_message, Building)
 	@if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
@@ -611,6 +635,7 @@
 	@-umount \$(MOUNT_PT)/dev
 	@-umount \$(MOUNT_PT)/sys
 	@-umount \$(MOUNT_PT)/proc
+	@-rm /tools
 	@-if [ ! -f luser-exist ]; then \\
 		userdel \$(LUSER); \\
 		rm -rf /home/\$(LUSER); \\
@@ -660,6 +685,21 @@
 EOF
 ) >> $MKFILE
 
+  # Add SBU-disk_usage report target
+  echo "create-sbu_du-report:" >> $MKFILE
+  if [[ "$REPORT" = "y" ]] ; then
+(
+    cat << EOF
+	@\$(call echo_message, Building)
+	@./create-sbu_du-report.sh logs $VERSION
+	@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
+	@touch  \$@
+
+
+EOF
+) >> $MKFILE
+  else echo -e "\t at true\n\n" >> $MKFILE; fi
+
   # Bring over the items from the Makefile.tmp
   cat $MKFILE.tmp >> $MKFILE
   rm $MKFILE.tmp

Modified: jhalfs/trunk/LFS/master.sh
===================================================================
--- jhalfs/trunk/LFS/master.sh	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/LFS/master.sh	2006-10-02 19:32:06 UTC (rev 3146)
@@ -7,10 +7,13 @@
 ###################################
 
 
+#############################################################
+
+
 #----------------------------#
-chapter4_Makefiles() {
+chapter4_Makefiles() {       #
 #----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter4${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter4     ( SETUP ) ${R_arrow}"
 
 # If /home/$LUSER is already present in the host, we asume that the
 # lfs user and group are also presents in the host, and a backup
@@ -35,7 +38,8 @@
 		touch luser-exist; \\
 	fi;
 	@chown \$(LUSER) \$(MOUNT_PT)/tools && \\
-	chmod a+wt \$(MOUNT_PT)/sources && \\
+	chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
+	chmod -R a+wt \$(MOUNT_PT) && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
@@ -57,17 +61,22 @@
 	echo "source $JHALFSDIR/envars" >> /home/\$(LUSER)/.bashrc && \\
 	chown \$(LUSER):\$(LGROUP) /home/\$(LUSER)/.bashrc && \\
 	touch envars && \\
+	chown \$(LUSER) envars && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
 EOF
-) >> $MKFILE.tmp
+) > $MKFILE.tmp
+
+  chapter4=" 020-creatingtoolsdir 021-addinguser 022-settingenvironment"
 }
 
+
+
 #----------------------------#
 chapter5_Makefiles() {
 #----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter5     ( LUSER ) ${R_arrow}"
 
   for file in chapter05/* ; do
     # Keep the script file name
@@ -86,7 +95,13 @@
 
     # First append each name of the script files to a list (this will become
     # the names of the targets in the Makefile
-    chapter5="$chapter5 ${this_script}"
+    # DO NOT append the changingowner script.
+    # A hack is necessary: create script in chap5 BUT run as a dependency for
+    #  chap6 CHROOT
+    case "${this_script}" in
+      *changingowner) : ;;
+                   *) chapter5="$chapter5 ${this_script}" ;;
+    esac
 
     # Grab the name of the target (minus the -pass1 or -pass2 in the case of gcc
     # and binutils in chapter 5)
@@ -101,7 +116,7 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    LUSER_wrt_target "${this_script}" "$PREV"
 
     # Find the version of the command files, if it corresponds with the building of
     # a specific package
@@ -110,9 +125,9 @@
     # If $pkg_tarball isn't empty, we've got a package...
     if [ "$pkg_tarball" != "" ] ; then
       # Insert instructions for unpacking the package and to set the PKGDIR variable.
-      wrt_unpack "$pkg_tarball"
+      LUSER_wrt_unpack "$pkg_tarball"
       # If the testsuites must be run, initialize the log file
-      [[ "$TEST" = "3" ]] && wrt_test_log "${this_script}"
+      [[ "$TEST" = "3" ]] && LUSER_wrt_test_log "${this_script}"
       # If using optimizations, write the instructions
       [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
@@ -122,13 +137,13 @@
     # The changingowner script must be run as root.
     case "${this_script}" in
       *changingowner)  wrt_RunAsRoot "${this_script}" "$file" ;;
-      *)               wrt_RunAsUser "${this_script}" "$file" ;;
+      *)               LUSER_wrt_RunAsUser "$file" ;;
     esac
 
     # Remove the build directory(ies) except if the package build fails
     # (so we can review config.cache, config.log, etc.)
     if [ "$pkg_tarball" != "" ] ; then
-      wrt_remove_build_dirs "$name"
+      LUSER_RemoveBuildDirs "$name"
     fi
 
     # Include a touch of the target name so make can check
@@ -144,9 +159,11 @@
   done  # end for file in chapter05/*
 }
 
+
 #----------------------------#
 chapter6_Makefiles() {
 #----------------------------#
+
   # Set envars and scripts for iteration targets
   LOGS="" # Start with an empty global LOGS envar
   if [[ -z "$1" ]] ; then
@@ -166,7 +183,7 @@
     sed -e 's at make install at rm -vf /usr/bin/bz*\n&@' -i chapter06$N/*-bzip2
   fi
 
-  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N     ( CHROOT ) ${R_arrow}"
 
   for file in chapter06$N/* ; do
     # Keep the script file name
@@ -208,19 +225,19 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}${N}" "$PREV"
+    CHROOT_wrt_target "${this_script}${N}" "$PREV"
 
     # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     if [ "$pkg_tarball" != "" ] ; then
-      wrt_unpack2 "$pkg_tarball"
+      CHROOT_Unpack "$pkg_tarball"
       # If the testsuites must be run, initialize the log file
       case $name in
         binutils | gcc | glibc )
-          [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
+          [[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
           ;;
         * )
-          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && wrt_test_log2 "${this_script}"
+          [[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}"
           ;;
       esac
       # If using optimizations, write the instructions
@@ -231,12 +248,12 @@
     # and not to use chroot.
     case "${this_script}" in
       *kernfs)  wrt_RunAsRoot    "${this_script}" "$file" ;;
-      *)        wrt_run_as_chroot1 "${this_script}" "$file" ;;
+      *)        CHROOT_wrt_RunAsRoot "$file" ;;
     esac
 
     # Remove the build directory(ies) except if the package build fails.
     if [ "$pkg_tarball" != "" ] ; then
-      wrt_remove_build_dirs "$name"
+      CHROOT_wrt_RemoveBuildDirs "$name"
     fi
 
     # Include a touch of the target name so make can check
@@ -257,7 +274,7 @@
 #----------------------------#
 chapter789_Makefiles() {
 #----------------------------#
-  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8/9${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8/9 ( BOOT ) ${R_arrow}"
 
   for file in chapter0{7,8,9}/* ; do
     # Keep the script file name
@@ -274,6 +291,7 @@
       *grub)    continue ;;
       *reboot)  continue ;;
       *console) continue  ;; # Use the file generated by lfs-bootscripts
+      *fstab)   [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
       *kernel)  [[ -z ${CONFIG} ]] && continue
                 cp ${CONFIG} $BUILDDIR/sources/kernel-config  ;;
     esac
@@ -288,37 +306,37 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
-    wrt_target "${this_script}" "$PREV"
+    CHROOT_wrt_target "${this_script}" "$PREV"
 
     # Find the bootscripts and kernel package names
     case "${this_script}" in
       *bootscripts)
             name="lfs-bootscripts"
             pkg_tarball=$(get_package_tarball_name $name)
-            wrt_unpack2 "$pkg_tarball"
+            CHROOT_Unpack "$pkg_tarball"
         ;;
       *kernel)
             name="linux"
             pkg_tarball=$(get_package_tarball_name $name)
-            wrt_unpack2 "$pkg_tarball"
+            CHROOT_Unpack "$pkg_tarball"
        ;;
     esac
 
       # Check if we have a real /etc/fstab file
     case "${this_script}" in
       *fstab) if [[ -n $FSTAB ]]; then
-                wrt_copy_fstab "${this_script}"
+                CHROOT_wrt_CopyFstab
               else
-                wrt_run_as_chroot2 "$this_script" "$file"
+                CHROOT_wrt_RunAsRoot "$file"
               fi
         ;;
-      *)        wrt_run_as_chroot2 "$this_script" "$file"
+      *)        CHROOT_wrt_RunAsRoot "$file"
         ;;
     esac
 
     case "${this_script}" in
-      *bootscripts)  wrt_remove_build_dirs "dummy" ;;
-      *kernel)       wrt_remove_build_dirs "dummy" ;;
+      *bootscripts)  CHROOT_wrt_RemoveBuildDirs "dummy" ;;
+      *kernel)       CHROOT_wrt_RemoveBuildDirs "dummy" ;;
     esac
 
     # Include a touch of the target name so make can check
@@ -333,19 +351,20 @@
     PREV=${this_script}
   done  # for file in chapter0{7,8,9}/*
 
-  # Add SBU-disk_usage report target if required
-  if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
 }
 
 
+
 #----------------------------#
-build_Makefile() {
+build_Makefile() {           #
 #----------------------------#
+
   echo "Creating Makefile... ${BOLD}START${OFF}"
+
   cd $JHALFSDIR/${PROGNAME}-commands
 
   # Start with a clean Makefile.tmp file
-  >$MKFILE.tmp
+  >$MKFILE
 
   chapter4_Makefiles
   chapter5_Makefiles
@@ -353,14 +372,16 @@
   # Add the iterations targets, if needed
   [[ "$COMPARE" = "y" ]] && wrt_compare_targets
   chapter789_Makefiles
+  # Add the BLFS_TOOL targets, if needed
+  [[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
 
-
   # Add a header, some variables and include the function file
   # to the top of the real Makefile.
 (
     cat << EOF
 $HEADER
 
+
 SRC          = /sources
 MOUNT_PT     = $BUILDDIR
 PKG_LST      = $PKG_LST
@@ -381,16 +402,16 @@
 
 SU_LUSER     = su - \$(LUSER) -c
 LUSER_HOME   = /home/\$(LUSER)
-PRT_DU       = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
-PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n"
+PRT_DU       = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT) \`\n"
+PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n"
 
+export PATH := \${PATH}:/usr/sbin
 
 include makefile-functions
 
 EOF
 ) > $MKFILE
 
-
   # Add chroot commands
   CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
   i=1
@@ -414,53 +435,71 @@
   # as a dependency.
 (
     cat << EOF
-all:  chapter4 chapter5 chapter6 chapter789 do_housekeeping
+
+all:	ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_BLFS_TOOL
+	@sudo make do_housekeeping
 	@\$(call echo_finished,$VERSION)
 
-chapter4:  020-creatingtoolsdir 021-addinguser 022-settingenvironment
+ck_UID:
+	@if [ \`id -u\` = "0" ]; then \\
+	  echo "--------------------------------------------------"; \\
+	  echo "You cannot run this makefile from the root account"; \\
+	  echo "--------------------------------------------------"; \\
+	  exit 1; \\
+	fi
 
-chapter5:  chapter4 $chapter5 restore-luser-env
+mk_SETUP:
+	@\$(call echo_SU_request)
+	@sudo make SETUP
+	@touch \$@
 
-chapter6:  chapter5 $chapter6
+mk_LUSER: mk_SETUP
+	@\$(call echo_SULUSER_request)
+	@( sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make LUSER" )
+	@sudo make restore-luser-env
+	@touch \$@
 
-chapter789:  chapter6 $chapter789
+mk_SUDO: mk_LUSER
+	@sudo make SUDO
+	touch \$@
+#
+# The convoluted piece of code below is necessary to provide 'make' with a valid shell in the
+# chroot environment. (Unless someone knows a different way)
+# Manually create the /bin directory and provide link to the /tools dir.
+# Also change the original symlink creation to include (f)orce to prevent failure due to
+#  pre-existing links.
+#
+mk_CHROOT: mk_SUDO
+	@if [ ! -e \$(MOUNT_PT)/bin ]; then \\
+	  mkdir \$(MOUNT_PT)/bin; \\
+	  cd \$(MOUNT_PT)/bin && \\
+	  ln -sf /tools/bin/bash bash; ln -sf bash sh; \\
+	  sudo chown -R 0:0 \$(MOUNT_PT)/bin; \\
+	fi;
+	@sudo sed -e 's|^ln -sv |ln -svf |' -i \$(CMDSDIR)/chapter06/063-createfiles
+	@\$(call echo_CHROOT_request)
+	@( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make CHROOT")
+	@touch \$@
 
-clean-all:  clean
-	rm -rf ./{lfs-commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
+mk_BOOT: mk_CHROOT
+	@\$(call echo_CHROOT_request)
+	@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BOOT")
+	@touch \$@
 
-clean:  clean-chapter789 clean-chapter6 clean-chapter5 clean-chapter4
 
-restart: restart_code all
+SETUP:	$chapter4
 
-clean-chapter4:
-	-if [ ! -f luser-exist ]; then \\
-		userdel \$(LUSER); \\
-		rm -rf /home/\$(LUSER); \\
-	fi;
-	rm -rf \$(MOUNT_PT)/tools
-	rm -f /tools
-	rm -f envars luser-exist
-	rm -f 02* logs/02*.log
+LUSER:	$chapter5
 
-clean-chapter5:
-	rm -rf \$(MOUNT_PT)/tools/*
-	rm -f $chapter5 restore-luser-env sources-dir
-	cd logs && rm -f $chapter5 && cd ..
+SUDO:	057-changingowner 059-kernfs
 
-clean-chapter6:
-	-umount \$(MOUNT_PT)/sys
-	-umount \$(MOUNT_PT)/proc
-	-umount \$(MOUNT_PT)/dev/shm
-	-umount \$(MOUNT_PT)/dev/pts
-	-umount \$(MOUNT_PT)/dev
-	rm -rf \$(MOUNT_PT)/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,usr,var}
-	rm -f $chapter6
-	cd logs && rm -f $chapter6 && cd ..
+CHROOT:	$chapter6
 
-clean-chapter789:
-	rm -f $chapter789
-	cd logs && rm -f $chapter789 && cd ..
+BOOT:	$chapter789
 
+
+restart: restart_code all
+
 restore-luser-env:
 	@\$(call echo_message, Building)
 	@if [ -f /home/\$(LUSER)/.bashrc.XXX ]; then \\
@@ -480,6 +519,7 @@
 	@-umount \$(MOUNT_PT)/dev/shm
 	@-umount \$(MOUNT_PT)/dev/pts
 	@-umount \$(MOUNT_PT)/dev
+	@-rm /tools
 	@-if [ ! -f luser-exist ]; then \\
 		userdel \$(LUSER); \\
 		rm -rf /home/\$(LUSER); \\
@@ -528,10 +568,40 @@
 EOF
 ) >> $MKFILE
 
+  # Add SBU-disk_usage report target
+  echo "create-sbu_du-report:" >> $MKFILE
+  if [[ "$REPORT" = "y" ]] ; then
+(
+    cat << EOF
+	@\$(call echo_message, Building)
+	@./create-sbu_du-report.sh logs $VERSION
+	@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
+	@touch  \$@
+
+
+EOF
+) >> $MKFILE
+  else echo -e "\t at true\n\n" >> $MKFILE; fi
+
+  # Add BLFS_TOOL targets
+  echo "mk_BLFS_TOOL:" >> $MKFILE
+  if [[ "$BLFS_TOOL" = "y" ]] ; then
+(
+    cat << EOF
+	@\$(call echo_CHROOT_request)
+	@ sudo mkdir $BUILDDIR$TRACKING_DIR
+	@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BLFS_TOOL")
+	@touch \$@
+
+BLFS_TOOL:  $blfs_tool
+
+
+EOF
+) >> $MKFILE
+  else echo -e "\t at true\n\n" >> $MKFILE; fi
+
   # Bring over the items from the Makefile.tmp
   cat $MKFILE.tmp >> $MKFILE
   rm $MKFILE.tmp
   echo "Creating Makefile... ${BOLD}DONE${OFF}"
-
 }
-

Copied: jhalfs/trunk/README.HLFS (from rev 3145, jhalfs/branches/experimental/README.HLFS)
===================================================================
--- jhalfs/trunk/README.HLFS	                        (rev 0)
+++ jhalfs/trunk/README.HLFS	2006-10-02 19:32:06 UTC (rev 3146)
@@ -0,0 +1,18 @@
+$Id$
+
+
+		::::NOTICE::::
+
+ Hardened Linux From Scratch is a highly volatile project. Extreme design
+ changes can occur and the build could be broken for extended periods of
+ time.
+
+ As of Sept.15.2006 jhalfs cannot build the svn book.  This is a book
+ problem and not jhalfs.
+ 
+
+ Automation failures:  
+  1.Directory /dev and devices nodes /dev/null, /dev/console needed to be 
+  created in kernfs
+  2.Linux-headers does not contain /net.
+  3.Remove the creation of /null and /console node from the devices script.
\ No newline at end of file


Property changes on: jhalfs/trunk/README.HLFS
___________________________________________________________________
Name: svn:keywords
   + Author Date Rev Id

Modified: jhalfs/trunk/blfs-tool
===================================================================
--- jhalfs/trunk/blfs-tool	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/blfs-tool	2006-10-02 19:32:06 UTC (rev 3146)
@@ -72,6 +72,11 @@
 [[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1
 [[ $VERBOSITY > 0 ]] && echo "OK"
 
+[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_check_version.sh>..."
+source $COMMON_DIR/func_check_version.sh
+[[ $? > 0 ]] && echo " function module did not load.." && exit 2
+[[ $VERBOSITY > 0 ]] && echo "OK"
+
 [[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_validate_configs.sh>..."
 source $COMMON_DIR/func_validate_configs.sh
 [[ $? > 0 ]] && echo " function module did not load.." && exit 2
@@ -94,6 +99,45 @@
             * )  TREE=tags/${BRANCH_ID}/BOOK ;;
 esac
 
+# Check for minimun dependencies versions
+xsltprocVer=`xsltproc -V | head -n1 `
+  libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
+ libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
+    tidyVer=`tidy -V | cut -d " " -f9`
+
+  # Version numbers are packed strings not xx.yy.zz format.
+check_version "2.06.20"  "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}"     "LIBXML2"
+check_version "1.01.14"  "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}"  "LIBXSLT"
+check_version "2004"     "${tidyVer}"                                             "TIDY"
+
+XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
+<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
+<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
+  'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd'>
+<article>
+  <title>Test file</title>
+  <sect1>
+    <title>Some title</title>
+    <para>Some text</para>
+  </sect1>
+</article>"
+
+if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
+  check_version "4.4" "4.4" "DocBook XML DTD"
+else
+  echo "Warning: not found a working DocBook XML DTD 4.4 installation"
+  exit 2
+fi
+
+if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
+  check_version "1.69.1" "1.69.1" "DocBook XSL"
+else
+  echo "Warning: not found a working DocBook XSL 1.69.1 installation"
+  exit 2
+fi
+
+echo "${SD_BORDER}${nl_}"
+
 # For consistency with other books
 validate_config
 echo "${SD_BORDER}${nl_}"

Deleted: jhalfs/trunk/common/blfs-tool-deps/903-docbook-xsl
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/903-docbook-xsl	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/blfs-tool-deps/903-docbook-xsl	2006-10-02 19:32:06 UTC (rev 3146)
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-# $Id$
-
-set -e
-
-install -v -m755 -d /usr/share/xml/docbook/xsl-stylesheets-1.69.1
-cp -v -R VERSION common eclipse extensions fo html \
-         htmlhelp images javahelp lib manpages params \
-         profiling slides template website xhtml \
-    /usr/share/xml/docbook/xsl-stylesheets-1.69.1
-
-if [ ! -d /etc/xml ]; then install -v -m755 -d /etc/xml; fi
-if [ ! -f /etc/xml/catalog ]; then
-    xmlcatalog --noout --create /etc/xml/catalog
-fi
-
-xmlcatalog --noout --add "rewriteSystem" \
-           "http://docbook.sourceforge.net/release/xsl/1.69.1" \
-           "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
-    /etc/xml/catalog
-
-xmlcatalog --noout --add "rewriteURI" \
-           "http://docbook.sourceforge.net/release/xsl/1.69.1" \
-           "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
-    /etc/xml/catalog
-
-xmlcatalog --noout --add "rewriteSystem" \
-           "http://docbook.sourceforge.net/release/xsl/current" \
-           "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
-    /etc/xml/catalog
-
-xmlcatalog --noout --add "rewriteURI" \
-           "http://docbook.sourceforge.net/release/xsl/current" \
-           "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
-    /etc/xml/catalog
-
-exit

Copied: jhalfs/trunk/common/blfs-tool-deps/903-tidy (from rev 3145, jhalfs/branches/experimental/common/blfs-tool-deps/903-tidy)
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/903-tidy	                        (rev 0)
+++ jhalfs/trunk/common/blfs-tool-deps/903-tidy	2006-10-02 19:32:06 UTC (rev 3146)
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# $Id$
+
+set -e
+
+patch -Np1 -i ../tidy-051026-prevent_PRE_newlines-1.patch
+sh build/gnuauto/setup.sh
+./configure --prefix=/usr
+make
+make install
+cd htmldoc
+tidy -xml-help > tidy-help.xml
+tidy -xml-config > tidy-config.xml
+xsltproc -o tidy.1 tidy1.xsl tidy-help.xml
+xsltproc -o quickref.html quickref-html.xsl tidy-config.xml
+cd ..
+install -v -m644 htmldoc/tidy.1 /usr/share/man/man1
+install -v -m755 -d /usr/share/doc/tidy-051026
+install -v -m644 htmldoc/quickref.html /usr/share/doc/tidy-051026
+
+exit


Property changes on: jhalfs/trunk/common/blfs-tool-deps/903-tidy
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id

Deleted: jhalfs/trunk/common/blfs-tool-deps/904-gpm
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/904-gpm	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/blfs-tool-deps/904-gpm	2006-10-02 19:32:06 UTC (rev 3146)
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-# $Id$
-
-set -e
-
-patch -Np1 -i ../gpm-1.20.1-segfault-1.patch
-patch -Np1 -i ../gpm-1.20.1-silent-1.patch
-./configure --prefix=/usr --sysconfdir=/etc
-LDFLAGS="$LDFLAGS -lm" make
-make install
-cp -v conf/gpm-root.conf /etc
-ldconfig
-
-exit

Copied: jhalfs/trunk/common/blfs-tool-deps/904-unzip (from rev 3145, jhalfs/branches/experimental/common/blfs-tool-deps/904-unzip)
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/904-unzip	                        (rev 0)
+++ jhalfs/trunk/common/blfs-tool-deps/904-unzip	2006-10-02 19:32:06 UTC (rev 3146)
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# $Id$
+
+set -e
+
+make -f unix/Makefile LOCAL_UNZIP=-D_FILE_OFFSET_BITS=64 linux
+make prefix=/usr install
+
+exit


Property changes on: jhalfs/trunk/common/blfs-tool-deps/904-unzip
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id

Copied: jhalfs/trunk/common/blfs-tool-deps/905-docbook-xml (from rev 3145, jhalfs/branches/experimental/common/blfs-tool-deps/905-docbook-xml)
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/905-docbook-xml	                        (rev 0)
+++ jhalfs/trunk/common/blfs-tool-deps/905-docbook-xml	2006-10-02 19:32:06 UTC (rev 3146)
@@ -0,0 +1,108 @@
+#!/bin/sh
+
+# $Id$
+
+set -e
+
+cd /sources
+mkdir docbook-xml
+cd docbook-xml
+unzip ../docbook-xml-4.4.zip
+install -v -d -m755 /usr/share/xml/docbook/xml-dtd-4.4
+install -v -d -m755 /etc/xml
+chown -R root:root .
+cp -v -af docbook.cat *.dtd ent/ *.mod \
+    /usr/share/xml/docbook/xml-dtd-4.4
+if [ ! -e /etc/xml/docbook ]; then
+    xmlcatalog --noout --create /etc/xml/docbook
+fi
+xmlcatalog --noout --add "public" \
+    "-//OASIS//DTD DocBook XML V4.4//EN" \
+    "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" \
+    /etc/xml/docbook
+xmlcatalog --noout --add "public" \
+    "-//OASIS//DTD DocBook XML CALS Table Model V4.4//EN" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4/calstblx.dtd" \
+    /etc/xml/docbook
+xmlcatalog --noout --add "public" \
+    "-//OASIS//DTD XML Exchange Table Model 19990315//EN" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4/soextblx.dtd" \
+    /etc/xml/docbook
+xmlcatalog --noout --add "public" \
+    "-//OASIS//ELEMENTS DocBook XML Information Pool V4.4//EN" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4/dbpoolx.mod" \
+    /etc/xml/docbook
+xmlcatalog --noout --add "public" \
+    "-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.4//EN" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4/dbhierx.mod" \
+    /etc/xml/docbook
+xmlcatalog --noout --add "public" \
+    "-//OASIS//ELEMENTS DocBook XML HTML Tables V4.4//EN" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4/htmltblx.mod" \
+    /etc/xml/docbook
+xmlcatalog --noout --add "public" \
+    "-//OASIS//ENTITIES DocBook XML Notations V4.4//EN" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4/dbnotnx.mod" \
+    /etc/xml/docbook
+xmlcatalog --noout --add "public" \
+    "-//OASIS//ENTITIES DocBook XML Character Entities V4.4//EN" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4/dbcentx.mod" \
+    /etc/xml/docbook
+xmlcatalog --noout --add "public" \
+    "-//OASIS//ENTITIES DocBook XML Additional General Entities V4.4//EN" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4/dbgenent.mod" \
+    /etc/xml/docbook
+xmlcatalog --noout --add "rewriteSystem" \
+    "http://www.oasis-open.org/docbook/xml/4.4" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4" \
+    /etc/xml/docbook
+xmlcatalog --noout --add "rewriteURI" \
+    "http://www.oasis-open.org/docbook/xml/4.4" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4" \
+    /etc/xml/docbook
+if [ ! -e /etc/xml/catalog ]; then
+    xmlcatalog --noout --create /etc/xml/catalog
+fi
+xmlcatalog --noout --add "delegatePublic" \
+    "-//OASIS//ENTITIES DocBook XML" \
+    "file:///etc/xml/docbook" \
+    /etc/xml/catalog
+xmlcatalog --noout --add "delegatePublic" \
+    "-//OASIS//DTD DocBook XML" \
+    "file:///etc/xml/docbook" \
+    /etc/xml/catalog
+xmlcatalog --noout --add "delegateSystem" \
+    "http://www.oasis-open.org/docbook/" \
+    "file:///etc/xml/docbook" \
+    /etc/xml/catalog
+xmlcatalog --noout --add "delegateURI" \
+    "http://www.oasis-open.org/docbook/" \
+    "file:///etc/xml/docbook" \
+    /etc/xml/catalog
+for DTDVERSION in 4.1.2 4.2 4.3
+do
+  xmlcatalog --noout --add "public" \
+    "-//OASIS//DTD DocBook XML V$DTDVERSION//EN" \
+    "http://www.oasis-open.org/docbook/xml/$DTDVERSION/docbookx.dtd" \
+    /etc/xml/docbook
+  xmlcatalog --noout --add "rewriteSystem" \
+    "http://www.oasis-open.org/docbook/xml/$DTDVERSION" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4" \
+    /etc/xml/docbook
+  xmlcatalog --noout --add "rewriteURI" \
+    "http://www.oasis-open.org/docbook/xml/$DTDVERSION" \
+    "file:///usr/share/xml/docbook/xml-dtd-4.4" \
+    /etc/xml/docbook
+  xmlcatalog --noout --add "delegateSystem" \
+    "http://www.oasis-open.org/docbook/xml/$DTDVERSION/" \
+    "file:///etc/xml/docbook" \
+    /etc/xml/catalog
+  xmlcatalog --noout --add "delegateURI" \
+    "http://www.oasis-open.org/docbook/xml/$DTDVERSION/" \
+    "file:///etc/xml/docbook" \
+    /etc/xml/catalog
+done
+cd ..
+rm -rf docbook-xml
+
+exit


Property changes on: jhalfs/trunk/common/blfs-tool-deps/905-docbook-xml
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id

Deleted: jhalfs/trunk/common/blfs-tool-deps/905-links
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/905-links	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/blfs-tool-deps/905-links	2006-10-02 19:32:06 UTC (rev 3146)
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# $Id$
-
-set -e
-
-./configure --prefix=/usr
-make CFLAGS="-O2 -Wno-sign-compare -Wno-pointer-sign"
-make install
-
-exit

Copied: jhalfs/trunk/common/blfs-tool-deps/906-docbook-xsl (from rev 3145, jhalfs/branches/experimental/common/blfs-tool-deps/906-docbook-xsl)
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/906-docbook-xsl	                        (rev 0)
+++ jhalfs/trunk/common/blfs-tool-deps/906-docbook-xsl	2006-10-02 19:32:06 UTC (rev 3146)
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# $Id$
+
+set -e
+
+install -v -m755 -d /usr/share/xml/docbook/xsl-stylesheets-1.69.1
+cp -v -R VERSION common eclipse extensions fo html \
+         htmlhelp images javahelp lib manpages params \
+         profiling slides template website xhtml \
+    /usr/share/xml/docbook/xsl-stylesheets-1.69.1
+
+if [ ! -d /etc/xml ]; then install -v -m755 -d /etc/xml; fi
+if [ ! -f /etc/xml/catalog ]; then
+    xmlcatalog --noout --create /etc/xml/catalog
+fi
+
+xmlcatalog --noout --add "rewriteSystem" \
+           "http://docbook.sourceforge.net/release/xsl/1.69.1" \
+           "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
+    /etc/xml/catalog
+
+xmlcatalog --noout --add "rewriteURI" \
+           "http://docbook.sourceforge.net/release/xsl/1.69.1" \
+           "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
+    /etc/xml/catalog
+
+xmlcatalog --noout --add "rewriteSystem" \
+           "http://docbook.sourceforge.net/release/xsl/current" \
+           "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
+    /etc/xml/catalog
+
+xmlcatalog --noout --add "rewriteURI" \
+           "http://docbook.sourceforge.net/release/xsl/current" \
+           "/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
+    /etc/xml/catalog
+
+exit


Property changes on: jhalfs/trunk/common/blfs-tool-deps/906-docbook-xsl
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id

Deleted: jhalfs/trunk/common/blfs-tool-deps/906-sudo
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/906-sudo	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/blfs-tool-deps/906-sudo	2006-10-02 19:32:06 UTC (rev 3146)
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-# $Id$
-
-set -e
-
-patch -Np1 -i ../sudo-1.6.8p12-envvar_fix-1.patch
-./configure --prefix=/usr --libexecdir=/usr/lib \
-    --enable-noargs-shell --with-ignore-dot --with-all-insults \
-    --enable-shell-sets-home
-make
-make install
-
-exit

Copied: jhalfs/trunk/common/blfs-tool-deps/907-gpm (from rev 3145, jhalfs/branches/experimental/common/blfs-tool-deps/907-gpm)
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/907-gpm	                        (rev 0)
+++ jhalfs/trunk/common/blfs-tool-deps/907-gpm	2006-10-02 19:32:06 UTC (rev 3146)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# $Id$
+
+set -e
+
+patch -Np1 -i ../gpm-1.20.1-segfault-1.patch
+patch -Np1 -i ../gpm-1.20.1-silent-1.patch
+./configure --prefix=/usr --sysconfdir=/etc
+LDFLAGS="$LDFLAGS -lm" make
+make install
+cp -v conf/gpm-root.conf /etc
+ldconfig
+
+exit


Property changes on: jhalfs/trunk/common/blfs-tool-deps/907-gpm
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id

Deleted: jhalfs/trunk/common/blfs-tool-deps/907-wget
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/907-wget	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/blfs-tool-deps/907-wget	2006-10-02 19:32:06 UTC (rev 3146)
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# $Id$
-
-set -e
-
-./configure --prefix=/usr --sysconfdir=/etc
-make
-make install
-
-exit

Copied: jhalfs/trunk/common/blfs-tool-deps/908-links (from rev 3145, jhalfs/branches/experimental/common/blfs-tool-deps/908-links)
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/908-links	                        (rev 0)
+++ jhalfs/trunk/common/blfs-tool-deps/908-links	2006-10-02 19:32:06 UTC (rev 3146)
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# $Id$
+
+set -e
+
+./configure --prefix=/usr
+make CFLAGS="-O2 -Wno-sign-compare -Wno-pointer-sign"
+make install
+
+exit


Property changes on: jhalfs/trunk/common/blfs-tool-deps/908-links
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id

Deleted: jhalfs/trunk/common/blfs-tool-deps/908-subversion
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/908-subversion	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/blfs-tool-deps/908-subversion	2006-10-02 19:32:06 UTC (rev 3146)
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-# $Id$
-
-set -e
-
-./configure --prefix=/usr \
-            --without-berkeley-db \
-            --with-installbuilddir=/usr/lib/apr-0
-make
-make install
-rm doc/{Makefile,doxygen.conf}
-find doc -type d -exec chmod 755 {} \;
-find doc -type f -exec chmod 644 {} \;
-install -v -m755 -d /usr/share/doc/subversion-1.3.1
-cp -v -R doc/* /usr/share/doc/subversion-1.3.1
-
-exit

Copied: jhalfs/trunk/common/blfs-tool-deps/909-sudo (from rev 3145, jhalfs/branches/experimental/common/blfs-tool-deps/909-sudo)
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/909-sudo	                        (rev 0)
+++ jhalfs/trunk/common/blfs-tool-deps/909-sudo	2006-10-02 19:32:06 UTC (rev 3146)
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# $Id$
+
+set -e
+
+patch -Np1 -i ../sudo-1.6.8p12-envvar_fix-1.patch
+./configure --prefix=/usr --libexecdir=/usr/lib \
+    --enable-noargs-shell --with-ignore-dot --with-all-insults \
+    --enable-shell-sets-home
+make
+make install
+
+exit


Property changes on: jhalfs/trunk/common/blfs-tool-deps/909-sudo
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id

Copied: jhalfs/trunk/common/blfs-tool-deps/910-wget (from rev 3145, jhalfs/branches/experimental/common/blfs-tool-deps/910-wget)
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/910-wget	                        (rev 0)
+++ jhalfs/trunk/common/blfs-tool-deps/910-wget	2006-10-02 19:32:06 UTC (rev 3146)
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# $Id$
+
+set -e
+
+./configure --prefix=/usr --sysconfdir=/etc
+make
+make install
+
+exit


Property changes on: jhalfs/trunk/common/blfs-tool-deps/910-wget
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id

Copied: jhalfs/trunk/common/blfs-tool-deps/911-subversion (from rev 3145, jhalfs/branches/experimental/common/blfs-tool-deps/911-subversion)
===================================================================
--- jhalfs/trunk/common/blfs-tool-deps/911-subversion	                        (rev 0)
+++ jhalfs/trunk/common/blfs-tool-deps/911-subversion	2006-10-02 19:32:06 UTC (rev 3146)
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# $Id$
+
+set -e
+
+./configure --prefix=/usr \
+            --without-berkeley-db \
+            --with-installbuilddir=/usr/lib/apr-0
+make
+make install
+rm doc/{Makefile,doxygen.conf}
+find doc -type d -exec chmod 755 {} \;
+find doc -type f -exec chmod 644 {} \;
+install -v -m755 -d /usr/share/doc/subversion-1.3.1
+cp -v -R doc/* /usr/share/doc/subversion-1.3.1
+
+exit


Property changes on: jhalfs/trunk/common/blfs-tool-deps/911-subversion
___________________________________________________________________
Name: svn:keywords
   + Author Date Revision Id

Modified: jhalfs/trunk/common/common-functions
===================================================================
--- jhalfs/trunk/common/common-functions	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/common-functions	2006-10-02 19:32:06 UTC (rev 3146)
@@ -29,51 +29,15 @@
 # Generated on `date \"+%F %X %Z\"`"
 
 
+#------------------------------------------------------#
+#        NEW Makefile scripting functions              #
+#------------------------------------------------------#
 
-#----------------------------------#
-wrt_target() {                     # Create target and initialize log file
-#----------------------------------#
-  local i=$1
-  local PREV=$2
-  case $i in
-    iteration* ) local LOGFILE=$this_script.log ;;
-             * ) local LOGFILE=$this_script ;;
-  esac
-(
-cat << EOF
 
-$i:  $PREV
-	@\$(call echo_message, Building)
-	@./progress_bar.sh \$@ \$\$PPID &
-	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >logs/$LOGFILE
-EOF
-) >> $MKFILE.tmp
-}
-
-
+unset get_package_tarball_name
 #----------------------------------#
-wrt_target_boot() {                # Create target and initialize log file
+get_package_tarball_name() {       #
 #----------------------------------#
-  local i=$1
-  local PREV=$2
-  case $i in
-    iteration* ) local LOGFILE=$this_script.log ;;
-             * ) local LOGFILE=$this_script ;;
-  esac
-(
-cat << EOF
-
-$i:  $PREV
-	@\$(call echo_message, Building)
-	@./progress_bar.sh \$@ \$\$PPID &
-	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
-EOF
-) >> $MKFILE.tmp
-}
-
-#----------------------------#
-get_package_tarball_name() { #
-#----------------------------#
   local script_name=$1
 
    # The use of 'head' is necessary to limit the return value to the FIRST match..
@@ -88,87 +52,105 @@
 }
 
 
+unset wrt_RunaAsRoot
 #----------------------------------#
-wrt_test_log() {                   # Initialize testsuite log file
+wrt_RunAsRoot() {                  # Some scripts must be run as root..
 #----------------------------------#
-  local TESTLOGFILE=$1
+  local ENV_MOUNT
+  local this_script=$1
+  local file=$2
+
+  case ${PROGNAME} in
+    lfs   ) MOUNT_ENV="LFS" ;;
+    blfs  ) MOUNT_ENV="BLFS" ;;
+    clfs  ) MOUNT_ENV="CLFS" ;;
+    clfs2 ) MOUNT_ENV="CLFS" ;;
+    hlfs  ) MOUNT_ENV="HLFS" ;;
+    *) echo "undefined progname $PROGNAME"; exit 1 ;;
+  esac
+
 (
-cat  << EOF
-	@echo "export TEST_LOG=$TESTLOGDIR/$TESTLOGFILE" >> envars && \\
-	su - \$(LUSER) -c "echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE"
+cat << EOF
+	@( time { export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
+	\$(PRT_DU_CR) >>logs/\$@
 EOF
 ) >> $MKFILE.tmp
 }
 
+
+#------------------------------------------------------#
+#------------------------------------------------------#
+
 #----------------------------------#
-wrt_test_log2() {                  #
+ROOT_RunAsRoot() {                 #
 #----------------------------------#
-  local TESTLOGFILE=$1
+  local file=$1
 (
-cat  << EOF
-	@echo "export TEST_LOG=/$SCRIPT_ROOT/test-logs/$TESTLOGFILE" >> envars && \\
-	echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
+cat << EOF
+	@( time { source envars && \$(CMDSDIR)/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
+	\$(PRT_DU_CR) >>logs/$this_script
 EOF
 ) >> $MKFILE.tmp
 }
 
 #----------------------------------#
-wrt_target_vars() {                # Target vars for hlfs (cross-build method)
+ROOT_Unpack() {                    #  An alias, for clairity
 #----------------------------------#
+  local FILE=$1
+  local optSAVE_PREVIOUS=$2
+
+  if [[ "${optSAVE_PREVIOUS}" != "1" ]]; then
 (
-cat  << EOF
-	@echo "export target=$(uname -m)-${TARGET}" >> envars && \\
-	echo "export ldso=/lib/${LOADER}" >> envars
+cat << EOF
+	@\$(call remove_existing_dirs,$FILE)
 EOF
 ) >> $MKFILE.tmp
+  fi
 
-}
-
-
-#----------------------------------#
-wrt_copy_fstab() {                 #
-#----------------------------------#
-  local i=$1
 (
-    cat << EOF
-	@cp -v $FSTAB \$(MOUNT_PT)/etc/fstab >>logs/$i 2>&1
+cat << EOF
+	@\$(call unpack,$FILE)
+	@\$(call get_pkg_root_LUSER)
 EOF
 ) >> $MKFILE.tmp
 }
 
+#------------------------------------------------------#
+#------------------------------------------------------#
 
 #----------------------------------#
-wrt_copy_fstab2() {                #
+LUSER_wrt_target() {               # Create target and initialize log file
 #----------------------------------#
   local i=$1
+  local PREV=$2
 (
-    cat << EOF
-	@cp -v /sources/fstab /etc/fstab >>logs/$i 2>&1
+cat << EOF
+
+$i:  $PREV
+	@\$(call echo_message, Building)
+	@./progress_bar.sh \$@ \$\$PPID &
+	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n" >logs/\$@
 EOF
 ) >> $MKFILE.tmp
 }
 
 
 #----------------------------------#
-wrt_report() {                     #
+LUSER_wrt_RunAsUser() {            # Execute script inside time { }, footer to log file
 #----------------------------------#
+  local file=$1
+
 (
 cat << EOF
-
-create-sbu_du-report:  $PREV
-	@\$(call echo_message, Building)
-	@./create-sbu_du-report.sh logs $VERSION
-	@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
-	@touch  \$@
+	@( time { source ~/.bashrc && \$(CMDSDIR)/`dirname $file`/\$@ >> logs/\$@ 2>&1; } ) 2>> logs/\$@ && \\
+	\$(PRT_DU) >> logs/\$@
 EOF
 ) >> $MKFILE.tmp
-
-chapter789="$chapter789 create-sbu_du-report"
 }
 
-unset wrt_unpack
+
 #----------------------------------#
-wrt_unpack() {                     # Unpack and set 'ROOT' var
+LUSER_wrt_unpack() {               # Unpack and set 'ROOT' var
 #----------------------------------#
   local FILE=$1
   local optSAVE_PREVIOUS=$2
@@ -184,59 +166,39 @@
 (
 cat << EOF
 	@\$(call unpack,$FILE)
-	@\$(call get_pkg_root)
+	@\$(call get_pkg_root_LUSER)
 EOF
 ) >> $MKFILE.tmp
 
 }
 
-unset wrt_unpack2
+
 #----------------------------------#
-wrt_unpack2() {                    #
+LUSER_wrt_CopyFstab() {            #
 #----------------------------------#
-  local FILE=$1
-  local optSAVE_PREVIOUS=$2
-
-  if [ "${optSAVE_PREVIOUS}" != "1" ]; then
 (
 cat << EOF
-	@\$(call remove_existing_dirs,$FILE)
+	@( time { cp -v \$(MOUNT_PT)/sources/fstab \$(MOUNT_PT)/etc/fstab >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@
 EOF
 ) >> $MKFILE.tmp
-  fi
-(
-cat  << EOF
-	@\$(call unpack2,$FILE)
-	@\$(call get_pkg_root,nouser)
-EOF
-) >> $MKFILE.tmp
 }
 
+
 #----------------------------------#
-wrt_unpack3() {                    #
+LUSER_wrt_test_log() {             # Initialize testsuite log file
 #----------------------------------#
-  local FILE=$1
-  local optSAVE_PREVIOUS=$2
-
-  if [ "${optSAVE_PREVIOUS}" != "1" ]; then
+  local TESTLOGFILE=$1
 (
-cat << EOF
-	@\$(call remove_existing_dirs2,$FILE)
-EOF
-) >> $MKFILE.tmp
-  fi
-(
 cat  << EOF
-	@\$(call unpack3,$FILE)
-	@\$(call get_pkg_root2)
+	@echo "export  TEST_LOG=$TESTLOGDIR/$TESTLOGFILE" >> envars && \\
+	echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE
 EOF
 ) >> $MKFILE.tmp
 }
 
 
-unset wrt_remove_build_dirs
 #----------------------------------#
-wrt_remove_build_dirs() {          #
+LUSER_RemoveBuildDirs() {          #
 #----------------------------------#
   local name=$1
 (
@@ -246,163 +208,191 @@
 ) >> $MKFILE.tmp
 }
 
+#-----------------------------------------------------------------#
+#-----------------------------------------------------------------#
+
 #----------------------------------#
-wrt_remove_build_dirs2() {         #
+CHROOT_wrt_target() {              # Create target and initialize log file
 #----------------------------------#
-  local name=$1
+  local i=$1
+  local PREV=$2
+  case $i in
+    iteration* ) local LOGFILE="${this_script}.log" ;;
+             * ) local LOGFILE="${this_script}"      ;;
+  esac
 (
 cat << EOF
-	@\$(call remove_build_dirs2,$name)
+
+$i:  $PREV
+	@\$(call echo_message, Building)
+	@./progress_bar.sh \$@ \$\$PPID &
+	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) / \`\n" >logs/$LOGFILE
 EOF
 ) >> $MKFILE.tmp
 }
 
 
-
-unset wrt_touch
 #----------------------------------#
-wrt_touch() {                      #
+CHROOT_Unpack() {                  #
 #----------------------------------#
+  local FILE=$1
+  local optSAVE_PREVIOUS=$2
+
+  if [ "${optSAVE_PREVIOUS}" != "1" ]; then
 (
 cat << EOF
-	@\$(call housekeeping)
+	@\$(call remove_existing_dirs2,$FILE)
 EOF
 ) >> $MKFILE.tmp
-}
-
-unset wrt_RunAsUser
-#----------------------------------#
-wrt_RunAsUser() {                  # Execute script inside time { }, footer to log file
-#----------------------------------#
-  local this_script=$1
-  local file=$2
-
+  fi
 (
-cat << EOF
-	@( time { \$(SU_LUSER) "source \$(LUSER_HOME)/.bashrc && \$(CMDSDIR)/`dirname $file`/\$@" >> logs/\$@ 2>&1; } ) 2>> logs/\$@ && \\
-	\$(PRT_DU) >> logs/\$@
+cat  << EOF
+	@\$(call unpack3,$FILE)
+	@\$(call get_pkg_root2)
 EOF
 ) >> $MKFILE.tmp
 }
 
 
 #----------------------------------#
-wrt_RunAsRoot() {                  # Some scripts must be run as root..
+CHROOT_wrt_test_log() {            #
 #----------------------------------#
-  local ENV_MOUNT
-  local this_script=$1
-  local file=$2
-
-  case ${PROGNAME} in
-    lfs   ) MOUNT_ENV="LFS" ;;
-    blfs  ) MOUNT_ENV="BLFS" ;;
-    clfs  ) MOUNT_ENV="CLFS" ;;
-    clfs2 ) MOUNT_ENV="CLFS" ;;
-    hlfs  ) MOUNT_ENV="HLFS" ;;
-    *) echo "undefined progname $PROGNAME"; exit 1
-  esac
-
+  local TESTLOGFILE=$1
 (
-cat << EOF
-	@( time { export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
-	\$(PRT_DU_CR) >>logs/\$@
+cat  << EOF
+	@echo "export TEST_LOG=/\$(SCRIPT_ROOT)/test-logs/$TESTLOGFILE" >> envars && \\
+	echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
 EOF
 ) >> $MKFILE.tmp
 }
 
+
 #----------------------------------#
-wrt_run_as_root2() {               #
+CHROOT_wrt_RunAsRoot() {           #
 #----------------------------------#
-  local this_script=$1
-  local file=$2
+  local file=$1
 (
 cat << EOF
-	@( time { source envars && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
-	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \`\n" >>logs/\$@
+	@( time { source envars && \$(crCMDSDIR)/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
+	\$(PRT_DU_CR) >>logs/$this_script
 EOF
 ) >> $MKFILE.tmp
+
 }
 
 
-unset wrt_run_as_chroot1
 #----------------------------------#
-wrt_run_as_chroot1() {             #
+CHROOT_wrt_CopyFstab() {           #
 #----------------------------------#
-  local this_script=$1
-  local file=$2
 (
 cat << EOF
-	@( time { \$(CHROOT1) 'cd \$(SCRIPT_ROOT) && source envars && \$(crCMDSDIR)/$file >>logs/${this_script} 2>&1' ; } ) 2>>logs/${this_script} && \\
-	\$(PRT_DU_CR) >> logs/${this_script}
+	@( time { cp -v /sources/fstab /etc/fstab >>logs/${this_script} 2>&1 ; } ) 2>>logs/${this_script}
 EOF
 ) >> $MKFILE.tmp
 }
 
-unset wrt_run_as_chroot2
+
 #----------------------------------#
-wrt_run_as_chroot2() {             #
+CHROOT_wrt_RemoveBuildDirs() {     #
 #----------------------------------#
-  local this_script=$1
-  local file=$2
+  local name=$1
 (
 cat << EOF
-	@( time { \$(CHROOT2) 'cd \$(SCRIPT_ROOT) && source envars && \$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@ 2>&1' ; } ) 2>>logs/\$@ && \\
-	\$(PRT_DU_CR) >> logs/\$@
+	@\$(call remove_build_dirs2,$name)
 EOF
 ) >> $MKFILE.tmp
 }
 
-unset wrt_target
+
+unset wrt_touch
 #----------------------------------#
-wrt_target() {                     # Create target and initialize log file
+wrt_touch() {                      #
 #----------------------------------#
-  local i=$1
-  local PREV=$2
-  case $i in
-    iteration* ) local LOGFILE="\$@.log" ;;
-             * ) local LOGFILE="\$@"     ;;
-  esac
 (
 cat << EOF
-
-$i:  $PREV
-	@\$(call echo_message, Building)
-	@./progress_bar.sh \$@ \$\$PPID &
-	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >logs/$LOGFILE
+	@\$(call housekeeping)
 EOF
 ) >> $MKFILE.tmp
 }
 
+
 #----------------------------------#
-wrt_target_boot() {                # Create target and initialize log file
+wrt_blfs_tool_targets() {          #
 #----------------------------------#
-  local i=$1
-  local PREV=$2
-  case $i in
-    iteration* ) local LOGFILE="\$@.log" ;;
-             * ) local LOGFILE="\$@" ;;
-  esac
-(
-cat << EOF
 
-$i:  $PREV
-	@\$(call echo_message, Building)
-	@./progress_bar.sh \$@ \$\$PPID &
-	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
-EOF
-) >> $MKFILE.tmp
+  echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"
+
+  for file in blfs-tool-deps/* ; do
+    # Keep the script file name
+    this_script=`basename $file`
+
+    # Grab the name of the target
+    name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'`
+
+    # Find the package.
+    case $name in
+      tidy )  pkg_tarball=${TIDY_PKG} ;;
+      unzip ) pkg_tarball=${UNZIP_PKG} ;;
+      * )     pkg_tarball=$(get_package_tarball_name $name) ;;
+    esac
+
+    # Append each name of the script files to a list (this will become
+    # the names of the targets in the Makefile)
+    blfs_tool="$blfs_tool ${this_script}"
+
+    #--------------------------------------------------------------------#
+    #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
+    #--------------------------------------------------------------------#
+    #
+    # Drop in the name of the target on a new line, and the previous target
+    # as a dependency. Also call the echo_message function.
+    CHROOT_wrt_target "${this_script}" "$PREV"
+
+    # Insert instructions for unpacking the package and changing directories
+    # DocBook-XML is a zip, the build script will handle that.
+    [[ ! "$name" = "docbook-xml" ]] && CHROOT_Unpack "$pkg_tarball"
+
+    # Run the script.
+    CHROOT_wrt_RunAsRoot "$file"
+
+    # Remove the build directory(ies) except if the package build fails.
+    [[ ! "$name" = "docbook-xml" ]] && CHROOT_wrt_RemoveBuildDirs "$name"
+
+    # Touch the tracking file.
+    case $name in
+      tidy )  pkg_ver=tidy-051026 ;;
+      unzip ) pkg_ver=unzip-5.52 ;;
+      * )     pkg_ver=$(echo $pkg_tarball | sed -e 's/.tar.*//;s/.tgz//;s/.zip//') ;;
+    esac
+    echo -e "\t at touch $TRACKING_DIR/$pkg_ver" >>  $MKFILE.tmp
+
+    # Include a touch of the target name so make can check
+    # if it's already been made.
+    wrt_touch
+    #
+    #--------------------------------------------------------------------#
+    #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
+    #--------------------------------------------------------------------#
+
+    # Keep the script file name for Makefile dependencies.
+    PREV=${this_script}
+  done
 }
 
+#------------------------------------------------------#
+#        END Makefile scripting functions              #
+#------------------------------------------------------#
 
 
+
 #----------------------------#
 run_make() {                 #
 #----------------------------#
   # Test if make must be run.
   if [ "$RUNMAKE" = "y" ] ; then
     # Test to make sure we're running the build as root
-    if [ "$UID" != "0" ] ; then
-      echo "You must be logged in as root to successfully build the system."
+    if [ "$UID" = "0" ] ; then
+      echo "You must not be logged in as root to build the system."
       exit 1
     fi
     # Build the system
@@ -427,7 +417,7 @@
     fi
     # Test to make sure that the build directory was populated by jhalfs
     if [ ! -d $JHALFSDIR ] || [ ! -d $BUILDDIR/sources ] ; then
-      echo "Looks like $BUILDDIR was not populated by a previous jhalfs run."
+      echo "Looks like $BUILDDIR was not populated by a previous jhalfs-X run."
       exit 1
     else
       # Clean the build directory
@@ -586,6 +576,7 @@
 
   # Done. Moving on...
   get_sources
+
 }
 
 #----------------------------#
@@ -615,6 +606,9 @@
 cat << EOF
 $LIBXML_PKG
 $LIBXSLT_PKG
+$TIDY_PKG
+$UNZIP_PKG
+$DBXML_PKG
 $DBXSL_PKG
 $LINKS_PKG
 $SUDO_PKG
@@ -799,6 +793,7 @@
   if [[ "${BLFS_TOOL}" = "y" ]]; then
     add_blfs_deps_urls
   fi
+
 }
 
 #----------------------------# Hardcoded URLs and MD5.
@@ -815,6 +810,19 @@
     echo "${LIBXSLT_URL} ${BLFS_SERVER}libxslt/${LIBXSLT_PKG} ${LIBXSLT_MD5}" >> urls.lst
   fi
 
+  if [[ "${DEP_TIDY}" = "y" ]] ; then
+    echo "${TIDY_URL} ${BLFS_SERVER}tidy/${TIDY_PKG} ${TIDY_MD5}" >> urls.lst
+    echo "${TIDY_PATCH_URL} ${BLFS_SERVER}tidy/${TIDY_PATCH} ${TIDY_PATCH_MD5}" >> urls.lst
+  fi
+
+  if [[ "${DEP_UNZIP}" = "y" ]] ; then
+    echo "${UNZIP_URL} ${BLFS_SERVER}unzip/${UNZIP_PKG} ${UNZIP_MD5}" >> urls.lst
+  fi
+
+  if [[ "${DEP_DBXML}" = "y" ]] ; then
+    echo "${DBXML_URL} ${BLFS_SERVER}docbook-xml/${DBXML_PKG} ${DBXML_MD5}" >> urls.lst
+  fi
+
   if [[ "${DEP_DBXSL}" = "y" ]] ; then
     echo "${DBXSL_URL} ${BLFS_SERVER}docbook-xsl/${DBXSL_PKG} ${DBXSL_MD5}" >> urls.lst
   fi
@@ -858,28 +866,40 @@
     mv blfs-tool-deps/902-libxslt ${PROGNAME}-commands/blfs-tool-deps
   fi
 
+  if [[ "${DEP_TIDY}" = "y" ]] ; then
+    mv blfs-tool-deps/903-tidy ${PROGNAME}-commands/blfs-tool-deps
+  fi
+
+  if [[ "${DEP_UNZIP}" = "y" ]] ; then
+    mv blfs-tool-deps/904-unzip ${PROGNAME}-commands/blfs-tool-deps
+  fi
+
+  if [[ "${DEP_DBXML}" = "y" ]] ; then
+    mv blfs-tool-deps/905-docbook-xml ${PROGNAME}-commands/blfs-tool-deps
+  fi
+
   if [[ "${DEP_DBXSL}" = "y" ]] ; then
-    mv blfs-tool-deps/903-docbook-xsl ${PROGNAME}-commands/blfs-tool-deps
+    mv blfs-tool-deps/906-docbook-xsl ${PROGNAME}-commands/blfs-tool-deps
   fi
 
   if [[ "${DEP_LINKS}" = "y" ]] ; then
-    mv blfs-tool-deps/905-links ${PROGNAME}-commands/blfs-tool-deps
+    mv blfs-tool-deps/908-links ${PROGNAME}-commands/blfs-tool-deps
   fi
 
   if [[ "${DEP_SUDO}" = "y" ]] ; then
-    mv blfs-tool-deps/906-sudo ${PROGNAME}-commands/blfs-tool-deps
+    mv blfs-tool-deps/909-sudo ${PROGNAME}-commands/blfs-tool-deps
   fi
 
   if [[ "${DEP_WGET}" = "y" ]] ; then
-    mv blfs-tool-deps/907-wget ${PROGNAME}-commands/blfs-tool-deps
+    mv blfs-tool-deps/910-wget ${PROGNAME}-commands/blfs-tool-deps
   fi
 
   if [[ "${DEP_SVN}" = "y" ]] ; then
-    mv blfs-tool-deps/908-subversion ${PROGNAME}-commands/blfs-tool-deps
+    mv blfs-tool-deps/911-subversion ${PROGNAME}-commands/blfs-tool-deps
   fi
 
   if [[ "${DEP_GPM}" = "y" ]] ; then
-    mv blfs-tool-deps/904-gpm ${PROGNAME}-commands/blfs-tool-deps
+    mv blfs-tool-deps/907-gpm ${PROGNAME}-commands/blfs-tool-deps
   fi
 
   rm -rf blfs-tool-deps

Modified: jhalfs/trunk/common/create-sbu_du-report.sh
===================================================================
--- jhalfs/trunk/common/create-sbu_du-report.sh	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/create-sbu_du-report.sh	2006-10-02 19:32:06 UTC (rev 3146)
@@ -108,7 +108,7 @@
   echo -e "Approximate SBU time is:\t$SBU" >> "$REPORT"
 
   # Dump disk usage values
-  echo -e "\nDisk usage before unpacking the package:\t\t\t$DU1 KB or $DU1MB MB" >> "$REPORT"
+  echo -e "\nDisk usage before unpacking the package:\t\t$DU1 KB or $DU1MB MB" >> "$REPORT"
   echo -e "Disk usage before deleting the source and build dirs:\t$DU2 KB or $DU2MB MB" >> "$REPORT"
   echo -e "Required space to build the package:\t\t\t$REQUIRED1 KB or $REQUIRED2 MB\n" >> "$REPORT"
 

Modified: jhalfs/trunk/common/func_check_version.sh
===================================================================
--- jhalfs/trunk/common/func_check_version.sh	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/func_check_version.sh	2006-10-02 19:32:06 UTC (rev 3146)
@@ -2,10 +2,10 @@
 
 check_version() {
 : <<inline_doc
-      Tests for a minimum version level. Compares to version numbers and forces an 
+      Tests for a minimum version level. Compares to version numbers and forces an
         exit if minimum level not met.
       NOTE: This test will fail on versions containing alpha chars. ie. jpeg 6b
-    
+
     usage:	check_version "2.6.2" "`uname -r`"         "KERNEL"
 		check_version "3.0"   "$BASH_VERSION"      "BASH"
 		check_version "3.0"   "`gcc -dumpversion`" "GCC"
@@ -22,6 +22,7 @@
 
   declare -i major minor revision change
   declare -i ref_major ref_minor ref_revision ref_change
+  declare -r spaceSTR="         "
 
   ref_version=$1
   tst_version=$2
@@ -30,20 +31,16 @@
   # This saves us the save/restore hassle of the system IFS value
   local IFS
 
-#  if  echo $ref_version | grep [[:alpha:]] 2>&1 >/dev/null || 
-#      echo $tst_version | grep [[:alpha:]] 2>&1 >/dev/null ;then
-#    echo "Cannot test for text, 0.0.0a, version types, assuming 'success' " 
-#    return    
-#  fi
-    
   write_error_and_die() {
      echo -e "\n\t\t$TXT version -->${tst_version}<-- is too old.
 		    This script requires ${ref_version} or greater\n"
      exit 1
   }
 
-  echo -ne "$TXT:\t${L_arrow}${BOLD}${tst_version}${OFF}${R_arrow}"
-  IFS=".-("   # Split up w.x.y.z as well as w.x.y-rc  (catch release candidates)
+  echo -ne "${TXT}${dotSTR:${#TXT}} ${L_arrow}${BOLD}${tst_version}${OFF}${R_arrow}"
+
+#  echo -ne "$TXT:\t${L_arrow}${BOLD}${tst_version}${OFF}${R_arrow}"
+  IFS=".-(p"   # Split up w.x.y.z as well as w.x.y-rc  (catch release candidates)
   set -- $ref_version # set postional parameters to minimum ver values
   ref_major=$1; ref_minor=$2; ref_revision=$3
   #
@@ -51,15 +48,111 @@
   major=$1; minor=$2; revision=$3
   #
   # Compare against minimum acceptable version..
-  (( major > ref_major )) && echo " ..OK" && return
+  (( major > ref_major )) && echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF}" && return
   (( major < ref_major )) && write_error_and_die
     # major=ref_major
   (( minor < ref_minor )) && write_error_and_die
-  (( minor > ref_minor )) && echo " ..OK" && return
+  (( minor > ref_minor )) && echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF}" && return
     # minor=ref_minor
-  (( revision >= ref_revision )) && echo " ..OK" && return
+  (( revision >= ref_revision )) && echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF}" && return
 
   # oops.. write error msg and die
   write_error_and_die
 }
+#  local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
 
+#----------------------------#
+check_prerequisites() {      #
+#----------------------------#
+
+  # LFS/HLFS/CLFS prerequisites
+  if [ ! "${PROGNAME}" = "hlfs" ]; then
+    check_version "2.6.2"    "`uname -r`"                                     "KERNEL"
+    check_version "2.0.5"    "$BASH_VERSION"                                  "BASH"
+    check_version "3.0.0"    "`gcc -dumpversion`"                             "GCC"
+    libcVer="`/lib/libc.so.6 | head -n1`"
+    libcVer="${libcVer##*version }"
+    check_version "2.2.5"    ${libcVer%%,*}                                     "GLIBC"
+    check_version "2.12"     "$(ld --version  | head -n1 | cut -d" " -f4)"      "BINUTILS"
+    check_version "1.14"     "$(tar --version | head -n1 | cut -d" " -f4)"      "TAR"
+    bzip2Ver="$(bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f8)"
+    check_version "1.0.2"    "${bzip2Ver%%,*}"                                   "BZIP2"
+    check_version "5.0"      "$(chown --version | head -n1 | cut -d")" -f2)"     "COREUTILS"
+    check_version "2.8"      "$(diff --version  | head -n1 | cut -d" " -f4)"     "DIFF"
+    check_version "4.1.20"   "$(find --version  | head -n1 | cut -d" " -f4)"     "FIND"
+    check_version "3.0"      "$(gawk --version  | head -n1 | cut -d" " -f3)"     "GAWK"
+    check_version "2.5"      "$(grep --version  | head -n1 | cut -d" " -f4)"     "GREP"
+    check_version "1.2.4"    "$(gzip --version 2>&1 | head -n1 | cut -d" " -f2)" "GZIP"
+    check_version "3.79.1"   "$(make --version  | head -n1 | cut -d " " -f3)"    "MAKE"
+    check_version "2.5.4"    "$(patch --version | head -n1 | cut -d" " -f2)"     "PATCH"
+    check_version "3.0.2"    "$(sed --version   | head -n1 | cut -d" " -f4)"     "SED"
+  else
+    # HLFS prerequisites
+    check_version "2.6.2" "$(uname -r)"                                  "KERNEL"
+    check_version "3.0"   "$BASH_VERSION"                                "BASH"
+    check_version "3.0"   "$(gcc -dumpversion)"                          "GCC"
+    check_version "1.14"  "$(tar --version | head -n1 | cut -d" " -f4)"  "TAR"
+  fi
+
+  # Check for minimum sudo version
+  SUDO_LOC="$(whereis -b sudo | cut -d" " -f2)"
+  if [ -x $SUDO_LOC ]; then
+    sudoVer="$(sudo -V | head -n1 | cut -d" " -f3)"
+    check_version "1.6.8"  "${sudoVer}"      "SUDO"
+  else
+    echo "${nl_}\"${RED}sudo${OFF}\" ${BOLD}must be installed on your system for jhalfs to run"
+    exit 1
+  fi
+
+  # Check for minimum libxml2 and libxslt versions
+  xsltprocVer=$(xsltproc -V | head -n1 )
+  libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
+  libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
+
+  # Version numbers are packed strings not xx.yy.zz format.
+  check_version "2.06.20"  "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}"     "LIBXML2"
+  check_version "1.01.14"  "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}"  "LIBXSLT"
+
+  # The next versions checks are required only when BLFS_TOOL is set and
+  # this dependencies has not be selected for installation
+  if [[ "$BLFS_TOOL" = "y" ]] ; then
+
+    if [[ -z "$DEP_TIDY" ]] ; then
+      tidyVer=$(tidy -V | cut -d " " -f9)
+      check_version "2004" "${tidyVer}" "TIDY"
+    fi
+
+    # Check if the proper DocBook-XML-DTD and DocBook-XSL are correctly installed
+XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
+<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
+<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'
+  'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd'>
+<article>
+  <title>Test file</title>
+  <sect1>
+    <title>Some title</title>
+    <para>Some text</para>
+  </sect1>
+</article>"
+
+    if [[ -z "$DEP_DBXML" ]] ; then
+      if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
+        check_version "4.4" "4.4" "DocBook XML DTD"
+      else
+        echo "Warning: not found a working DocBook XML DTD 4.4 installation"
+        exit 2
+      fi
+    fi
+
+    if [[ -z "$DEP_DBXSL" ]] ; then
+      if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
+        check_version "1.69.1" "1.69.1" "DocBook XSL"
+      else
+        echo "Warning: not found a working DocBook XSL 1.69.1 installation"
+        exit 2
+      fi
+    fi
+
+  fi # end BLFS_TOOL=Y
+
+}
\ No newline at end of file

Modified: jhalfs/trunk/common/func_compare.sh
===================================================================
--- jhalfs/trunk/common/func_compare.sh	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/func_compare.sh	2006-10-02 19:32:06 UTC (rev 3146)
@@ -11,7 +11,7 @@
       wrt_system_build "$N" "$PREV_IT"
     fi
     this_script=$ITERATION
-    wrt_target "$ITERATION" "$PREV"
+    CHROOT_wrt_target "$ITERATION" "$PREV"
     wrt_compare_work "$ITERATION" "$PREV_IT"
     wrt_logs "$N"
     PREV_IT=$ITERATION
@@ -26,13 +26,27 @@
   local PREV_IT=$2
 
   if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "chroot" ]] ; then
-    final_system_Makefiles $RUN
+    chroot_final_system_Makefiles $RUN
   elif [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
-    bm_final_system_Makefiles $RUN
+    boot_final_system_Makefiles $RUN
   else
     chapter6_Makefiles $RUN
   fi
 
+  if [[ "$PROGNAME" = "clfs" ]] ; then
+    basicsystem="$basicsystem $PREV_IT $system_build"
+  else
+    chapter6="$chapter6 $PREV_IT $system_build"
+  fi
+
+  if [[ "$RUN" = "$ITERATIONS" ]] ; then
+    if [[ "$PROGNAME" = "clfs" ]] ; then
+      basicsystem="$basicsystem iteration-$RUN"
+    else
+      chapter6="$chapter6 iteration-$RUN"
+    fi
+  fi
+
   echo -e "\nsystem_build_$RUN: $PREV_IT $system_build" >> $MKFILE.tmp
 }
 
@@ -44,15 +58,10 @@
   local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
 /sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
 
-  if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
-    local    ROOT_DIR=/
-    local DEST_TOPDIR=/${SCRIPT_ROOT}
-    local   ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
-    local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
-  else
-    local    ROOT_DIR=$BUILDDIR
-    local DEST_TOPDIR=$BUILDDIR/${SCRIPT_ROOT}
-  fi
+  local    ROOT_DIR=/
+  local DEST_TOPDIR=/${SCRIPT_ROOT}
+  local   ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
+  local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
 
   if [[ "$RUN_ICA" = "y" ]] ; then
     local DEST_ICA=$DEST_TOPDIR/ICA && \

Modified: jhalfs/trunk/common/func_validate_configs.sh
===================================================================
--- jhalfs/trunk/common/func_validate_configs.sh	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/func_validate_configs.sh	2006-10-02 19:32:06 UTC (rev 3146)
@@ -26,7 +26,7 @@
   local -r   lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                             TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL"
   local -r  blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"
 
-  local -r  blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR DEP_LIBXML DEP_LIBXSLT DEP_DBXSL DEP_LINKS DEP_SUDO DEP_WGET DEP_SVN DEP_GPM"
+  local -r  blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_UNZIP DEP_DBXML DEP_DBXSL DEP_LINKS DEP_SUDO DEP_WGET DEP_SVN DEP_GPM"
 
   local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
   local -r ERROR_MSG_pt2='rerun make and fix your configuration settings${OFF}'

Modified: jhalfs/trunk/common/makefile-functions
===================================================================
--- jhalfs/trunk/common/makefile-functions	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/makefile-functions	2006-10-02 19:32:06 UTC (rev 3146)
@@ -1,18 +1,53 @@
 
 # $Id$
 
-BOLD= ""
-RED= ""
-GREEN= ""
-ORANGE= ""
-BLUE= ""
-WHITE= ""
+BOLD    = ""
+RED     = ""
+GREEN   = ""
+ORANGE  = ""
+BLUE    = ""
+WHITE   = ""
+YELLOW  = ""
 
+OFF     = ""
+BOLD    = ""
+REVERSE = ""
+
+
+define echo_PHASE
+  @clear
+  @echo $(BOLD)--------------------------------------------------------------------------------
+  @echo Executing $(BLUE)$(1)$(WHITE) scripts
+  @echo $(BOLD)--------------------------------------------------------------------------------
+  #echo $(WHITE)
+endef
+
+define echo_SU_request
+  @echo $(BOLD)--------------------------------------------------------------------------------
+  @echo $(BLUE)$@
+  @echo $(WHITE)ROOT privilege is required to perform a number commands
+  @echo sudo will request a password to all high privilege cmds to execute correctly
+endef
+
+define echo_SULUSER_request
+  @clear
+  @echo $(BOLD)--------------------------------------------------------------------------------
+  @echo $(BOLD)$(BLUE)$@
+  @echo $(WHITE)You are going to log into the user account $(BOLD)$(YELLOW)$(LUSER)$(OFF)
+  @echo su requires a password 
+endef
+
+define echo_CHROOT_request
+  @clear
+  @echo $(BOLD)--------------------------------------------------------------------------------
+  @echo $(BOLD)$(BLUE)$@
+  @echo $(WHITE)You are going to CHROOT into $(MOUNT_PT) $(BOLD)$(YELLOW)$(LUSER)$(OFF)
+  @echo a password is required
+endef
+
 define echo_message
-  @echo $(BOLD)
-  @echo --------------------------------------------------------------------------------
-  @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)
-  @echo $(WHITE)
+  @echo $(BOLD)--------------------------------------------------------------------------------
+  @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)$(WHITE)
 endef
 
 define remove_existing_dirs
@@ -23,7 +58,7 @@
 endef
 
 define remove_existing_dirs2
-  @PKG_PATH=\`ls -t $(SRC)/$(1) | head -n1\` && \
+  @PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \
   ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
   rm -rf $(SRC)/$$ROOT && \
   rm -rf $(SRC)/$${ROOT%-*}-build
@@ -44,7 +79,7 @@
 define housekeeping
   @touch  $@ && \
   sleep .25 && \
-  echo -e "\n\n "$(BOLD)Target $(BLUE)$@ $(BOLD)OK && \
+  echo  -e "\n" $(BOLD)Target $(BLUE)$@ $(WHITE)$(BOLD)OK && \
   echo --------------------------------------------------------------------------------$(WHITE)
 
 endef
@@ -64,6 +99,11 @@
   echo "export PKGDIR=$(SRC)/$$ROOT" > envars
 endef
 
+define get_pkg_root_LUSER
+  @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
+  echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars
+endef
+
 define unpack
   @cd $(SRCSDIR) && \
   tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)

Modified: jhalfs/trunk/common/progress_bar.sh
===================================================================
--- jhalfs/trunk/common/progress_bar.sh	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/common/progress_bar.sh	2006-10-02 19:32:06 UTC (rev 3146)
@@ -36,7 +36,7 @@
 }
 
   # initialize screen
-write_or_exit "${RESET_LINE}${TS_POSITION}0 min. 0 sec. "
+write_or_exit "${RESET_LINE}${TS_POSITION}0 min. 0 sec"
 
   # loop forever..
 while true ; do

Modified: jhalfs/trunk/jhalfs
===================================================================
--- jhalfs/trunk/jhalfs	2006-10-01 15:53:03 UTC (rev 3145)
+++ jhalfs/trunk/jhalfs	2006-10-02 19:32:06 UTC (rev 3146)
@@ -159,7 +159,8 @@
        branch-* )  BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-}/BOOK ;;
               * )  BLFS_TREE=tags/${BLFS_BRANCH_ID}/BOOK ;;
   esac
-  # dependencies envars, to can update it more easy.
+  # Dependencies envars, to can update it more easy.
+  # Tidy and Unzip version are harcoded also in wrt_blfs_tool_targets()
     # libxml2
   LIBXML_PKG="libxml2-2.6.26.tar.gz"
   LIBXML_URL="ftp://xmlsoft.org/libxml2/${LIBXML_PKG}"
@@ -168,6 +169,22 @@
   LIBXSLT_PKG="libxslt-1.1.17.tar.gz"
   LIBXSLT_URL="ftp://xmlsoft.org/libxslt/${LIBXSLT_PKG}"
   LIBXSLT_MD5="fde6a7a93c0eb14cba628692fa3a1000"
+    # tidy
+  TIDY_PKG="tidy_src_051026.tgz"
+  TIDY_URL="http://tidy.sourceforge.net/src/${TIDY_PKG}"
+  TIDY_MD5="1e39fafd6808978871346658c8da1454"
+    # tidy patch
+  TIDY_PATCH="tidy-051026-prevent_PRE_newlines-1.patch"
+  TIDY_PATCH_URL="http://www.linuxfromscratch.org/patches/blfs/svn/${TIDY_PATCH}"
+  TIDY_PATCH_MD5="82f67f7af58fc2c945b3410ae655cc1a"
+    # unzip
+  UNZIP_PKG="unzip552.tar.gz"
+  UNZIP_URL="ftp://ftp.info-zip.org/pub/infozip/src/${UNZIP_PKG}"
+  UNZIP_MD5="9d23919999d6eac9217d1f41472034a9"
+    # DocBook XML DTD
+  DBXML_PKG="docbook-xml-4.4.zip"
+  DBXML_URL="http://www.docbook.org/xml/4.4/${DBXML_PKG}"
+  DBXML_MD5="cbb04e9a700955d88c50962ef22c1634"
     # DocBook XSL
   DBXSL_PKG="docbook-xsl-1.69.1.tar.bz2"
   DBXSL_URL="http://prdownloads.sourceforge.net/docbook/${DBXSL_PKG}"
@@ -241,13 +258,9 @@
 ###          MAIN               ###
 ###################################
 
-# Check for minimum bash,tar,gcc and kernel versions
+# Check for build prereequisites.
 echo
-check_version "2.6.2" "`uname -r`"         "KERNEL"
-check_version "3.0"   "$BASH_VERSION"      "BASH"
-check_version "3.0"   "`gcc -dumpversion`" "GCC"
-tarVer=`tar --version | head -n1 | cut -d " " -f4`
-check_version "1.15.0" "${tarVer}"      "TAR"
+  check_prerequisites
 echo "${SD_BORDER}${nl_}"
 
 validate_config
@@ -359,6 +372,7 @@
   sed -i 's,tracking-dir,'$TRACKING_DIR',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,gen-makefile.sh}
   # Copy the dependencies build scripts
   cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/
+  rm -rf $JHALFSDIR/blfs-tool-deps/.svn
 fi
 
 get_book
@@ -369,7 +383,7 @@
   echo -n "Downloading the BLFS document, $BLFS_BRANCH_ID version... "
   if [[ ! -d ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} ]] ; then
     mkdir -p ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML}
-    svn co $SVN/BLFS/$TREE ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} >>$LOGDIR/$LOG 2>&1
+    svn co $SVN/BLFS/$BLFS_TREE ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} >>$LOGDIR/$LOG 2>&1
   else
     pushd ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} 1> /dev/null
       svn up >>$LOGDIR/$LOG 2>&1




More information about the alfs-log mailing list