r2967 - in jhalfs/trunk: . CLFS CLFS2 HLFS LFS common

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Wed Aug 16 10:42:59 PDT 2006


Author: manuel
Date: 2006-08-16 11:42:54 -0600 (Wed, 16 Aug 2006)
New Revision: 2967

Modified:
   jhalfs/trunk/CLFS/clfs.xsl
   jhalfs/trunk/CLFS/config
   jhalfs/trunk/CLFS/master.sh
   jhalfs/trunk/CLFS2/clfs2.xsl
   jhalfs/trunk/CLFS2/config
   jhalfs/trunk/CLFS2/master.sh
   jhalfs/trunk/Config.in
   jhalfs/trunk/HLFS/config
   jhalfs/trunk/HLFS/hlfs.xsl
   jhalfs/trunk/HLFS/master.sh
   jhalfs/trunk/LFS/config
   jhalfs/trunk/LFS/lfs.xsl
   jhalfs/trunk/LFS/master.sh
   jhalfs/trunk/Makefile
   jhalfs/trunk/common/common-functions
   jhalfs/trunk/common/config
   jhalfs/trunk/common/func_compare.sh
   jhalfs/trunk/common/func_validate_configs.sh
   jhalfs/trunk/common/makefile-functions
   jhalfs/trunk/master.sh
Log:
Ported Makefile clean-up and 0/1 to n/y migration code from experimental.
There is no obvious bugs, let users to find hidden bugs.

Modified: jhalfs/trunk/CLFS/clfs.xsl
===================================================================
--- jhalfs/trunk/CLFS/clfs.xsl	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/CLFS/clfs.xsl	2006-08-16 17:42:54 UTC (rev 2967)
@@ -28,13 +28,13 @@
   <xsl:param name="testsuite" select="1"/>
 
   <!-- Bomb on test suites failures?
-       0 = no, I want to build the full system and review the logs
-       1 = yes, bomb at the first test suite failure to can review the build dir
+       n = no, I want to build the full system and review the logs
+       y = yes, bomb at the first test suite failure to can review the build dir
   -->
-  <xsl:param name="bomb-testsuite" select="0"/>
+  <xsl:param name="bomb-testsuite" select="n"/>
 
   <!-- Install vim-lang package? -->
-  <xsl:param name="vim-lang" select="1"/>
+  <xsl:param name="vim-lang" select="y"/>
 
   <!-- Time zone -->
   <xsl:param name="timezone" select="GMT"/>
@@ -102,7 +102,7 @@
             </xsl:choose>
             <xsl:if test="sect2[@role='installation']">
               <xsl:text>cd $PKGDIR&#xA;</xsl:text>
-              <xsl:if test="@id='ch-system-vim' and $vim-lang = '1'">
+              <xsl:if test="@id='ch-system-vim' and $vim-lang = 'y'">
                 <xsl:text>tar -xvf ../vim-&vim-version;-lang.* --strip-components=1&#xA;</xsl:text>
               </xsl:if>
             </xsl:if>
@@ -125,7 +125,7 @@
             contains(string(),'check')) and
             ($testsuite = '2' or $testsuite = '3')">
       <xsl:choose>
-        <xsl:when test="$bomb-testsuite = '0'">
+        <xsl:when test="$bomb-testsuite = 'n'">
           <xsl:value-of select="substring-before(string(),'make')"/>
           <xsl:text>make -k</xsl:text>
           <xsl:value-of select="substring-after(string(),'make')"/>
@@ -197,7 +197,7 @@
             </xsl:if>
             <xsl:if test="contains(string(),'check')">
               <xsl:choose>
-                <xsl:when test="$bomb-testsuite = '0'">
+                <xsl:when test="$bomb-testsuite = 'n'">
                   <xsl:value-of select="substring-before(string(),'check')"/>
                   <xsl:text>-k check</xsl:text>
                   <xsl:value-of select="substring-after(string(),'check')"/>
@@ -222,7 +222,7 @@
         <xsl:choose>
           <xsl:when test="$testsuite != '0'">
             <xsl:choose>
-              <xsl:when test="$bomb-testsuite = '0'">
+              <xsl:when test="$bomb-testsuite = 'n'">
                 <xsl:text>make -k check >> $TEST_LOG 2>&1 || true&#xA;</xsl:text>
               </xsl:when>
               <xsl:otherwise>
@@ -242,7 +242,7 @@
           <xsl:when test="$testsuite != '0'">
             <xsl:value-of select="substring-before(string(),'>g')"/>
             <xsl:choose>
-              <xsl:when test="$bomb-testsuite = '0'">
+              <xsl:when test="$bomb-testsuite = 'n'">
                 <xsl:text>>> $TEST_LOG 2>&1 || true&#xA;</xsl:text>
               </xsl:when>
               <xsl:otherwise>

Modified: jhalfs/trunk/CLFS/config
===================================================================
--- jhalfs/trunk/CLFS/config	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/CLFS/config	2006-08-16 17:42:54 UTC (rev 2967)
@@ -54,8 +54,8 @@
 BOOT_CONFIG=
 
 # Get the kernel package and patches even if no configutation file
-# has been supplied? 0(no)/1(yes)
-GETKERNEL=0
+# has been supplied? n(no)/y(yes)
+GETKERNEL=n
 
 #--- Book's sources directory
 # If you have previously checked out the book from the repository

Modified: jhalfs/trunk/CLFS/master.sh
===================================================================
--- jhalfs/trunk/CLFS/master.sh	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/CLFS/master.sh	2006-08-16 17:42:54 UTC (rev 2967)
@@ -6,7 +6,6 @@
 ###################################
 
 
-
 #----------------------------#
 host_prep_Makefiles() {      # Initialization of the system
 #----------------------------#
@@ -498,7 +497,7 @@
     # Test if the stripping phase must be skipped.
     # Skip alsp temp-perl for iterative runs
     case $this_script in
-      *stripping*) [[ "$STRIP" = "0" ]] && continue ;;
+      *stripping*) [[ "$STRIP" = "n" ]] && continue ;;
       *temp-perl*) [[ -n "$N" ]] && continue ;;
     esac
 
@@ -608,7 +607,7 @@
     # Test if the stripping phase must be skipped
     # Skip alsp temp-perl for iterative runs
     case $this_script in
-      *stripping*) [[ "$STRIP" = "0" ]] && continue ;;
+      *stripping*) [[ "$STRIP" = "n" ]] && continue ;;
       *temp-perl*) [[ -n "$N" ]] && continue ;;
     esac
 
@@ -883,7 +882,7 @@
   done
 
   # Add SBU-disk_usage report target if required
-  if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
+  if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
 
 }
 
@@ -962,7 +961,7 @@
   done
 
   # Add SBU-disk_usage report target if required
-  if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
+  if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
 
 }
 
@@ -986,7 +985,7 @@
     fi
     final_system_Makefiles         # $basicsystem
     # Add the iterations targets, if needed
-    [[ "$COMPARE" != "0" ]] && wrt_compare_targets
+    [[ "$COMPARE" = "y" ]] && wrt_compare_targets
     bootscripts_Makefiles          # $bootscripttools
     bootable_Makefiles             # $bootabletools
   else
@@ -996,7 +995,7 @@
     fi
     bm_final_system_Makefiles      # $basicsystem
     # Add the iterations targets, if needed
-    [[ "$COMPARE" != "0" ]] && wrt_compare_targets
+    [[ "$COMPARE" = "y" ]] && wrt_compare_targets
     bm_bootscripts_Makefiles       # $bootscipttools
     bm_bootable_Makefiles          # $bootabletoosl
   fi
@@ -1009,12 +1008,30 @@
     cat << EOF
 $HEADER
 
-SRC= /sources
-MOUNT_PT= $BUILDDIR
-PKG_LST= $PKG_LST
-LUSER= $LUSER
-LGROUP= $LGROUP
+SRC          = /sources
+MOUNT_PT     = $BUILDDIR
+PKG_LST      = $PKG_LST
+LUSER        = $LUSER
+LGROUP       = $LGROUP
+SCRIPT_ROOT  = $SCRIPT_ROOT
 
+BASEDIR      = \$(MOUNT_PT)
+SRCSDIR      = \$(BASEDIR)/sources
+CMDSDIR      = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
+LOGDIR       = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs
+TESTLOGDIR   = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs
+
+crSRCSDIR    = /sources
+crCMDSDIR    = /\$(SCRIPT_ROOT)/$PROGNAME-commands
+crLOGDIR     = /\$(SCRIPT_ROOT)/logs
+crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs
+
+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"
+
+
 include makefile-functions
 
 EOF

Modified: jhalfs/trunk/CLFS2/clfs2.xsl
===================================================================
--- jhalfs/trunk/CLFS2/clfs2.xsl	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/CLFS2/clfs2.xsl	2006-08-16 17:42:54 UTC (rev 2967)
@@ -17,7 +17,7 @@
   <xsl:param name="keymap" select="none"/>
 
   <!-- Install vim-lang package? -->
-  <xsl:param name="vim-lang" select="1"/>
+  <xsl:param name="vim-lang" select="y"/>
 
   <!-- Time zone -->
   <xsl:param name="timezone" select="GMT"/>
@@ -75,7 +75,7 @@
             </xsl:if>
             <xsl:if test="sect2[@role='installation']">
               <xsl:text>cd $PKGDIR&#xA;</xsl:text>
-              <xsl:if test="@id='ch-system-vim' and $vim-lang = '1'">
+              <xsl:if test="@id='ch-system-vim' and $vim-lang = 'y'">
                 <xsl:text>tar -xvf ../vim-&vim-version;-lang.* --strip-components=1&#xA;</xsl:text>
               </xsl:if>
             </xsl:if>

Modified: jhalfs/trunk/CLFS2/config
===================================================================
--- jhalfs/trunk/CLFS2/config	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/CLFS2/config	2006-08-16 17:42:54 UTC (rev 2967)
@@ -33,8 +33,8 @@
 CONFIG=
 
 # Get the kernel package and patches even if no configutation file
-# has been supplied? 0(no)/1(yes)
-GETKERNEL=0
+# has been supplied? n(no)/y(yes)
+GETKERNEL=n
 
 #--- Book's sources directory
 # If you have previously checked out the book from the repository

Modified: jhalfs/trunk/CLFS2/master.sh
===================================================================
--- jhalfs/trunk/CLFS2/master.sh	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/CLFS2/master.sh	2006-08-16 17:42:54 UTC (rev 2967)
@@ -215,7 +215,7 @@
     # Test if the stripping phase must be skipped.
     # Skip alsp temp-perl for iterative runs
     case $this_script in
-      *stripping*) [[ "$STRIP" = "0" ]] && continue ;;
+      *stripping*) [[ "$STRIP" = "n" ]] && continue ;;
     esac
 
     # Grab the name of the target, strip id number, XXX-script
@@ -403,7 +403,7 @@
   done
 
   # Add SBU-disk_usage report target if required
-  if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
+  if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
 
 }
 
@@ -429,12 +429,23 @@
     cat << EOF
 $HEADER
 
-SRC= /sources
-MOUNT_PT= $BUILDDIR
-PKG_LST= $PKG_LST
-LUSER= $LUSER
-LGROUP= $LGROUP
+SRC         = /sources
+MOUNT_PT    = $BUILDDIR
+PKG_LST     = $PKG_LST
+LUSER       = $LUSER
+LGROUP      = $LGROUP
+SCRIPT_ROOT = $SCRIPT_ROOT
 
+BASEDIR    = \$(MOUNT_PT)
+SRCSDIR    = \$(BASEDIR)/sources
+CMDSDIR    = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
+LOGDIR     = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs
+TESTLOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs
+
+SU_LUSER   = su - \$(LUSER) -c
+PRT_DU     = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
+LUSER_HOME = /home/\$(LUSER)
+
 include makefile-functions
 
 EOF

Modified: jhalfs/trunk/Config.in
===================================================================
--- jhalfs/trunk/Config.in	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/Config.in	2006-08-16 17:42:54 UTC (rev 2967)
@@ -58,7 +58,7 @@
 	endchoice
 
 	config	BRANCH_ID
-		string	"Branch (mandatory)"
+		string	"Book Version (mandatory)"
 		default	"**EDIT ME**"
 		depends	BRANCH
 		help
@@ -250,7 +250,7 @@
 	#--- End CLFS specific params
 
 	#--- HLFS specific params
-	config	CONFIG_GRSECURITY_HOST
+	config	GRSECURITY_HOST
 		bool	"Building on grsecurity enabled host?"
 		default	n
 		depends on BOOK_HLFS
@@ -356,7 +356,7 @@
 		help
 			#-- The directory where the created system will be located.
 
-	config	CONFIG_GETPKG
+	config	GETPKG
 		bool "Retrieve source files"
 		default n
 		help
@@ -368,28 +368,28 @@
 	config SRC_ARCHIVE
 		string "Package Archive Directory"
 		default "$SRC_ARCHIVE"
-		depends CONFIG_GETPKG
+		depends GETPKG
 		help
 			#-- A local archive for packages/file (not $BUILDDIR/sources)
 			#   Used only if GETPKG = 1
 			#   Any missing file will be downloaded and archived here,
 			#   if the user has the right priviledges.
 
-	config	CONFIG_GETKERNEL
+	config	GETKERNEL
 		bool	"Always retrieve kernel package"
 		default	n
-		depends CONFIG_GETPKG
+		depends GETPKG
 		help
 			#-- Get the kernel package and patches even if no configuration
 			#   file has been supplied.
 
-	config	CONFIG_RUNMAKE
+	config	RUNMAKE
 		bool	"Run the makefile"
 		default n
 		help
 			#-- Automatically run the makefile once it has been created
 
-	config	CONFIG_REBUILD
+	config	CLEAN
 		bool	"Rebuild files"
 		default	n
 		help
@@ -409,7 +409,7 @@
 	config	CONFIG_TESTS
 		bool	"Run testsuites"
 		depends	!BOOK_CLFS2
-		default	n
+		default	y
 		help
 			#-- Run test suites
 			#
@@ -454,19 +454,20 @@
 	choice
 		prompt	"Flavour ->"
 		depends	CONFIG_TESTS
-		default	NO_BOMB
 
 		config	NO_BOMB
 			bool	"Don't stop on test suite failures"
+			default n
 
 		config	BOMB
 			bool	"Abort the build at the first test suite failure"
+			default n
 	endchoice
 
 	config	BOMB_TEST
-		int
-		default	"0"	if NO_BOMB
-		default	"1"	if BOMB
+		bool
+		default	BOMB
+
 	#--- End Test Suites
 
 	#--- FSTAB
@@ -515,15 +516,15 @@
 			#   a keymap included in the kernel
 	#--- End Kernel
 
-	config	CONFIG_STRIP
+	config	STRIP
 		bool "Strip Installed Binaries/Libraries"
 		default y
 
-	config	CONFIG_VIMLANG
+	config	VIMLANG
 		bool "Install vim-lang package"
 		default y
 		help
-			#-- install the optional vim-lang package
+			#-- Install the optional vim-lang package
 
 	config	TIMEZONE
 		string "TimeZone"
@@ -571,12 +572,12 @@
 menu "--- Advanced Features"
 	depends on !BOOK_BLFS
 
-	config	CONFIG_REPORT
+	config	REPORT
 		bool "Create SBU and disk usage report"
 		default y
 
 	#--- ICA/farce
-	config	CONFIG_COMPARE
+	config	COMPARE
 		bool "Run comparison analysis on final stage"
 		depends	!BOOK_CLFS2
 		default n
@@ -596,21 +597,21 @@
 			#
 
 	config	ITERATIONS
-		int	"Number of test runs (2,3,4,5)"
-		depends on CONFIG_COMPARE
+		int	"Number of test runs (2,3,4,5)"	if COMPARE
+		depends on COMPARE
 		range	2 5
 		default	3
 
-	config	CONFIG_ICA
+	config	RUN_ICA
 		bool	"ICA testing"
-		depends on CONFIG_COMPARE
+		depends on COMPARE
 		default y
 		help
 			#-- Run ICA testing
 
-	config	CONFIG_FARCE
+	config	RUN_FARCE
 		bool	"farce testing"
-		depends on CONFIG_COMPARE
+		depends on COMPARE
 		default n
 		help
 			#-- Run farce testing
@@ -667,61 +668,3 @@
 #		string	"BLFS packages"
 #		default	"none"
 #		depends	CONFIG_BLFS_CMDS
-
-
-# convert CONFIG_XXXX n/y to XXXX 0/1
-
-	config	GRSECURITY_HOST
-		int
-		default 0	if !CONFIG_GRSECURITY_HOST
-		default 1	if  CONFIG_GRSECURITY_HOST
-
-	config	COMPARE
-		int
-		default 0	if !CONFIG_COMPARE
-		default 1	if  CONFIG_COMPARE
-
-	config	GETPKG
-		int
-		default 0	if !CONFIG_GETPKG
-		default 1	if  CONFIG_GETPKG
-
-	config	GETKERNEL
-		int
-		default	0	if !CONFIG_GETKERNEL
-		default	1	if  CONFIG_GETKERNEL
-
-	config	RUNMAKE
-		int
-		default	0	if !CONFIG_RUNMAKE
-		default 1	if  CONFIG_RUNMAKE
-
-	config	STRIP
-		int
-		default	0	if !CONFIG_STRIP
-		default	1	if  CONFIG_STRIP
-
-	config	REPORT
-		int
-		default	0	if !CONFIG_REPORT
-		default 1	if  CONFIG_REPORT
-
-	config	VIMLANG
-		int
-		default	0	if !CONFIG_VIMLANG
-		default	1	if  CONFIG_VIMLANG
-
-	config	RUN_ICA
-		int
-		default	0	if !CONFIG_ICA
-		default	1	if  CONFIG_ICA
-
-	config	RUN_FARCE
-		int
-		default	0	if !CONFIG_FARCE
-		default	1	if  CONFIG_FARCE
-
-	config	CLEAN
-		int
-		default	0	if !CONFIG_REBUILD
-		default	1	if  CONFIG_REBUILD

Modified: jhalfs/trunk/HLFS/config
===================================================================
--- jhalfs/trunk/HLFS/config	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/HLFS/config	2006-08-16 17:42:54 UTC (rev 2967)
@@ -9,8 +9,8 @@
 #--- Which library model to use uclibc/glibc
 MODEL=glibc
 
-#--- The host system has grsecurity options enabled? 0(no)/1(yes)
-GRSECURITY_HOST=0
+#--- The host system has grsecurity options enabled? n(no)/y(yes)
+GRSECURITY_HOST=n
 
 #--- Unprivileged user and group name
 LUSER=hlfs
@@ -24,8 +24,8 @@
 CONFIG=
 
 # Get the kernel package and patches even if no configutation file
-# has been supplied? 0(no)/1(yes)
-GETKERNEL=0
+# has been supplied? n(no)/y(yes)
+GETKERNEL=n
 
 #--- Book's sources directory
 # If you have previously checked out the book from the repository

Modified: jhalfs/trunk/HLFS/hlfs.xsl
===================================================================
--- jhalfs/trunk/HLFS/hlfs.xsl	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/HLFS/hlfs.xsl	2006-08-16 17:42:54 UTC (rev 2967)
@@ -17,7 +17,7 @@
   <xsl:param name="model" select="glibc"/>
 
   <!-- Is the host kernel using grsecurity? -->
-  <xsl:param name="grsecurity_host" select="0"/>
+  <xsl:param name="grsecurity_host" select="n"/>
 
   <!-- Compile the keymap into the kernel? -->
   <xsl:param name="keymap" select="none"/>
@@ -31,10 +31,10 @@
   <xsl:param name="testsuite" select="1"/>
 
   <!-- Bomb on test suites failures?
-       0 = no, I want to build the full system and review the logs
-       1 = yes, bomb at the first test suite failure to can review the build dir
+       n = no, I want to build the full system and review the logs
+       y = yes, bomb at the first test suite failure to can review the build dir
   -->
-  <xsl:param name="bomb-testsuite" select="0"/>
+  <xsl:param name="bomb-testsuite" select="n"/>
 
   <!-- Time zone -->
   <xsl:param name="timezone" select="GMT"/>
@@ -143,7 +143,7 @@
                   contains(string(),'check')) and
                   ($testsuite = '2' or $testsuite = '3')">
       <xsl:choose>
-        <xsl:when test="$bomb-testsuite = '0'">
+        <xsl:when test="$bomb-testsuite = 'n'">
           <xsl:value-of select="substring-before(string(),'make')"/>
           <xsl:text>make -k</xsl:text>
           <xsl:value-of select="substring-after(string(),'make')"/>
@@ -180,7 +180,7 @@
       <!-- grsecurity kernel in the host? -->
       <xsl:when test="ancestor::sect1[@id='ch-system-kernfs'] and
                 contains(string(),'sysctl')
-                and $grsecurity_host ='0'"/>
+                and $grsecurity_host ='n'"/>
       <!-- Setting $LC_ALL and $LANG for /etc/profile -->
       <xsl:when test="ancestor::sect1[@id='bootable-profile'] and
                 contains(string(),'export LANG=')">
@@ -230,7 +230,7 @@
             </xsl:if>
             <xsl:if test="contains(string(),'check')">
               <xsl:choose>
-                <xsl:when test="$bomb-testsuite = '0'">
+                <xsl:when test="$bomb-testsuite = 'n'">
                   <xsl:value-of select="substring-before(string(),'check')"/>
                   <xsl:text>-k check</xsl:text>
                   <xsl:value-of select="substring-after(string(),'check')"/>
@@ -255,7 +255,7 @@
           <xsl:when test="$testsuite != '0'">
             <xsl:apply-templates/>
             <xsl:choose>
-              <xsl:when test="$bomb-testsuite = '0'">
+              <xsl:when test="$bomb-testsuite = 'n'">
                 <xsl:text> >> $TEST_LOG 2>&1 || true&#xA;</xsl:text>
               </xsl:when>
               <xsl:otherwise>
@@ -275,7 +275,7 @@
           <xsl:when test="$testsuite != '0'">
             <xsl:value-of select="substring-before(string(),'> glibc-')"/>
             <xsl:choose>
-              <xsl:when test="$bomb-testsuite = '0'">
+              <xsl:when test="$bomb-testsuite = 'n'">
                 <xsl:text> >> $TEST_LOG 2>&1 || true&#xA;</xsl:text>
               </xsl:when>
               <xsl:otherwise>

Modified: jhalfs/trunk/HLFS/master.sh
===================================================================
--- jhalfs/trunk/HLFS/master.sh	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/HLFS/master.sh	2006-08-16 17:42:54 UTC (rev 2967)
@@ -13,15 +13,22 @@
   local toolchain=$1
   local this_script=$2
   local  tc_phase
-
+  local binutil_tarball
+  local gcc_core_tarball
+  
   echo "${tab_}${tab_}${GREEN}toolchain ${L_arrow}${toolchain}${R_arrow}"
 
   #
   # Safe method to remove existing toolchain dirs
-  pkg_tarball=$(get_package_tarball_name "binutils")
-  wrt_remove_existing_dirs  "$pkg_tarball"
-  pkg_tarball=$(get_package_tarball_name "gcc-core")
-  wrt_remove_existing_dirs  "$pkg_tarball"
+  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)
+EOF
+) >> $MKFILE.tmp
+
   #
   # Manually remove the toolchain directories..
   tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's at -toolchain@@'`
@@ -53,11 +60,13 @@
       ;;
   esac
   #
-  # Safe method to remove packages unpacked while inside the toolchain script
-  pkg_tarball=$(get_package_tarball_name "binutils")
-  wrt_remove_existing_dirs  "$pkg_tarball"
-  pkg_tarball=$(get_package_tarball_name "gcc-core")
-  wrt_remove_existing_dirs  "$pkg_tarball"
+(
+cat << EOF
+	@\$(call remove_existing_dirs,$binutil_tarball)
+	@\$(call remove_existing_dirs,$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@@'`
@@ -166,7 +175,7 @@
         # Nothing interestin in this script
       *introduction* ) continue ;;
         # Test if the stripping phase must be skipped
-      *stripping* ) [[ "$STRIP" = "0" ]] && continue ;;
+      *stripping* ) [[ "$STRIP" = "n" ]] && continue ;;
       *) ;;
     esac
 
@@ -278,7 +287,7 @@
         # dependencies and target creation.
       *chroot* )  continue ;;
         # Test if the stripping phase must be skipped
-      *-stripping* )  [[ "$STRIP" = "0" ]] && continue ;;
+      *-stripping* )  [[ "$STRIP" = "n" ]] && continue ;;
     esac
 
     # Grab the name of the target
@@ -456,7 +465,7 @@
   done  # for file in chapter07/*
 
   # Add SBU-disk_usage report target if required
-  if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
+  if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
 }
 
 
@@ -473,7 +482,7 @@
   chapter5_Makefiles
   chapter6_Makefiles
   # Add the iterations targets, if needed
-  [[ "$COMPARE" != "0" ]] && wrt_compare_targets
+  [[ "$COMPARE" = "y" ]] && wrt_compare_targets
   chapter7_Makefiles
 
   # Add a header, some variables and include the function file
@@ -482,12 +491,29 @@
     cat << EOF
 $HEADER
 
-SRC= /sources
-MOUNT_PT= $BUILDDIR
-PKG_LST= $PKG_LST
-LUSER= $LUSER
-LGROUP= $LGROUP
+SRC          = /sources
+MOUNT_PT     = $BUILDDIR
+PKG_LST      = $PKG_LST
+LUSER        = $LUSER
+LGROUP       = $LGROUP
+SCRIPT_ROOT  = $SCRIPT_ROOT
 
+BASEDIR      = \$(MOUNT_PT)
+SRCSDIR      = \$(BASEDIR)/sources
+CMDSDIR      = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
+LOGDIR       = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs
+TESTLOGDIR   = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs
+
+crSRCSDIR    = /sources
+crCMDSDIR    = /\$(SCRIPT_ROOT)/$PROGNAME-commands
+crLOGDIR     = /\$(SCRIPT_ROOT)/logs
+crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs
+
+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"
+
 include makefile-functions
 
 EOF

Modified: jhalfs/trunk/LFS/config
===================================================================
--- jhalfs/trunk/LFS/config	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/LFS/config	2006-08-16 17:42:54 UTC (rev 2967)
@@ -18,8 +18,8 @@
 CONFIG=
 
 # Get the kernel package and patches even if no configuration file
-# has been supplied? 0(no)/1(yes)
-GETKERNEL=0
+# has been supplied? n(no)/y(yes)
+GETKERNEL=n
 
 #--- Book's sources directory
 # If you have previously checked out the book from the repository

Modified: jhalfs/trunk/LFS/lfs.xsl
===================================================================
--- jhalfs/trunk/LFS/lfs.xsl	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/LFS/lfs.xsl	2006-08-16 17:42:54 UTC (rev 2967)
@@ -22,13 +22,13 @@
   <xsl:param name="testsuite" select="1"/>
 
   <!-- Bomb on test suites failures?
-       0 = no, I want to build the full system and review the logs
-       1 = yes, bomb at the first test suite failure to can review the build dir
+       n = no, I want to build the full system and review the logs
+       y = yes, bomb at the first test suite failure to can review the build dir
   -->
-  <xsl:param name="bomb-testsuite" select="0"/>
+  <xsl:param name="bomb-testsuite" select="n"/>
 
   <!-- Install vim-lang package? -->
-  <xsl:param name="vim-lang" select="1"/>
+  <xsl:param name="vim-lang" select="y"/>
 
   <!-- Time zone -->
   <xsl:param name="timezone" select="GMT"/>
@@ -90,7 +90,7 @@
         </xsl:choose>
         <xsl:if test="sect2[@role='installation']">
           <xsl:text>cd $PKGDIR&#xA;</xsl:text>
-          <xsl:if test="@id='ch-system-vim' and $vim-lang = '1'">
+          <xsl:if test="@id='ch-system-vim' and $vim-lang = 'y'">
             <xsl:text>tar -xvf ../vim-&vim-version;-lang.* --strip-components=1&#xA;</xsl:text>
           </xsl:if>
         </xsl:if>
@@ -117,7 +117,7 @@
             ancestor::chapter[@id='chapter-building-system']) or
             $testsuite = '3')">
       <xsl:choose>
-        <xsl:when test="$bomb-testsuite = '0'">
+        <xsl:when test="$bomb-testsuite = 'n'">
           <xsl:value-of select="substring-before(string(),'make')"/>
           <xsl:text>make -k</xsl:text>
           <xsl:value-of select="substring-after(string(),'make')"/>
@@ -185,7 +185,7 @@
             </xsl:if>
             <xsl:if test="contains(string(),'check')">
               <xsl:choose>
-                <xsl:when test="$bomb-testsuite = '0'">
+                <xsl:when test="$bomb-testsuite = 'n'">
                   <xsl:value-of select="substring-before(string(),'check')"/>
                   <xsl:text>-k check</xsl:text>
                   <xsl:value-of select="substring-after(string(),'check')"/>
@@ -212,7 +212,7 @@
                     ancestor::chapter[@id='chapter-building-system']) or
                     $testsuite = '3'">
             <xsl:choose>
-              <xsl:when test="$bomb-testsuite = '0'">
+              <xsl:when test="$bomb-testsuite = 'n'">
                 <xsl:text>make -k check >> $TEST_LOG 2>&1 || true&#xA;</xsl:text>
               </xsl:when>
               <xsl:otherwise>

Modified: jhalfs/trunk/LFS/master.sh
===================================================================
--- jhalfs/trunk/LFS/master.sh	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/LFS/master.sh	2006-08-16 17:42:54 UTC (rev 2967)
@@ -7,7 +7,6 @@
 ###################################
 
 
-
 #----------------------------#
 chapter4_Makefiles() {
 #----------------------------#
@@ -80,7 +79,7 @@
       *tcl)       [[ "${TEST}" = "0" ]] && continue ;;
       *expect)    [[ "${TEST}" = "0" ]] && continue ;;
       *dejagnu)   [[ "${TEST}" = "0" ]] && continue ;;
-      *stripping) [[ "${STRIP}" = "0" ]] && continue ;;
+      *stripping) [[ "${STRIP}" = "n" ]] && continue ;;
       *glibc)     [[ "${TEST}" = "3" ]] && \
                   sed -i 's@/usr/lib/locale@/tools/lib/locale@' $file ;;
     esac
@@ -177,7 +176,7 @@
     # dependencies and target creation.
     case "${this_script}" in
       *chroot)      continue ;;
-      *stripping*) [[ "${STRIP}" = "0" ]] && continue ;;
+      *stripping*) [[ "${STRIP}" = "n" ]] && continue ;;
     esac
 
     # Grab the name of the target
@@ -335,7 +334,7 @@
   done  # for file in chapter0{7,8,9}/*
 
   # Add SBU-disk_usage report target if required
-  if [[ "$REPORT" = "1" ]] ; then wrt_report ; fi
+  if [[ "$REPORT" = "y" ]] ; then wrt_report ; fi
 }
 
 
@@ -352,7 +351,7 @@
   chapter5_Makefiles
   chapter6_Makefiles
   # Add the iterations targets, if needed
-  [[ "$COMPARE" != "0" ]] && wrt_compare_targets
+  [[ "$COMPARE" = "y" ]] && wrt_compare_targets
   chapter789_Makefiles
 
 
@@ -362,12 +361,30 @@
     cat << EOF
 $HEADER
 
-SRC= /sources
-MOUNT_PT= $BUILDDIR
-PKG_LST= $PKG_LST
-LUSER= $LUSER
-LGROUP= $LGROUP
+SRC          = /sources
+MOUNT_PT     = $BUILDDIR
+PKG_LST      = $PKG_LST
+LUSER        = $LUSER
+LGROUP       = $LGROUP
+SCRIPT_ROOT  = $SCRIPT_ROOT
 
+BASEDIR      = \$(MOUNT_PT)
+SRCSDIR      = \$(BASEDIR)/sources
+CMDSDIR      = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
+LOGDIR       = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs
+TESTLOGDIR   = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs
+
+crSRCSDIR    = /sources
+crCMDSDIR    = /\$(SCRIPT_ROOT)/$PROGNAME-commands
+crLOGDIR     = /\$(SCRIPT_ROOT)/logs
+crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs
+
+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"
+
+
 include makefile-functions
 
 EOF

Modified: jhalfs/trunk/Makefile
===================================================================
--- jhalfs/trunk/Makefile	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/Makefile	2006-08-16 17:42:54 UTC (rev 2967)
@@ -7,6 +7,7 @@
 CONFIG = menu
 
 all: menuconfig
+	@clear
 	@touch using_menuconfig
 	@`grep RUN_ME configuration | sed -e 's at RUN_ME=\"@@' -e 's@\"@@' ` || rm -f using_menuconfig
 	@rm -f using_menuconfig

Modified: jhalfs/trunk/common/common-functions
===================================================================
--- jhalfs/trunk/common/common-functions	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/common/common-functions	2006-08-16 17:42:54 UTC (rev 2967)
@@ -260,62 +260,110 @@
 
 }
 
+
 #----------------------------------#
-wrt_remove_existing_dirs() {       #
+wrt_test_log() {                   # Initialize testsuite log file
 #----------------------------------#
-  local PKG_NAME=$1
+  local TESTLOGFILE=$1
 (
-cat << EOF
-	@PKG_PATH=\`ls -t \$(MOUNT_PT)\$(SRC)/${PKG_NAME} | head -n1\` && \\
-	ROOT=\`tar -tf \$\$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\
-	[[ -n \$\$ROOT ]] && \\
-	rm -rf \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
-	if [ -e \$(MOUNT_PT)\$(SRC)/${PKG_NAME%-*}-build ]; then \\
-		rm -rf \$(MOUNT_PT)\$(SRC)/${PKG_NAME%-*}-build; \\
-	fi;
+cat  << EOF
+	@echo "export TEST_LOG=$TESTLOGDIR/$TESTLOGFILE" >> envars && \\
+	su - \$(LUSER) -c "echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE"
 EOF
 ) >> $MKFILE.tmp
 }
 
 #----------------------------------#
-wrt_remove_existing_dirs2() {      #
+wrt_test_log2() {                  #
 #----------------------------------#
-  local PKG_NAME=$1
+  local TESTLOGFILE=$1
 (
-cat << EOF
-	@PKG_PATH=\`ls -t \$(SRC)/${PKG_NAME} | head -n1\` && \\
-	ROOT=\`tar -tf \$\$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\
-	[[ -n \$\$ROOT ]] && \\
-	rm -rf \$(SRC)/\$\$ROOT && \\
-	if [ -e \$(SRC)/${PKG_NAME%-*}-build ]; then \\
-		rm -rf \$(SRC)/${PKG_NAME%-*}-build; \\
-	fi;
+cat  << EOF
+	@echo "export TEST_LOG=/$SCRIPT_ROOT/test-logs/$TESTLOGFILE" >> envars && \\
+	echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
 EOF
 ) >> $MKFILE.tmp
 }
 
+#----------------------------------#
+wrt_target_vars() {                # Target vars for hlfs (cross-build method)
+#----------------------------------#
+(
+cat  << EOF
+	@echo "export target=$(uname -m)-${TARGET}" >> envars && \\
+	echo "export ldso=/lib/${LOADER}" >> envars
+EOF
+) >> $MKFILE.tmp
 
+}
 
+
 #----------------------------------#
+wrt_copy_fstab() {                 #
+#----------------------------------#
+  local i=$1
+(
+    cat << EOF
+	@cp -v $FSTAB \$(MOUNT_PT)/etc/fstab >>logs/$i 2>&1
+EOF
+) >> $MKFILE.tmp
+}
+
+
+#----------------------------------#
+wrt_copy_fstab2() {                #
+#----------------------------------#
+  local i=$1
+(
+    cat << EOF
+	@cp -v /sources/fstab /etc/fstab >>logs/$i 2>&1
+EOF
+) >> $MKFILE.tmp
+}
+
+
+#----------------------------------#
+wrt_report() {                     #
+#----------------------------------#
+(
+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  \$@
+EOF
+) >> $MKFILE.tmp
+
+chapter789="$chapter789 create-sbu_du-report"
+}
+
+unset wrt_unpack
+#----------------------------------#
 wrt_unpack() {                     # Unpack and set 'ROOT' var
 #----------------------------------#
   local FILE=$1
   local optSAVE_PREVIOUS=$2
 
-  if [ "${optSAVE_PREVIOUS}" != "1" ]; then
-    wrt_remove_existing_dirs "$FILE"
+  if [[ "${optSAVE_PREVIOUS}" != "1" ]]; then
+(
+cat << EOF
+	@\$(call remove_existing_dirs,$FILE)
+EOF
+) >> $MKFILE.tmp
   fi
+
 (
 cat << EOF
 	@\$(call unpack,$FILE)
-	@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)/\$\$ROOT" > envars && \\
-	chown -R \$(LUSER) \$(MOUNT_PT)\$(SRC)/\$\$ROOT
+	@\$(call get_pkg_root)
 EOF
 ) >> $MKFILE.tmp
+
 }
 
-
+unset wrt_unpack2
 #----------------------------------#
 wrt_unpack2() {                    #
 #----------------------------------#
@@ -323,18 +371,20 @@
   local optSAVE_PREVIOUS=$2
 
   if [ "${optSAVE_PREVIOUS}" != "1" ]; then
-    wrt_remove_existing_dirs "$FILE"
+(
+cat << EOF
+	@\$(call remove_existing_dirs,$FILE)
+EOF
+) >> $MKFILE.tmp
   fi
 (
 cat  << EOF
 	@\$(call unpack2,$FILE)
-	@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	echo "export PKGDIR=\$(SRC)/\$\$ROOT" > envars
+	@\$(call get_pkg_root,nouser)
 EOF
 ) >> $MKFILE.tmp
 }
 
-
 #----------------------------------#
 wrt_unpack3() {                    #
 #----------------------------------#
@@ -342,63 +392,68 @@
   local optSAVE_PREVIOUS=$2
 
   if [ "${optSAVE_PREVIOUS}" != "1" ]; then
-    wrt_remove_existing_dirs2 "$FILE"
+(
+cat << EOF
+	@\$(call remove_existing_dirs2,$FILE)
+EOF
+) >> $MKFILE.tmp
   fi
 (
 cat  << EOF
 	@\$(call unpack3,$FILE)
-	@ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	echo "export PKGDIR=\$(SRC)/\$\$ROOT" > envars
+	@\$(call get_pkg_root2)
 EOF
 ) >> $MKFILE.tmp
 }
 
+
+unset wrt_remove_build_dirs
 #----------------------------------#
-wrt_test_log() {                   # Initialize testsuite log file
+wrt_remove_build_dirs() {          #
 #----------------------------------#
-  local TESTLOGFILE=$1
+  local name=$1
 (
-cat  << EOF
-	@echo "export TEST_LOG=$TESTLOGDIR/$TESTLOGFILE" >> envars && \\
-	su - \$(LUSER) -c "echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE"
+cat << EOF
+	@\$(call remove_build_dirs,$name)
 EOF
 ) >> $MKFILE.tmp
 }
 
 #----------------------------------#
-wrt_test_log2() {                  #
+wrt_remove_build_dirs2() {         #
 #----------------------------------#
-  local TESTLOGFILE=$1
+  local name=$1
 (
-cat  << EOF
-	@echo "export TEST_LOG=/$SCRIPT_ROOT/test-logs/$TESTLOGFILE" >> envars && \\
-	echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
+cat << EOF
+	@\$(call remove_build_dirs2,$name)
 EOF
 ) >> $MKFILE.tmp
 }
 
+
+
+unset wrt_touch
 #----------------------------------#
-wrt_target_vars() {                # Target vars for hlfs (cross-build method)
+wrt_touch() {                      #
 #----------------------------------#
 (
-cat  << EOF
-	@echo "export target=$(uname -m)-${TARGET}" >> envars && \\
-	echo "export ldso=/lib/${LOADER}" >> envars
+cat << EOF
+	@\$(call housekeeping)
 EOF
 ) >> $MKFILE.tmp
-
 }
 
-
+unset wrt_RunAsUser
 #----------------------------------#
 wrt_RunAsUser() {                  # Execute script inside time { }, footer to log file
 #----------------------------------#
   local this_script=$1
   local file=$2
+
 (
 cat << EOF
-	@( time { su - \$(LUSER) -c "source /home/\$(LUSER)/.bashrc && $JHALFSDIR/${PROGNAME}-commands/$file" >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
-	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/$this_script
+	@( time { \$(SU_LUSER) "source \$(LUSER_HOME)/.bashrc && \$(CMDSDIR)/`dirname $file`/\$@" >> logs/\$@ 2>&1; } ) 2>> logs/\$@ && \\
+	\$(PRT_DU) >> logs/\$@
 EOF
 ) >> $MKFILE.tmp
 }
@@ -422,13 +477,12 @@
 
 (
 cat << EOF
-	@( time { export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
-	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/$this_script
+	@( time { export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
+	\$(PRT_DU_CR) >>logs/\$@
 EOF
 ) >> $MKFILE.tmp
 }
 
-
 #----------------------------------#
 wrt_run_as_root2() {               #
 #----------------------------------#
@@ -436,27 +490,28 @@
   local file=$2
 (
 cat << EOF
-	@( time { source envars && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
-	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \`\n" >>logs/$this_script
+	@( 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
 }
 
 
+unset wrt_run_as_chroot1
 #----------------------------------#
 wrt_run_as_chroot1() {             #
 #----------------------------------#
   local this_script=$1
   local file=$2
 (
-    cat << EOF
-	@( time { \$(CHROOT1) 'cd /${SCRIPT_ROOT} && source envars && /${SCRIPT_ROOT}/${PROGNAME}-commands/$file >>/${SCRIPT_ROOT}/logs/${this_script} 2>&1' ; } ) 2>>logs/$this_script && \\
-	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/${this_script}
+cat << EOF
+	@( time { \$(CHROOT1) 'cd \$(SCRIPT_ROOT) && source envars && \$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@ 2>&1' ; } ) 2>>logs/\$@ && \\
+	\$(PRT_DU_CR) >> logs/\$@
 EOF
 ) >> $MKFILE.tmp
 }
 
-
+unset wrt_run_as_chroot2
 #----------------------------------#
 wrt_run_as_chroot2() {             #
 #----------------------------------#
@@ -464,105 +519,60 @@
   local file=$2
 (
 cat << EOF
-	@( time { \$(CHROOT2) 'cd /${SCRIPT_ROOT} && source envars && /${SCRIPT_ROOT}/${PROGNAME}-commands/$file >>/${SCRIPT_ROOT}/logs/${this_script} 2>&1' ; } ) 2>>logs/$this_script && \\
-	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/${this_script}
+	@( time { \$(CHROOT2) 'cd \$(SCRIPT_ROOT) && source envars && \$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\@ 2>&1' ; } ) 2>>logs/\@ && \\
+	\$(PRT_DU_CR) >> logs/\$@
 EOF
 ) >> $MKFILE.tmp
 }
 
-
+unset wrt_target
 #----------------------------------#
-wrt_copy_fstab() {                 #
+wrt_target() {                     # Create target and initialize log file
 #----------------------------------#
   local i=$1
+  local PREV=$2
+  case $i in
+    iteration* ) local LOGFILE="\$@.log" ;;
+             * ) local LOGFILE="\$@"     ;;
+  esac
 (
-    cat << EOF
-	@cp -v $FSTAB \$(MOUNT_PT)/etc/fstab >>logs/$i 2>&1
-EOF
-) >> $MKFILE.tmp
-}
-
-#----------------------------------#
-wrt_copy_fstab2() {                #
-#----------------------------------#
-  local i=$1
-(
-    cat << EOF
-	@cp -v /sources/fstab /etc/fstab >>logs/$i 2>&1
-EOF
-) >> $MKFILE.tmp
-}
-
-
-#----------------------------------#
-wrt_remove_build_dirs() {          #
-#----------------------------------#
-  local name=$1
-(
 cat << EOF
-	@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	rm -rf \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
-	if [ -e \$(MOUNT_PT)\$(SRC)/$name-build ]; then \\
-		rm -rf \$(MOUNT_PT)\$(SRC)/$name-build; \\
-	fi;
-EOF
-) >> $MKFILE.tmp
-}
 
-
-#----------------------------------#
-wrt_remove_build_dirs2() {         #
-#----------------------------------#
-  local name=$1
-(
-cat << EOF
-	@ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	rm -rf \$(SRC)/\$\$ROOT && \\
-	if [ -e \$(SRC)/$name-build ]; then \\
-		rm -rf \$(SRC)/$name-build; \\
-	fi;
+$i:  $PREV
+	@\$(call echo_message, Building)
+	@./progress_bar.sh \$@ &
+	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >logs/$LOGFILE
 EOF
 ) >> $MKFILE.tmp
 }
 
-
 #----------------------------------#
-wrt_touch() {                      #
+wrt_target_boot() {                # Create target and initialize log file
 #----------------------------------#
+  local i=$1
+  local PREV=$2
+  case $i in
+    iteration* ) local LOGFILE="\$@.log" ;;
+             * ) local LOGFILE="\$@" ;;
+  esac
 (
 cat << EOF
-	@touch  \$@ && \\
-	sleep .25 && \\
-	echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
-	echo --------------------------------------------------------------------------------\$(WHITE)
-EOF
-) >> $MKFILE.tmp
-}
 
-
-#----------------------------------#
-wrt_report() {                     #
-#----------------------------------#
-(
-cat << EOF
-
-create-sbu_du-report:  $PREV
+$i:  $PREV
 	@\$(call echo_message, Building)
-	@./create-sbu_du-report.sh logs $VERSION
-	@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
-	@touch  \$@
+	@./progress_bar.sh \$@ &
+	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
 EOF
 ) >> $MKFILE.tmp
-
-chapter789="$chapter789 create-sbu_du-report"
 }
 
 
+
 #----------------------------#
 run_make() {                 #
 #----------------------------#
   # Test if make must be run.
-  if [ "$RUNMAKE" = "1" ] ; then
+  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."
@@ -582,7 +592,7 @@
 clean_builddir() {           #
 #----------------------------#
   # Test if the clean must be done.
-  if [ "$CLEAN" = "1" ] ; then
+  if [ "${CLEAN}" = "y" ]; then
     # Test to make sure we're running the clean as root
     if [ "$UID" != "0" ] ; then
       echo "You must be logged in as root to clean the build directory."
@@ -695,7 +705,7 @@
                  --stringparam timezone $TIMEZONE \
                  --stringparam page $PAGE \
                  --stringparam lang $LANG \
-                 --stringparam keymap ${KEYMAP:-"none"} \
+                 --stringparam keymap $KEYMAP \
                  -o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
       ;;
 
@@ -707,7 +717,7 @@
                  --stringparam timezone $TIMEZONE \
                  --stringparam page $PAGE \
                  --stringparam lang $LANG \
-                 --stringparam keymap ${KEYMAP:-"none"} \
+                 --stringparam keymap $KEYMAP \
                  -o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
       ;;
     hlfs)
@@ -721,7 +731,7 @@
                  --stringparam page $PAGE \
                  --stringparam lang $LANG \
                  --stringparam lc_all $LC_ALL \
-                 --stringparam keymap ${KEYMAP:-"none"} \
+                 --stringparam keymap $KEYMAP \
                  --stringparam grsecurity_host $GRSECURITY_HOST \
                  -o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
       ;;
@@ -785,7 +795,7 @@
   local IFS line URL1 URL2 FILE BOOKMD5 MD5 HAVEMD5 fromARCHIVE
 
     # Test if the packages must be downloaded
-  [ ! "$GETPKG" = "1" ] && return
+  [ ! "$GETPKG" = "y" ] && return
 
   gs_wrt_message(){
     echo "${RED}$1${OFF}"
@@ -815,7 +825,7 @@
           ;;
         *linux/linux-* )
             [[ -z "$CONFIG" ]] && [[ -z "$BOOT_CONFIG" ]] && \
-            [[ "$GETKERNEL" = "0" ]] && continue
+            [[ "$GETKERNEL" = "n" ]] && continue
           ;;
     esac
 
@@ -897,7 +907,7 @@
     echo  -e "\n\n${tab_}${RED} One or more files were not retrieved or have bad MD5SUMS.\n${tab_} Check ${L_arrow}$BUILDDIR/sources/MISSING_FILES.DMP${R_arrow} for names ${OFF}\n"
       # Do not allow the automatic execution of the Makefile.
     echo "${tab_}${BOLD}${RED}*** ${YELLOW}Automatic execution of the generated makefile has been inhibited. ${RED}***${OFF}${nl_}"
-    RUNMAKE=0
+    RUNMAKE="n"
   fi
 }
 

Modified: jhalfs/trunk/common/config
===================================================================
--- jhalfs/trunk/common/config	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/common/config	2006-08-16 17:42:54 UTC (rev 2967)
@@ -11,18 +11,18 @@
 #--- Mount point for the build
 BUILDDIR=/mnt/build_dir
 
-# Create SBU and disk usage report  0(no)/1(yes)
+# Create SBU and disk usage report  n(no)/y(yes)
 # NOTE: requires to have bc installed on the host
-REPORT=1
+REPORT=y
 
 #=== Getting packages ===
 #    Files will be retrieved from the local archive SRC_ARCHIVE
 #    (if defined) or the 'net and will be stored in $BUILDDIR/sources
-#--- Download the source packages 0(no)/1(yes)
-GETPKG=0
+#--- Download the source packages n(no)/y(yes)
+GETPKG=n
 
 #--- The local repository for packages/file
-#    Used only if GETPKG = 1
+#    Used only if GETPKG = y
 #    Any missing file will be downloaded and archived here,
 #    if the user has the right priviledges.
 SRC_ARCHIVE=$SRC_ARCHIVE
@@ -32,8 +32,8 @@
 SERVER=ftp://ftp.lfs-matrix.net
 
 #=== Build options ===
-#--- Automatically run the makefile once it has been created  0(no)/1(yes)
-RUNMAKE=0
+#--- Automatically run the makefile once it has been created  n(no)/y(yes)
+RUNMAKE=n
 
 #--- Optimize the build  [0-2]
 #  0 = no optimization
@@ -52,12 +52,12 @@
 TEST=1
 
 #--- Bomb on test suites failures?
-#  0 = no, I want to build the full system and review the logs
-#  1 = yes, bomb at the first test suite failure to can review the build dir
-BOMB_TEST=0
+#  n = no, I want to build the full system and review the logs
+#  y = yes, bomb at the first test suite failure to can review the build dir
+BOMB_TEST=n
 
-#--- Run the stripping phases  0(no)/1(yes)
-STRIP=1
+#--- Run the stripping phases  n(no)/y(yes)
+STRIP=y
 
 #--- page definition for groff letter/A4
 PAGE=letter
@@ -65,8 +65,8 @@
 #--- set default timezone.
 TIMEZONE=${TZ:-GMT}
 
-#--- install the optional vim-lang package  0(no)/1(yes)
-VIMLANG=1
+#--- install the optional vim-lang package  n(no)/y(yes)
+VIMLANG=y
 
 #--- Language information in /etc/profile  See <locale -a> for values
 LANG=$LANG
@@ -79,17 +79,17 @@
 KEYMAP=none
 
 #=== Variables needed by iterative comparison analysis ===
-#--- Should some iterative comparison analysis by made? 0(no)/1(yes)
-COMPARE=0
+#--- Should some iterative comparison analysis by made? n(no)/y(yes)
+COMPARE=n
 
 #--- The number of final stage builds to create and compare, min. 2, max. 5
 ITERATIONS=3
 
-#--- Run ICA testing 0(no)/1(yes)
-RUN_ICA=0
+#--- Run ICA testing n(no)/y(yes)
+RUN_ICA=n
 
-#--- Run farce testing 0(no)/1(yes)
-RUN_FARCE=0
+#--- Run farce testing n(no)/y(yes)
+RUN_FARCE=n
 
 #==== INTERNAL VARIABLES ====
 # Don't edit it unless you know what you are doing

Modified: jhalfs/trunk/common/func_compare.sh
===================================================================
--- jhalfs/trunk/common/func_compare.sh	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/common/func_compare.sh	2006-08-16 17:42:54 UTC (rev 2967)
@@ -54,7 +54,7 @@
     local DEST_TOPDIR=$BUILDDIR/${SCRIPT_ROOT}
   fi
 
-  if [[ "$RUN_ICA" = "1" ]] ; then
+  if [[ "$RUN_ICA" = "y" ]] ; then
     local DEST_ICA=$DEST_TOPDIR/ICA && \
 (
     cat << EOF
@@ -67,7 +67,7 @@
     fi
   fi
 
-  if [[ "$RUN_FARCE" = "1" ]] ; then
+  if [[ "$RUN_FARCE" = "y" ]] ; then
     local DEST_FARCE=$DEST_TOPDIR/farce && \
 (
     cat << EOF

Modified: jhalfs/trunk/common/func_validate_configs.sh
===================================================================
--- jhalfs/trunk/common/func_validate_configs.sh	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/common/func_validate_configs.sh	2006-08-16 17:42:54 UTC (rev 2967)
@@ -177,26 +177,26 @@
       TIMEZONE)   echo -e "`eval echo $PARAM_VALS`" ;;
 
       # Validate general parameters..
-      GETPKG)     validate_against_str "x0x x1x" ;;
+      GETPKG)     validate_against_str "xnx xyx" ;;
       GETKERNEL ) if [[ -z "$CONFIG" ]] && [[ -z "$BOOT_CONFIG" ]] ; then
-                    [[ "$GETPKG" = "1" ]] && validate_against_str "x0x x1x"
+                    [[ "$GETPKG" = "y" ]] && validate_against_str "xnx xyx"
                   fi ;;
-      RUNMAKE)    validate_against_str "x0x x1x" ;;
-      REPORT)     validate_against_str "x0x x1x"
-                  if [[ "${!config_param}" = "1" ]]; then
+      RUNMAKE)    validate_against_str "xnx xyx" ;;
+      REPORT)     validate_against_str "xnx xyx"
+                  if [[ "${!config_param}" = "y" ]]; then
                     if [[ `type -p bc` ]]; then
                       continue
                     else
                       echo -e "  ${BOLD}The bc binary was not found${OFF}"
                       echo -e "  The SBU and disk usage report creation will be skiped"
-                      REPORT=0
+                      REPORT=n
                       continue
                     fi
                   fi ;;
-      COMPARE)    if [[ ! "$COMPARE" = "1" ]]; then
-                    validate_against_str "x0x x1x"
+      COMPARE)    if [[ ! "$COMPARE" = "y" ]]; then
+                    validate_against_str "xnx xyx"
                   else
-                    if [[ ! "${RUN_ICA}" = "1" ]] && [[ ! "${RUN_FARCE}" = "1" ]]; then
+                    if [[ ! "${RUN_ICA}" = "y" ]] && [[ ! "${RUN_FARCE}" = "y" ]]; then
                        echo  "${nl_}${DD_BORDER}"
                        echo  "You have elected to analyse your build but have failed to select a tool." >&2
                        echo  "Edit /common/config and set ${L_arrow}${BOLD}RUN_ICA${R_arrow} and/or ${L_arrow}${BOLD}RUN_FARCE${R_arrow} to the required values" >&2
@@ -204,14 +204,14 @@
                        exit 1
                     fi
                   fi ;;
-      RUN_ICA)    [[ "$COMPARE" = "1" ]] && validate_against_str "x0x x1x" ;;
-      RUN_FARCE)  [[ "$COMPARE" = "1" ]] && validate_against_str "x0x x1x" ;;
-      ITERATIONS) [[ "$COMPARE" = "1" ]] && validate_against_str "x2x x3x x4x x5x" ;;
+      RUN_ICA)    [[ "$COMPARE" = "y" ]] && validate_against_str "xnx xyx" ;;
+      RUN_FARCE)  [[ "$COMPARE" = "y" ]] && validate_against_str "xnx xyx" ;;
+      ITERATIONS) [[ "$COMPARE" = "y" ]] && validate_against_str "x2x x3x x4x x5x" ;;
       TEST)       validate_against_str "x0x x1x x2x x3x" ;;
-      BOMB_TEST)  [[ ! "$TEST" = "0" ]] && validate_against_str "x0x x1x" ;;
+      BOMB_TEST)  [[ ! "$TEST" = "0" ]] && validate_against_str "xnx xyx" ;;
       OPTIMIZE)   validate_against_str "x0x x1x x2x" ;;
-      STRIP)      validate_against_str "x0x x1x" ;;
-      VIMLANG)    validate_against_str "x0x x1x" ;;
+      STRIP)      validate_against_str "xnx xyx" ;;
+      VIMLANG)    validate_against_str "xnx xyx" ;;
       MODEL)      validate_against_str "xglibcx xuclibcx" ;;
       PAGE)       validate_against_str "xletterx xA4x" ;;
       METHOD)     validate_against_str "xchrootx xbootx" ;;
@@ -223,7 +223,7 @@
       LGROUP)     echo -e "`eval echo $PARAM_VALS`"
                   [[ "${!config_param}" = "**EDIT ME**" ]] && write_error_and_die
                   ;;
-      GRSECURITY_HOST)  validate_against_str "x0x x1x" ;;
+      GRSECURITY_HOST)  validate_against_str "xnx xyx" ;;
 
       # BOOK validation. Very ugly, need be fixed
       BOOK)        if [[ "${WC}" = "1" ]] ; then
@@ -235,7 +235,7 @@
       # Validate directories, testable states:
       #  fatal   -z -d -w,
       #  warning -z+   -w+
-      SRC_ARCHIVE) [[ "$GETPKG" = "1" ]] && validate_dir -z+ -d -w+ ;;
+      SRC_ARCHIVE) [[ "$GETPKG" = "y" ]] && validate_dir -z+ -d -w+ ;;
       BUILDDIR)   # The build directory/partition MUST exist and be writable by the user
                   validate_dir -z -d -w
                   [[ "xx x/x" =~ "x${!config_param}x" ]] &&

Modified: jhalfs/trunk/common/makefile-functions
===================================================================
--- jhalfs/trunk/common/makefile-functions	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/common/makefile-functions	2006-08-16 17:42:54 UTC (rev 2967)
@@ -15,13 +15,62 @@
   @echo $(WHITE)
 endef
 
+define remove_existing_dirs
+  @PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \
+  ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
+  rm -rf $(SRCSDIR)/$$ROOT && \
+  rm -rf $(SRCSDIR)/$${ROOT%-*}-build
+endef
+
+define remove_existing_dirs2
+  @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
+endef
+
+define remove_build_dirs
+  @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
+  rm -rf $(SRCSDIR)/$$ROOT && \
+  rm -rf $(SRCSDIR)/$(1)-build
+endef
+
+define remove_build_dirs2
+  @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
+  rm -rf $(SRC)/$$ROOT && \
+  rm -rf $(SRC)/$(1)-build
+endef
+
+define housekeeping
+  @touch  $@ && \
+  sleep .25 && \
+  echo -e "\n\n "$(BOLD)Target $(BLUE)$@ $(BOLD)OK && \
+  echo --------------------------------------------------------------------------------$(WHITE)
+
+endef
+
+define get_pkg_root
+  @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
+  if [ "$(1)" != "nouser" ]; then \
+    echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars; \
+    chown -R $(LUSER) $(SRCSDIR)/$$ROOT; \
+  else \
+    echo "export PKGDIR=$(crSRCSDIR)/$$ROOT" > envars; \
+  fi;
+endef
+
+define get_pkg_root2
+  @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
+  echo "export PKGDIR=$(SRC)/$$ROOT" > envars
+endef
+
 define unpack
-  @cd $(MOUNT_PT)$(SRC) && \
+  @cd $(SRCSDIR) && \
   tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
 endef
 
 define unpack2
-  @cd $(MOUNT_PT)$(SRC) && \
+  @cd $(SRCSDIR) && \
   /tools/bin/tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
 endef
 

Modified: jhalfs/trunk/master.sh
===================================================================
--- jhalfs/trunk/master.sh	2006-08-15 17:29:21 UTC (rev 2966)
+++ jhalfs/trunk/master.sh	2006-08-16 17:42:54 UTC (rev 2967)
@@ -46,27 +46,6 @@
 MODULE_CONFIG=$PACKAGE_DIR/config
     VERBOSITY=0
 
-[[ $VERBOSITY > 0 ]] && echo -n "Loading common-functions module..."
-source $COMMON_DIR/common-functions
-[[ $? > 0 ]] && echo " $COMMON_DIR/common-functions did not load.." && exit
-[[ $VERBOSITY > 0 ]] && echo "OK"
-#
-[[ $VERBOSITY > 0 ]] && echo -n "Loading masterscript conf..."
-source $COMMON_DIR/config
-[[ $? > 0 ]] && echo "$COMMON_DIR/conf did not load.." && exit
-[[ $VERBOSITY > 0 ]] && echo "OK"
-#
-[[ $VERBOSITY > 0 ]] && echo -n "Loading config module <$MODULE_CONFIG>..."
-source $MODULE_CONFIG
-[[ $? > 0 ]] && echo "$MODULE_CONFIG did not load.." && exit 1
-[[ $VERBOSITY > 0 ]] && echo "OK"
-#
-[[ $VERBOSITY > 0 ]] && echo -n "Loading code module <$MODULE>..."
-source $MODULE
-[[ $? > 0 ]] && echo "$MODULE did not load.." && exit 2
-[[ $VERBOSITY > 0 ]] && echo "OK"
-#
-[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
 
 if [[ -e using_menuconfig ]]; then
   [[ $VERBOSITY > 0 ]] && echo -n "Loading config params from <configuration>..."
@@ -84,7 +63,13 @@
     ICALOGDIR=$LOGDIR/ICA
 	#--- farce report log directory
   FARCELOGDIR=$LOGDIR/farce
+          XSL=$PROGNAME.xsl
 
+  case $PROGNAME in
+    clfs2) LFSVRS=development; TREE=branches/clfs-2.0/BOOK ;;
+        *) LFSVRS=development; TREE=trunk/BOOK             ;;
+  esac
+
   if [[ ! -z ${BRANCH_ID} ]]; then
     case $BRANCH_ID in
      dev* | SVN | trunk )
@@ -112,8 +97,52 @@
       ;;
     esac
   fi
+  # These are boolean vars generated from Config.in.
+  # ISSUE: If a boolean parameter is not set <true> that
+  # variable is not defined by the menu app. This can
+  # cause a headache if you are not careful.
+  #  The following parameters MUST be created and have a
+  #  default value.
+  RUNMAKE=${RUNMAKE:-n}
+  GETPKG=${GETPKG:-n}
+  GETKERNEL=${GETKERNEL:-n}
+  COMPARE=${COMPARE:-n}
+  RUN_FARCE=${RUN_FARCE:-n}
+  RUN_ICA=${RUN_ICA:-n}
+  BOMB_TEST=${BOMB_TEST:-n}
+  STRIP=${STRIP:=n}
+  REPORT=${REPORT:=n}
+  VIMLANG=${VIMLANG:-n}
+  KEYMAP=${KEYMAP:=none}
+  GRSECURITY_HOST=${GRSECURITY_HOST:-n}
+
+else
+  #
+  [[ $VERBOSITY > 0 ]] && echo -n "Loading masterscript conf..."
+  source $COMMON_DIR/config
+  [[ $? > 0 ]] && echo "$COMMON_DIR/conf did not load.." && exit
+  [[ $VERBOSITY > 0 ]] && echo "OK"
+  #
+  [[ $VERBOSITY > 0 ]] && echo -n "Loading config module <$MODULE_CONFIG>..."
+  source $MODULE_CONFIG
+  [[ $? > 0 ]] && echo "$MODULE_CONFIG did not load.." && exit 1
+  [[ $VERBOSITY > 0 ]] && echo "OK"
+  #
 fi
 
+
+[[ $VERBOSITY > 0 ]] && echo -n "Loading common-functions module..."
+source $COMMON_DIR/common-functions
+[[ $? > 0 ]] && echo " $COMMON_DIR/common-functions did not load.." && exit
+[[ $VERBOSITY > 0 ]] && echo "OK"
+[[ $VERBOSITY > 0 ]] && echo -n "Loading code module <$MODULE>..."
+source $MODULE
+[[ $? > 0 ]] && echo "$MODULE did not load.." && exit 2
+[[ $VERBOSITY > 0 ]] && echo "OK"
+#
+[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
+
+
 #===========================================================
 # If the var BOOK contains something then, maybe, it points
 # to a working doc.. set WC=1, else 'null'
@@ -190,7 +219,7 @@
       esac
       ;;
 
-    --get-packages | -G )      GETPKG=1    ;;
+    --get-packages | -G )      GETPKG=y    ;;
 
     --help | -h )  usage | more && exit  ;;
 
@@ -267,18 +296,9 @@
       test $# = 1 && eval "$exit_missing_arg"
       shift
       case $1 in
-        ICA)              RUN_ICA=1
-                        RUN_FARCE=0
-                          COMPARE=1
-        ;;
-        farce)            RUN_ICA=0
-                        RUN_FARCE=1
-                          COMPARE=1
-        ;;
-        both)             RUN_ICA=1
-                        RUN_FARCE=1
-                          COMPARE=1
-        ;;
+        ICA)    RUN_ICA=y; RUN_FARCE=n; COMPARE=y  ;;
+        farce)  RUN_ICA=n; RUN_FARCE=y; COMPARE=y  ;;
+        both)   RUN_ICA=y; RUN_FARCE=y; COMPARE=y  ;;
         *)
           echo -e "\n$1 is an unknown analysis method."
           exit 1
@@ -308,96 +328,48 @@
       fi
       ;;
 
-    --run-make | -M )      RUNMAKE=1 ;;
+    --run-make | -M )      RUNMAKE=y ;;
 
-    --rebuild | -R )       CLEAN=1   ;;
+    --rebuild | -R )       CLEAN=y   ;;
 
     # CLFS options
     --arch | -A )
       test $# = 1 && eval "$exit_missing_arg"
       shift
-      case $1 in
-        arm )
-          ARCH=arm
-          TARGET="arm-unknown-linux-gnu"
-          ;;
-        x86 )
-          ARCH=x86
-          TARGET="i686-pc-linux-gnu"
-          ;;
-        i486 )
-          ARCH=x86
-          TARGET="i486-pc-linux-gnu"
-          ;;
-        i586 )
-          ARCH=x86
-          TARGET="i586-pc-linux-gnu"
-          ;;
-        ppc )
-          ARCH=ppc
-          TARGET="powerpc-unknown-linux-gnu"
-          ;;
-        mips )
-          ARCH=mips
-          TARGET="mips-unknown-linux-gnu"
-          ;;
-        mipsel )
-          ARCH=mips
-          TARGET="mipsel-unknown-linux-gnu"
-          ;;
-        sparc )
-          ARCH=sparc
-          TARGET="sparcv9-unknown-linux-gnu"
-          ;;
-        x86_64-64 )
-          ARCH=x86_64-64
-          TARGET="x86_64-unknown-linux-gnu"
-          ;;
-        mips64-64 )
-          ARCH=mips64-64
-          TARGET="mips-unknown-linux-gnu"
-          ;;
-        mipsel64-64 )
-          ARCH=mips64-64
-          TARGET="mipsel-unknown-linux-gnu"
-          ;;
-        sparc64-64 )
-          ARCH=sparc64-64
-          TARGET="sparc64-unknown-linux-gnu"
-          ;;
-        alpha )
-          ARCH=alpha
-          TARGET="alpha-unknown-linux-gnu"
-          ;;
-        x86_64 )
-          ARCH=x86_64
-          TARGET="x86_64-unknown-linux-gnu"
-          TARGET32="i686-pc-linux-gnu"
-          ;;
-        mips64 )
-          ARCH=mips64
-          TARGET="mips-unknown-linux-gnu"
-          TARGET32="mips-unknown-linux-gnu"
-          ;;
-        mipsel64 )
-          ARCH=mips64
-          TARGET="mipsel-unknown-linux-gnu"
-          TARGET32="mipsel-unknown-linux-gnu"
-          ;;
-        sparc64 )
-          ARCH=sparc64
-          TARGET="sparc64-unknown-linux-gnu"
-          TARGET32="sparcv9-unknown-linux-gnu"
-          ;;
-        ppc64 )
-          ARCH=ppc64
-          TARGET="powerpc64-unknown-linux-gnu"
-          TARGET32="powerpc-unknown-linux-gnu"
-          ;;
-        * )
-          echo -e "\n$1 is an unknown or unsupported arch."
-          exit 1
-          ;;
+      case $PROGNAME in
+        CLFS2)
+	  case $1 in
+            arm) ARCH=arm; TARGET="arm-unknown-linux-gnu" ;;
+            x86) ARCH=x86; TARGET="i686-pc-linux-gnu"     ;;
+	      *) echo -e "\n$1 is an unknown or unsupported arch.";  exit 1
+          esac
+	  ;;
+        CLFS)
+          case $1 in
+            arm )   ARCH=arm;   TARGET="arm-unknown-linux-gnu" ;;
+            x86 )   ARCH=x86;   TARGET="i686-pc-linux-gnu"     ;;
+           i486 )   ARCH=x86;   TARGET="i486-pc-linux-gnu"     ;;
+           i586 )   ARCH=x86;   TARGET="i586-pc-linux-gnu"     ;;
+            ppc )   ARCH=ppc;   TARGET="powerpc-unknown-linux-gnu"   ;;
+           mips )   ARCH=mips;  TARGET="mips-unknown-linux-gnu"      ;;
+           mipsel ) ARCH=mips;  TARGET="mipsel-unknown-linux-gnu"    ;;
+            sparc ) ARCH=sparc; TARGET="sparcv9-unknown-linux-gnu"   ;;
+
+           x86_64-64 )   ARCH=x86_64-64;  TARGET="x86_64-unknown-linux-gnu"   ;;
+           mips64-64 )   ARCH=mips64-64;  TARGET="mips-unknown-linux-gnu"     ;;
+           mipsel64-64 ) ARCH=mips64-64;  TARGET="mipsel-unknown-linux-gnu" ;;
+           sparc64-64 )  ARCH=sparc64-64; TARGET="sparc64-unknown-linux-gnu" ;;
+           alpha )       ARCH=alpha;      TARGET="alpha-unknown-linux-gnu"   ;;
+
+           x86_64 )   ARCH=x86_64;  TARGET="x86_64-unknown-linux-gnu";    TARGET32="i686-pc-linux-gnu"        ;;
+           mips64 )   ARCH=mips64;  TARGET="mips-unknown-linux-gnu";      TARGET32="mips-unknown-linux-gnu"   ;;
+           mipsel64 ) ARCH=mips64;  TARGET="mipsel-unknown-linux-gnu";    TARGET32="mipsel-unknown-linux-gnu"  ;;
+           sparc64 )  ARCH=sparc64; TARGET="sparc64-unknown-linux-gnu";   TARGET32="sparcv9-unknown-linux-gnu"  ;;
+            ppc64 )   ARCH=ppc64;   TARGET="powerpc64-unknown-linux-gnu"; TARGET32="powerpc-unknown-linux-gnu"  ;;
+
+            * )  echo -e "\n$1 is an unknown or unsupported arch.";   exit 1  ;;
+          esac
+	  ;;
       esac
       ;;
 
@@ -447,6 +419,7 @@
   shift
 done
 
+
 #===================================================
 # Set the document location...
 # BOOK is either defined in
@@ -460,8 +433,7 @@
 #===================================================
 
 
-# Check for minimum gcc and kernel versions
-#check_requirements  1 # 0/1  0-do not display values.
+# Check for minimum bash,tar,gcc and kernel versions
 echo
 check_version "2.6.2" "`uname -r`"         "KERNEL"
 check_version "3.0"   "$BASH_VERSION"      "BASH"
@@ -482,7 +454,7 @@
 
 # Load additional modules or configuration files based on global settings
 # compare module
-if [[ "$COMPARE" = "1" ]]; then
+if [[ "$COMPARE" = "y" ]]; then
   [[ $VERBOSITY > 0 ]] && echo -n "Loading compare module..."
   source $COMMON_DIR/func_compare.sh
   [[ $? > 0 ]] && echo "$COMMON_DIR/func_compare.sh did not load.." && exit
@@ -537,7 +509,7 @@
   #
   [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
   #
-  if [[ "$COMPARE" != "0" ]] ; then
+  if [[ "$COMPARE" = "y" ]]; then
     mkdir -p $JHALFSDIR/extras
     cp extras/* $JHALFSDIR/extras
   fi
@@ -549,14 +521,14 @@
     popd 1> /dev/null
   fi
   #
-  if [[ "$REPORT" = "1" ]]; then
+  if [[ "$REPORT" = "y" ]]; then
     cp $COMMON_DIR/create-sbu_du-report.sh  $JHALFSDIR/
     # After being sure that all looks sane, dump the settings to a file
     # This file will be used to create the REPORT header
     validate_config > $JHALFSDIR/jhalfs.config
   fi
   #
-  [[ "$GETPKG" = "1" ]] && cp $COMMON_DIR/urls.xsl  $JHALFSDIR/
+  [[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl  $JHALFSDIR/
   #
   cp $COMMON_DIR/packages.xsl  $JHALFSDIR/
   #




More information about the alfs-log mailing list