r2841 - in jhalfs/branches/experimental: . BLFS BLFS/libs CLFS CLFS2 HLFS LFS common

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Wed Jul 26 11:42:02 PDT 2006


Author: manuel
Date: 2006-07-26 12:42:01 -0600 (Wed, 26 Jul 2006)
New Revision: 2841

Added:
   jhalfs/branches/experimental/CLFS2/
   jhalfs/branches/experimental/common/packages.xsl
Modified:
   jhalfs/branches/experimental/BLFS/TODO
   jhalfs/branches/experimental/BLFS/libs/constants.inc
   jhalfs/branches/experimental/BLFS/libs/func_makefile
   jhalfs/branches/experimental/BLFS/libs/func_parser
   jhalfs/branches/experimental/CLFS/clfs.xsl
   jhalfs/branches/experimental/CLFS/config
   jhalfs/branches/experimental/CLFS/master.sh
   jhalfs/branches/experimental/CLFS2/clfs2.xsl
   jhalfs/branches/experimental/CLFS2/config
   jhalfs/branches/experimental/CLFS2/master.sh
   jhalfs/branches/experimental/HLFS/config
   jhalfs/branches/experimental/HLFS/master.sh
   jhalfs/branches/experimental/LFS/config
   jhalfs/branches/experimental/LFS/master.sh
   jhalfs/branches/experimental/README
   jhalfs/branches/experimental/common/common-functions
   jhalfs/branches/experimental/common/config
   jhalfs/branches/experimental/common/func_compare.sh
   jhalfs/branches/experimental/common/func_validate_configs.sh
   jhalfs/branches/experimental/common/makefile-functions
   jhalfs/branches/experimental/common/progress_bar.sh
   jhalfs/branches/experimental/master.sh
Log:
Updated experimental branch to current trunk code.

Modified: jhalfs/branches/experimental/BLFS/TODO
===================================================================
--- jhalfs/branches/experimental/BLFS/TODO	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/BLFS/TODO	2006-07-26 18:42:01 UTC (rev 2841)
@@ -19,13 +19,18 @@
      c. Run the packages.sh script.
 
 2. - To develop the XSL code needed to create the build scripts.
-     Work in progress.
+     Almost done. A lot of book-versus-scripts and testing is needed.
+     We need yet to figure out how to handle Perl modules installation and
+     other pages that have commands to install more that one package
+     (e.g., Gnat in GCC Java-bin in Java, sane-backends and sane-frontends
+     in Sane, etc)
 
 3. - To develop the code to create the Makefile.
      Should be a separate script to be run manually after the user has
      review and edited the target build scripts.
      Must make the build scripts executables and set the SRC_ARCHIVE and
      FTP_SERVER envars.
+     Work in progress.
 
 4. - To find a way to track already installed packages by previous runs, to can
        skip them when creating the book/scripts/Makefile for a new target.


Property changes on: jhalfs/branches/experimental/BLFS/TODO
___________________________________________________________________
Name: svn:keywords
   - Author Date Rev Id
   + Author Date Revision Id


Property changes on: jhalfs/branches/experimental/BLFS/libs/constants.inc
___________________________________________________________________
Name: svn:keywords
   - Author Date Rev Id
   + Author Date Revision Id


Property changes on: jhalfs/branches/experimental/BLFS/libs/func_makefile
___________________________________________________________________
Name: svn:keywords
   - Author Date Rev Id
   + Author Date Revision Id


Property changes on: jhalfs/branches/experimental/BLFS/libs/func_parser
___________________________________________________________________
Name: svn:keywords
   - Author Date Rev Id
   + Author Date Revision Id

Modified: jhalfs/branches/experimental/CLFS/clfs.xsl
===================================================================
--- jhalfs/branches/experimental/CLFS/clfs.xsl	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/CLFS/clfs.xsl	2006-07-26 18:42:01 UTC (rev 2841)
@@ -230,6 +230,10 @@
       <xsl:when test="ancestor::sect1[@id='ch-system-groff']">
         <xsl:value-of select="$page"/>
       </xsl:when>
+      <xsl:when test="ancestor::sect1[@id='ch-boot-kernel'] or
+                      ancestor::sect1[@id='ch-bootable-kernel']">
+        <xsl:value-of select="$keymap"/>
+      </xsl:when>
       <xsl:otherwise>
         <xsl:text>**EDITME</xsl:text>
         <xsl:apply-templates/>

Modified: jhalfs/branches/experimental/CLFS/config
===================================================================
--- jhalfs/branches/experimental/CLFS/config	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/CLFS/config	2006-07-26 18:42:01 UTC (rev 2841)
@@ -22,16 +22,16 @@
 #--------------------------------
 # >>>> 64-64 BUILD <<<<
 # ARCH=x86_64-64  ; TARGET="x86_64-unknown-linux-gnu"
-# ARCH=mips64-64  ; TARGET="mipsel-unknown-linux-gnu"
-# ARCH=mips64-64  ; TARGET="mips-unknown-linux-gnu"
+# ARCH=mips64-64  ; TARGET="mips64el-unknown-linux-gnu"
+# ARCH=mips64-64  ; TARGET="mips64-unknown-linux-gnu"
 # ARCH=sparc64-64 ; TARGET="sparc64-unknown-linux-gnu"
 # ARCH=alpha	  ; TARGET="alpha-unknown-linux-gnu"
 #--------------------------------
 # >>>> MULTILIB 32/64 <<<<
 # ARCH=x86_64  ; TARGET="x86_64-unknown-linux-gnu"    ; TARGET32="i686-pc-linux-gnu"
-# ARCH=mips64  ; TARGET="mipsel-unknown-linux-gnu"    ; TARGET32="mipsel-unknown-linux-gnu"
-# ARCH=mips64  ; TARGET="mips-unknown-linux-gnu"      ; TARGET32="mips-unknown-linux-gnu"
-# ARCH=sparc64 ; TARGET="sparc64-unknown-linux-gnu"   ; TARGET32="sparcv9-unknown-linux-gnu"
+# ARCH=mips64  ; TARGET="mips64el-unknown-linux-gnu"  ; TARGET32="mipsel-unknown-linux-gnu"
+# ARCH=mips64  ; TARGET="mips64-unknown-linux-gnu"    ; TARGET32="mips-unknown-linux-gnu"
+# ARCH=sparc64 ; TARGET="sparc64-unknown-linux-gnu"   ; TARGET32="sparc-unknown-linux-gnu"
 # ARCH=ppc64   ; TARGET="powerpc64-unknown-linux-gnu" ; TARGET32="powerpc-unknown-linux-gnu"
 
 #--- What build method should be used chroot/boot
@@ -68,6 +68,7 @@
 
 #--- Book version
 LFSVRS=development
+TREE=trunk/BOOK
 
 #--- Name of the makefile
 MKFILE=$JHALFSDIR/Makefile

Modified: jhalfs/branches/experimental/CLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/CLFS/master.sh	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/CLFS/master.sh	2006-07-26 18:42:01 UTC (rev 2841)
@@ -10,12 +10,12 @@
 #----------------------------#
 host_prep_Makefiles() {      # Initialization of the system
 #----------------------------#
-  local   LFS_HOST
+  local   CLFS_HOST
 
   echo "${tab_}${GREEN}Processing... ${L_arrow}host prep files${R_arrow}"
 
   # defined here, only for ease of reading
-  LFS_HOST="`echo ${MACHTYPE} | sed -e 's/unknown/cross/g' -e 's/-pc-/-cross-/g'`"
+  CLFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
 (
 cat << EOF
 023-creatingtoolsdir:
@@ -41,43 +41,43 @@
 
 025-addinguser:  024-creatingcrossdir
 	@\$(call echo_message, Building)
-	@if [ ! -d /home/lfs ]; then \\
-		groupadd lfs; \\
-		useradd -s /bin/bash -g lfs -m -k /dev/null lfs; \\
+	@if [ ! -d /home/clfs ]; then \\
+		groupadd clfs; \\
+		useradd -s /bin/bash -g clfs -m -k /dev/null clfs; \\
 	else \\
-		touch user-lfs-exist; \\
+		touch user-clfs-exist; \\
 	fi;
-	@chown lfs \$(MOUNT_PT) && \\
-	chown lfs \$(MOUNT_PT)/tools && \\
-	chown lfs \$(MOUNT_PT)/cross-tools && \\
-	chown lfs \$(MOUNT_PT)/sources && \\
+	@chown clfs \$(MOUNT_PT) && \\
+	chown clfs \$(MOUNT_PT)/tools && \\
+	chown clfs \$(MOUNT_PT)/cross-tools && \\
+	chown clfs \$(MOUNT_PT)/sources && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
 
 026-settingenvironment:  025-addinguser
 	@\$(call echo_message, Building)
-	@if [ -f /home/lfs/.bashrc -a ! -f /home/lfs/.bashrc.XXX ]; then \\
-		mv /home/lfs/.bashrc /home/lfs/.bashrc.XXX; \\
+	@if [ -f /home/clfs/.bashrc -a ! -f /home/clfs/.bashrc.XXX ]; then \\
+		mv /home/clfs/.bashrc /home/clfs/.bashrc.XXX; \\
 	fi;
-	@if [ -f /home/lfs/.bash_profile  -a ! -f /home/lfs/.bash_profile.XXX ]; then \\
-		mv /home/lfs/.bash_profile /home/lfs/.bash_profile.XXX; \\
+	@if [ -f /home/clfs/.bash_profile  -a ! -f /home/clfs/.bash_profile.XXX ]; then \\
+		mv /home/clfs/.bash_profile /home/clfs/.bash_profile.XXX; \\
 	fi;
-	@echo "set +h" > /home/lfs/.bashrc && \\
-	echo "umask 022" >> /home/lfs/.bashrc && \\
-	echo "LFS=\$(MOUNT_PT)" >> /home/lfs/.bashrc && \\
-	echo "LC_ALL=POSIX" >> /home/lfs/.bashrc && \\
-	echo "PATH=/cross-tools/bin:/bin:/usr/bin" >> /home/lfs/.bashrc && \\
-	echo "export LFS LC_ALL PATH" >> /home/lfs/.bashrc && \\
-	echo "" >> /home/lfs/.bashrc && \\
-	echo "unset CFLAGS" >> /home/lfs/.bashrc && \\
-	echo "unset CXXFLAGS" >> /home/lfs/.bashrc && \\
-	echo "" >> /home/lfs/.bashrc && \\
-	echo "export LFS_HOST=\"${LFS_HOST}\"" >> /home/lfs/.bashrc && \\
-	echo "export LFS_TARGET=\"${TARGET}\"" >> /home/lfs/.bashrc && \\
-	echo "export LFS_TARGET32=\"${TARGET32}\"" >> /home/lfs/.bashrc && \\
-	echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc
-	@chown lfs:lfs /home/lfs/.bashrc && \\
+	@echo "set +h" > /home/clfs/.bashrc && \\
+	echo "umask 022" >> /home/clfs/.bashrc && \\
+	echo "CLFS=\$(MOUNT_PT)" >> /home/clfs/.bashrc && \\
+	echo "LC_ALL=POSIX" >> /home/clfs/.bashrc && \\
+	echo "PATH=/cross-tools/bin:/bin:/usr/bin" >> /home/clfs/.bashrc && \\
+	echo "export CLFS LC_ALL PATH" >> /home/clfs/.bashrc && \\
+	echo "" >> /home/clfs/.bashrc && \\
+	echo "unset CFLAGS" >> /home/clfs/.bashrc && \\
+	echo "unset CXXFLAGS" >> /home/clfs/.bashrc && \\
+	echo "" >> /home/clfs/.bashrc && \\
+	echo "export CLFS_HOST=\"${CLFS_HOST}\"" >> /home/clfs/.bashrc && \\
+	echo "export CLFS_TARGET=\"${TARGET}\"" >> /home/clfs/.bashrc && \\
+	echo "export CLFS_TARGET32=\"${TARGET32}\"" >> /home/clfs/.bashrc && \\
+	echo "source $JHALFSDIR/envars" >> /home/clfs/.bashrc
+	@chown clfs:clfs /home/clfs/.bashrc && \\
 	touch envars && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
@@ -117,18 +117,10 @@
     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
                                   -e 's at -static@@' \
                                   -e 's at -final@@' \
-                                  -e 's at -headers@@' \
-                                  -e 's at -64@@' \
+				  -e 's at -64@@' \
                                   -e 's at -n32@@'`
-    # Adjust 'name' and patch a few scripts on the fly..
-    case $name in
-      linux-libc) name=linux-libc-headers ;;
-    esac
-    #
-    # Find the version of the command files, if it corresponds with the building of a specific package
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+    pkg_tarball=$(get_package_tarball_name $name)
 
-
     #--------------------------------------------------------------------#
     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     #--------------------------------------------------------------------#
@@ -137,13 +129,13 @@
     # as a dependency. Also call the echo_message function.
     wrt_target "${this_script}" "$PREV"
     #
-    # If $vrs isn't empty, we've got a package...
+    # If $pkg_tarball isn't empty, we've got a package...
     #
-    [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
+    [[ "$pkg_tarball" != "" ]] && wrt_unpack_clfs "$pkg_tarball"
     #
-    wrt_run_as_su "${this_script}" "${file}"
+    wrt_run_as_clfs_su "${this_script}" "${file}"
     #
-    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -168,6 +160,15 @@
     # Keep the script file name
     this_script=`basename $file`
     #
+    #  Deal with any odd scripts..
+    case $this_script in
+      *choose) # The choose script will fail if you cannot enter the new environment
+               # If the 'boot' build method was chosen don't run the script
+         [[ $METHOD = "boot" ]] && continue; ;;
+      *) ;;
+    esac
+
+    #
     # First append each name of the script files to a list (this will become
     # the names of the targets in the Makefile
     temptools="$temptools $this_script"
@@ -176,10 +177,8 @@
     # Grab the name of the target, strip id number, XXX-script
     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
     #
-    # Find the version of the command files, if it corresponds with the building of a specific package
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+    pkg_tarball=$(get_package_tarball_name $name)
 
-
     #--------------------------------------------------------------------#
     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     #--------------------------------------------------------------------#
@@ -188,15 +187,15 @@
     # as a dependency. Also call the echo_message function.
     wrt_target "${this_script}" "$PREV"
     #
-    # If $vrs isn't empty, we've got a package...
+    # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and to set the PKGDIR variable.
     #
-    [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
-    [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
+    [[ "$pkg_tarball" != "" ]] && wrt_unpack_clfs "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
-    wrt_run_as_su "${this_script}" "${file}"
+    wrt_run_as_clfs_su "${this_script}" "${file}"
     #
-    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -249,9 +248,9 @@
       *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)
 
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-
     #--------------------------------------------------------------------#
     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     #--------------------------------------------------------------------#
@@ -260,27 +259,27 @@
     # as a dependency. Also call the echo_message function.
     wrt_target "${this_script}" "$PREV"
     #
-    # If $vrs isn't empty, we've got a package...
+    # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     #
-    [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
-    [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
+    [[ "$pkg_tarball" != "" ]] && wrt_unpack_clfs "$pkg_tarball"
+    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
     # Select a script execution method
     case $this_script in
-      *changingowner*)  wrt_run_as_root "${this_script}" "${file}"    ;;
-      *devices*)        wrt_run_as_root "${this_script}" "${file}"    ;;
+      *changingowner*)  wrt_run_as_clfs_root "${this_script}" "${file}"    ;;
+      *devices*)        wrt_run_as_clfs_root "${this_script}" "${file}"    ;;
       *fstab*)   if [[ -n "$FSTAB" ]]; then
                    wrt_copy_fstab "${this_script}"
                  else
-                   wrt_run_as_su  "${this_script}" "${file}"
+                   wrt_run_as_clfs_su  "${this_script}" "${file}"
                  fi
          ;;
-      *)         wrt_run_as_su  "${this_script}" "${file}"       ;;
+      *)         wrt_run_as_clfs_su  "${this_script}" "${file}"       ;;
     esac
     #
     # Housekeeping...remove any build directory(ies) except if the package build fails.
-    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -317,8 +316,9 @@
 
     # Grab the name of the target, strip id number, XXX-script
     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
 
+    pkg_tarball=$(get_package_tarball_name $name)
+
     #--------------------------------------------------------------------#
     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     #--------------------------------------------------------------------#
@@ -327,26 +327,26 @@
     # as a dependency. Also call the echo_message function.
     wrt_target "${this_script}" "$PREV"
     #
-    # If $vrs isn't empty, we've got a package...
+    # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     #
-    if [ "$vrs" != "" ] ; then
+    if [ "$pkg_tarball" != "" ] ; then
       case $this_script in
-        *util-linux)    wrt_unpack  "$name-$vrs.tar.*"  ;;
-        *)              wrt_unpack2 "$name-$vrs.tar.*"  ;;
+        *util-linux)    wrt_unpack_clfs  "$pkg_tarball"  ;;
+        *)              wrt_unpack2 "$pkg_tarball"  ;;
       esac
       [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
     #
     # Select a script execution method
     case $this_script in
-      *kernfs)        wrt_run_as_root    "${this_script}" "${file}"  ;;
-      *util-linux)    wrt_run_as_su     "${this_script}" "${file}"  ;;
-      *)              wrt_run_as_chroot1 "${this_script}" "${file}"  ;;
+      *kernfs)        wrt_run_as_clfs_root "${this_script}" "${file}"  ;;
+      *util-linux)    wrt_run_as_clfs_su   "${this_script}" "${file}"  ;;
+      *)              wrt_run_as_chroot1   "${this_script}" "${file}"  ;;
     esac
     #
     # Housekeeping...remove the build directory(ies), except if the package build fails.
-    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -382,7 +382,7 @@
                                   -e 's at 64@@' \
                                   -e 's at n32@@'`
 
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+    pkg_tarball=$(get_package_tarball_name $name)
 
     #--------------------------------------------------------------------#
     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
@@ -392,10 +392,7 @@
     # as a dependency. Also call the echo_message function.
     wrt_target "${this_script}" "$PREV"
     #
-    case $name in
-      tcl)    wrt_unpack2 "$name$vrs-src.tar.*" ;;
-      *)      wrt_unpack2 "$name-$vrs.tar.*"    ;;
-    esac
+    wrt_unpack2 "$pkg_tarball"
     [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
     wrt_run_as_chroot1 "${this_script}" "${file}"
@@ -437,7 +434,7 @@
                                   -e 's at 64@@' \
                                   -e 's at n32@@'`
 
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+    pkg_tarball=$(get_package_tarball_name $name)
 
     #--------------------------------------------------------------------#
     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
@@ -445,12 +442,9 @@
     #
     # 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"
+    wrt_target_boot "${this_script}" "$PREV"
     #
-    case $name in
-      tcl)    wrt_unpack3 "$name$vrs-src.tar.*" ;;
-      *)      wrt_unpack3 "$name-$vrs.tar.*"    ;;
-    esac
+    wrt_unpack3 "$pkg_tarball"
     [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     #
     wrt_run_as_root2 "${this_script}" "${file}"
@@ -519,9 +513,9 @@
     # Find the version of the command files, if it corresponds with the building of
     # a specific package. We need this here to can skip scripts not needed for
     # iterations rebuilds
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+    pkg_tarball=$(get_package_tarball_name $name)
 
-    if [[ "$vrs" = "" ]] && [[ -n "$N" ]] ; then
+    if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
       case "${this_script}" in
         *stripping*) ;;
         *)  continue ;;
@@ -544,10 +538,9 @@
     # as a dependency. Also call the echo_message function.
     wrt_target "${this_script}${N}" "$PREV"
 
-    # If $vrs isn't empty, we've got a package...
-    if [ "$vrs" != "" ] ; then
-      FILE="$name-$vrs.tar.*"
-      wrt_unpack2 "$FILE"
+    # If $pkg_tarball isn't empty, we've got a package...
+    if [ "$pkg_tarball" != "" ] ; then
+      wrt_unpack2 "$pkg_tarball"
       # If the testsuites must be run, initialize the log file
       case $name in
         binutils | gcc | glibc )
@@ -563,7 +556,7 @@
     #
     wrt_run_as_chroot1 "${this_script}" "${file}"
     #
-    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -630,9 +623,10 @@
     # Find the version of the command files, if it corresponds with the building of
     # a specific package. We need this here to can skip scripts not needed for
     # iterations rebuilds
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
 
-    if [[ "$vrs" = "" ]] && [[ -n "$N" ]] ; then
+    pkg_tarball=$(get_package_tarball_name $name)
+
+    if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
       case "${this_script}" in
         *stripping*) ;;
         *)  continue ;;
@@ -653,11 +647,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}${N}" "$PREV"
+    wrt_target_boot "${this_script}${N}" "$PREV"
 
-    # If $vrs isn't empty, we've got a package...
-    if [ "$vrs" != "" ] ; then
-      FILE="$name-$vrs.tar.*"
+    # If $pkg_tarball isn't empty, we've got a package...
+    if [ "$pkg_tarball" != "" ] ; then
+      FILE="$pkg_tarball"
       wrt_unpack3 "$FILE"
       # If the testsuites must be run, initialize the log file
       case $name in
@@ -674,7 +668,7 @@
     #
     wrt_run_as_root2 "${this_script}" "${file}"
     #
-    [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
+    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -720,8 +714,9 @@
       *bootscripts*) name=bootscripts-cross-lfs ;;
       *udev-rules)   name=udev-cross-lfs ;;
     esac
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
 
+    pkg_tarball=$(get_package_tarball_name $name)
+
     #--------------------------------------------------------------------#
     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     #--------------------------------------------------------------------#
@@ -730,13 +725,13 @@
     # as a dependency. Also call the echo_message function.
     wrt_target "${this_script}" "$PREV"
     #
-    # If $vrs isn't empty, we've got a package...
+    # If $pkg_tarball isn't empty, we've got a package...
     #
-    [[ "$vrs" != "" ]] && wrt_unpack2 "$name-$vrs.tar.*"
+    [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
     #
     wrt_run_as_chroot1 "${this_script}" "${file}"
     #
-    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -781,23 +776,24 @@
       *bootscripts*) name=bootscripts-cross-lfs
        ;;
     esac
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
 
+    pkg_tarball=$(get_package_tarball_name $name)
+
     #--------------------------------------------------------------------#
     #         >>>>>>>> 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"
+    wrt_target_boot "${this_script}" "$PREV"
     #
-    # If $vrs isn't empty, we've got a package...
+    # If $pkg_tarball isn't empty, we've got a package...
     #
-    [[ "$vrs" != "" ]] && wrt_unpack3 "$name-$vrs.tar.*"
+    [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
     #
     wrt_run_as_root2 "${this_script}" "${file}"
     #
-    [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
+    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -844,8 +840,9 @@
       *kernel*) name=linux
        ;;
     esac
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
 
+    pkg_tarball=$(get_package_tarball_name $name)
+
     #--------------------------------------------------------------------#
     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     #--------------------------------------------------------------------#
@@ -854,10 +851,10 @@
     # as a dependency. Also call the echo_message function.
     wrt_target "${this_script}" "$PREV"
     #
-    # If $vrs isn't empty, we've got a package...
+    # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     #
-    [[ "$vrs" != "" ]] && wrt_unpack2 "$name-$vrs.tar.*"
+    [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
     #
     # Select a script execution method
     case $this_script in
@@ -871,7 +868,7 @@
     esac
     #
     # Housekeeping...remove any build directory(ies) except if the package build fails.
-    [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
+    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -917,12 +914,11 @@
     #
     # Grab the name of the target, strip id number and misc words.
     case $this_script in
-      *kernel) name=linux
-         ;;
+      *kernel) name=linux  ;;
       *)       name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's at -build@@' ` ;;
     esac
 
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+    pkg_tarball=$(get_package_tarball_name $name)
 
     #--------------------------------------------------------------------#
     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
@@ -930,12 +926,12 @@
     #
     # 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"
+    wrt_target_boot "${this_script}" "$PREV"
     #
-    # If $vrs isn't empty, we've got a package...
+    # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     #
-    [[ "$vrs" != "" ]] && wrt_unpack3 "$name-$vrs.tar.*"
+    [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
     #
     # Select a script execution method
     case $this_script in
@@ -951,7 +947,7 @@
     esac
     #
     # Housekeeping...remove any build directory(ies) except if the package build fails.
-    [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
+    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
     #
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
@@ -1031,7 +1027,7 @@
                                                                 -e 's|\\$|&&|g' \
                                                                 -e 's|exit||g' \
                                                                 -e 's|$| -c|' \
-                                                                -e 's|"$$LFS"|$(MOUNT_PT)|'\
+                                                                -e 's|"$$CLFS"|$(MOUNT_PT)|'\
                                                                 -e 's|set -e||'`
     echo -e "CHROOT1= $chroot\n" >> $MKFILE
   fi
@@ -1063,21 +1059,24 @@
 
 clean:  clean-chapter4 clean-chapter3 clean-chapter2
 
+restart:
+	@echo "This feature does not exist for the CLFS makefile. (yet)"
+
 clean-chapter2:
-	-if [ ! -f user-lfs-exist ]; then \\
-		userdel lfs; \\
-		rm -rf /home/lfs; \\
+	-if [ ! -f user-clfs-exist ]; then \\
+		userdel clfs; \\
+		rm -rf /home/clfs; \\
 	fi;
 	rm -rf \$(MOUNT_PT)/tools
 	rm -f /tools
 	rm -rf \$(MOUNT_PT)/cross-tools
 	rm -f /cross-tools
-	rm -f envars user-lfs-exist
+	rm -f envars user-clfs-exist
 	rm -f 02* logs/02*.log
 
 clean-chapter3:
 	rm -rf \$(MOUNT_PT)/tools/*
-	rm -f $cross_tools restore-lfs-env sources-dir
+	rm -f $cross_tools restore-clfs-env sources-dir
 	cd logs && rm -f $cross_tools && cd ..
 
 clean-chapter4:
@@ -1091,15 +1090,15 @@
 	cd logs && rm -f $temptools && cd ..
 
 
-restore-lfs-env:
+restore-clfs-env:
 	@\$(call echo_message, Building)
-	@if [ -f /home/lfs/.bashrc.XXX ]; then \\
-		mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
+	@if [ -f /home/clfs/.bashrc.XXX ]; then \\
+		mv -f /home/clfs/.bashrc.XXX /home/clfs/.bashrc; \\
 	fi;
-	@if [ -f /home/lfs/.bash_profile.XXX ]; then \\
-		mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
+	@if [ -f /home/clfs/.bash_profile.XXX ]; then \\
+		mv /home/clfs/.bash_profile.XXX /home/clfs/.bash_profile; \\
 	fi;
-	@chown lfs:lfs /home/lfs/.bash* && \\
+	@chown clfs:clfs /home/clfs/.bash* && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
@@ -1110,9 +1109,9 @@
 	@-umount \$(MOUNT_PT)/dev
 	@-umount \$(MOUNT_PT)/sys
 	@-umount \$(MOUNT_PT)/proc
-	@-if [ ! -f user-lfs-exist ]; then \\
-		userdel lfs; \\
-		rm -rf /home/lfs; \\
+	@-if [ ! -f user-clfs-exist ]; then \\
+		userdel clfs; \\
+		rm -rf /home/clfs; \\
 	fi;
 
 EOF
@@ -1142,22 +1141,25 @@
 
 clean:  clean-makesys clean-makeboot clean-jhalfs
 
+restart:
+	@echo "This feature does not exist for the CLFS makefile. (yet)"
+
 clean-jhalfs:
-	-if [ ! -f user-lfs-exist ]; then \\
-		userdel lfs; \\
-		rm -rf /home/lfs; \\
+	-if [ ! -f user-clfs-exist ]; then \\
+		userdel clfs; \\
+		rm -rf /home/clfs; \\
 	fi;
 	rm -rf \$(MOUNT_PT)/tools
 	rm -f /tools
 	rm -rf \$(MOUNT_PT)/cross-tools
 	rm -f /cross-tools
-	rm -f envars user-lfs-exist
+	rm -f envars user-clfs-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-lfs-env sources-dir
+	rm -f restore-clfs-env sources-dir
 	cd logs && rm -f $cross_tools && rm -f $temptools && rm -f $chroottools && rm -f $boottools && cd ..
 
 clean-makesys:
@@ -1173,15 +1175,15 @@
 	cd logs && rm -f $basicsystem && rm -f $bootscripttools && rm -f $bootabletools && cd ..
 
 
-restore-lfs-env:
+restore-clfs-env:
 	@\$(call echo_message, Building)
-	@if [ -f /home/lfs/.bashrc.XXX ]; then \\
-		mv -fv /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
+	@if [ -f /home/clfs/.bashrc.XXX ]; then \\
+		mv -fv /home/clfs/.bashrc.XXX /home/clfs/.bashrc; \\
 	fi;
-	@if [ -f /home/lfs/.bash_profile.XXX ]; then \\
-		mv -v /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
+	@if [ -f /home/clfs/.bash_profile.XXX ]; then \\
+		mv -v /home/clfs/.bash_profile.XXX /home/clfs/.bash_profile; \\
 	fi;
-	@chown lfs:lfs /home/lfs/.bash* && \\
+	@chown clfs:clfs /home/clfs/.bash* && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)

Copied: jhalfs/branches/experimental/CLFS2 (from rev 2840, jhalfs/trunk/CLFS2)

Modified: jhalfs/branches/experimental/HLFS/config
===================================================================
--- jhalfs/branches/experimental/HLFS/config	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/HLFS/config	2006-07-26 18:42:01 UTC (rev 2841)
@@ -38,6 +38,7 @@
 
 #--- Book version
 LFSVRS=development
+TREE=trunk/BOOK
 
 #--- Name of the makefile
 MKFILE=$JHALFSDIR/Makefile

Modified: jhalfs/branches/experimental/HLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/HLFS/master.sh	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/HLFS/master.sh	2006-07-26 18:42:01 UTC (rev 2841)
@@ -119,13 +119,14 @@
 
     # Adjust 'name'
     case $name in
-      linux-libc) name=linux-libc-headers ;;
+      linux-libc) name="linux-libc-headers" ;;
+      gcc)        name="gcc-core"  ;;
+      uclibc)     name="uClibc"  ;;
     esac
 
     # Set the dependency for the first target.
     if [ -z $PREV ] ; then PREV=022-settingenvironment ; fi
 
-
     #--------------------------------------------------------------------#
     #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     #--------------------------------------------------------------------#
@@ -136,22 +137,13 @@
 
     # Find the version of the command files, if it corresponds with the building of
     # a specific package
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-    # If $vrs isn't empty, we've got a package...
-    if [ "$vrs" != "" ] ; then
-      # Deal with non-standard names
-      case $name in
-        tcl)    FILE="$name$vrs-src.tar.*"  ;;
-        uclibc) FILE="uClibc-$vrs.tar.*"    ;;
-        gcc)    FILE="gcc-core-$vrs.tar.*"  ;;
-        *)      FILE="$name-$vrs.tar.*"     ;;
-      esac
+    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.
       case $this_script in
-        *binutils* )
-          wrt_unpack "$FILE" 1 ;; # Do not delete an existing package directories
-        *)
-          wrt_unpack "$FILE" ;;
+        *binutils* )  wrt_unpack "$pkg_tarball" 1 ;; # Do not delete an existing package directories
+        *)            wrt_unpack "$pkg_tarball" ;;
       esac
       # If the testsuites must be run, initialize the log file
       [[ "$TEST" = "3" ]] && wrt_test_log "${this_script}"
@@ -180,12 +172,11 @@
     # Remove the build directory(ies) except if the package build fails
     # (so we can review config.cache, config.log, etc.)
     # For Binutils the sources must be retained for some time.
-    if [ "$vrs" != "" ] ; then
+    if [ "$pkg_tarball" != "" ] ; then
       case "${this_script}" in
-        *binutils*) : # do NOTHING
-          ;;
-        *) wrt_remove_build_dirs "$name"
-          ;;
+        *binutils*) : ;;   # do NOTHING
+	*gcc*) wrt_remove_build_dirs "gcc"    ;;
+        *)     wrt_remove_build_dirs "$name"    ;;
       esac
     fi
 
@@ -271,11 +262,25 @@
     # Grab the name of the target
     name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
 
+    #
+    # Sed replacement to fix some rm command that could fail.
+    # That should be fixed in the book sources.
+    #
+    case $name in
+      glibc)  sed 's/rm /rm -f /' -i chapter06$N/$this_script        ;;
+      gcc)    sed 's/rm /rm -f /' -i chapter06$N/$this_script        ;;
+    esac
+
+    case $name in
+      gcc)     name="gcc-core" ;;
+      uclibc)  name="uClibc"   ;;
+    esac
+
     # Find the version of the command files, if it corresponds with the building of
     # a specific package
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+    pkg_tarball=$(get_package_tarball_name $name)
 
-    if [[ "$vrs" = "" ]] && [[ -n "$N" ]] ; then
+    if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
       case "${this_script}" in
         *stripping*) ;;
         *)  continue ;;
@@ -290,42 +295,23 @@
     # the names of the logs to be moved for each iteration)
     LOGS="$LOGS ${this_script}"
 
-    #
-    # Sed replacement to fix some rm command that could fail.
-    # That should be fixed in the book sources.
-    #
-    case $name in
-      glibc)
-          sed 's/rm /rm -f /' -i chapter06$N/$this_script
-        ;;
-      gcc)
-          sed 's/rm /rm -f /' -i chapter06$N/$this_script
-        ;;
-    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.
+    # as a dependency. Also call the echo_message function.		
     wrt_target "${this_script}${N}" "$PREV"
 
-    # If $vrs isn't empty, we've got a package...
+    # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
-    if [ "$vrs" != "" ] ; then
-      # Deal with non-standard names
-      case $name in
-        tcl)    FILE="$name$vrs-src.tar.*" ;;
-        uclibc) FILE="uClibc-$vrs.tar.*" ;;
-        gcc)    FILE="gcc-core-$vrs.tar.*" ;;
-        *)      FILE="$name-$vrs.tar.*" ;;
-      esac
-      wrt_unpack2 "$FILE"
+    if [ "$pkg_tarball" != "" ] ; then
+      wrt_unpack2 "$pkg_tarball"
       wrt_target_vars
       # If the testsuites must be run, initialize the log file
       case $name in
-        binutils | gcc | glibc )
+        binutils | gcc-core | glibc )
           [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
           ;;
         * )
@@ -353,7 +339,7 @@
     esac
     #
     # Remove the build directory(ies) except if the package build fails.
-    if [ "$vrs" != "" ] ; then
+    if [ "$pkg_tarball" != "" ] ; then
       wrt_remove_build_dirs "$name"
     fi
     #
@@ -427,11 +413,9 @@
 
     case "${this_script}" in
       *bootscripts*)
-        vrs=`grep "^lfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-        FILE="lfs-bootscripts-$vrs.tar.*"
-        wrt_unpack2 "$FILE"
-        vrs=`grep "^blfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-        echo -e "\t at echo \"\$(MOUNT_PT)\$(SRC)/blfs-bootscripts-$vrs\" >> sources-dir" >> $MKFILE.tmp
+        wrt_unpack2 $(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
         ;;
     esac
 
@@ -546,6 +530,8 @@
 
 clean:  clean-chapter7 clean-chapter6 clean-chapter5 clean-chapter3
 
+restart: restart_code all
+
 clean-chapter3:
 	-if [ ! -f user-lfs-exist ]; then \\
 		userdel lfs; \\
@@ -599,6 +585,47 @@
 		rm -rf /home/lfs; \\
 	fi;
 
+restart_code:
+	@echo ">>> This feature is experimental, BUGS may exist"	
+	
+	@if [ ! -L /tools ]; then \\
+	  echo -e "\\nERROR::\\n /tools is NOT a symlink.. /tools must point to \$(MOUNT_PT)/tools\\n" && false;\\
+	fi;
+	
+	@if [ ! -e /tools ]; then \\
+	  echo -e "\\nERROR::\\nThe target /tools points to does not exist.\\nVerify the target.. \$(MOUNT_PT)/tools\\n" && false;\\
+	fi;
+	
+	@if ! stat -c %N /tools | grep "\$(MOUNT_PT)/tools" >/dev/null ; then \\
+	  echo -e "\\nERROR::\\nThe symlink \\"/tools\\" does not point to \\"\$(MOUNT_PT)/tools\\".\\nCorrect the problem and rerun\\n" && false;\\
+	fi;	
+
+	@if [ -f ???-kernfs ]; then \\
+	  mkdir -pv \$(MOUNT_PT)/{proc,sys};\\
+	  if !  mount -l | "\$(MOUNT_PT)/dev" >/dev/null ; then \\
+	    mount -vt ramfs ramfs \$(MOUNT_PT)/dev;\\
+	  fi;\\
+	  if [ ! -e \$(MOUNT_PT)/dev/console ]; then \\
+	    mknod -m 600 \$(MOUNT_PT)/dev/console c 5 1;\\
+	  fi;\\
+	  if [ ! -e \$(MOUNT_PT)/dev/null ]; then \\
+	    mknod -m 666 \$(MOUNT_PT)/dev/null c 1 3;\\
+	  fi;\\
+	  if ! mount -l | grep "\$(MOUNT_PT)/dev/pts" >/dev/null ; then \\
+	    mount -vt devpts -o gid=4,mode=620 devpts \$(MOUNT_PT)/dev/pts;\\
+	  fi;\\
+	  if ! mount -l | grep "\$(MOUNT_PT)/dev/shm" >/dev/null ; then \\
+	    mount -vt tmpfs shm \$(MOUNT_PT)/dev/shm;\\
+	  fi;\\
+	  if ! mount -l | grep "\$(MOUNT_PT)/proc" >/dev/null ; then \\
+	    mount -vt proc proc \$(MOUNT_PT)/proc;\\
+	  fi;\\
+	  if ! mount -l | grep "\$(MOUNT_PT)/sys" >/dev/null ; then \\
+	    mount -vt sysfs sysfs \$(MOUNT_PT)/sys;\\
+	  fi;\\
+	fi;
+
+
 EOF
 ) >> $MKFILE
 

Modified: jhalfs/branches/experimental/LFS/config
===================================================================
--- jhalfs/branches/experimental/LFS/config	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/LFS/config	2006-07-26 18:42:01 UTC (rev 2841)
@@ -10,10 +10,10 @@
 FSTAB=
 
 #--- Fully qualified path to a kernel config file
-# If no config file is  specified the kernel is NOT compiled
+# If no config file is specified the kernel is NOT compiled
 CONFIG=
 
-# Get the kernel package and patches even if no configutation file
+# Get the kernel package and patches even if no configuration file
 # has been supplied? 0(no)/1(yes)
 GETKERNEL=0
 
@@ -32,6 +32,7 @@
 
 #--- Book version
 LFSVRS=development
+TREE=trunk/BOOK
 
 #--- Name of the makefile
 MKFILE=$JHALFSDIR/Makefile

Modified: jhalfs/branches/experimental/LFS/master.sh
===================================================================
--- jhalfs/branches/experimental/LFS/master.sh	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/LFS/master.sh	2006-07-26 18:42:01 UTC (rev 2841)
@@ -106,18 +106,12 @@
 
     # Find the version of the command files, if it corresponds with the building of
     # a specific package
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+    pkg_tarball=$(get_package_tarball_name $name)
 
-    # If $vrs isn't empty, we've got a package...
-    if [ "$vrs" != "" ] ; then
-      if [ "$name" = "tcl" ] ; then
-        FILE="$name$vrs-src.tar.*"
-      else
-        FILE="$name-$vrs.tar.*"
-      fi
-
+    # 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 "$FILE"
+      wrt_unpack "$pkg_tarball"
       # If the testsuites must be run, initialize the log file
       [[ "$TEST" = "3" ]] && wrt_test_log "${this_script}"
       # If using optimizations, write the instructions
@@ -134,7 +128,7 @@
 
     # Remove the build directory(ies) except if the package build fails
     # (so we can review config.cache, config.log, etc.)
-    if [ "$vrs" != "" ] ; then
+    if [ "$pkg_tarball" != "" ] ; then
       wrt_remove_build_dirs "$name"
     fi
 
@@ -195,9 +189,9 @@
     # Find the version of the command files, if it corresponds with the building of
     # a specific package. We need this here to can skip scripts not needed for
     # iterations rebuilds
-    vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
+    pkg_tarball=$(get_package_tarball_name $name)
 
-    if [[ "$vrs" = "" ]] && [[ -n "$N" ]] ; then
+    if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
       case "${this_script}" in
         *stripping*) ;;
         *)  continue ;;
@@ -220,11 +214,10 @@
     # as a dependency. Also call the echo_message function.
     wrt_target "${this_script}${N}" "$PREV"
 
-    # If $vrs isn't empty, we've got a package...
+    # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
-    if [ "$vrs" != "" ] ; then
-      FILE="$name-$vrs.tar.*"
-      wrt_unpack2 "$FILE"
+    if [ "$pkg_tarball" != "" ] ; then
+      wrt_unpack2 "$pkg_tarball"
       # If the testsuites must be run, initialize the log file
       case $name in
         binutils | gcc | glibc )
@@ -246,7 +239,7 @@
     esac
 
     # Remove the build directory(ies) except if the package build fails.
-    if [ "$vrs" != "" ] ; then
+    if [ "$pkg_tarball" != "" ] ; then
       wrt_remove_build_dirs "$name"
     fi
 
@@ -304,14 +297,14 @@
     # Find the bootscripts and kernel package names
     case "${this_script}" in
       *bootscripts)
-          vrs=`grep "^lfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-          FILE="lfs-bootscripts-$vrs.tar.*"
-          wrt_unpack2 "$FILE"
+            name="lfs-bootscripts"
+            pkg_tarball=$(get_package_tarball_name $name)
+            wrt_unpack2 "$pkg_tarball"
         ;;
       *kernel)
-          vrs=`grep "^linux-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-          FILE="linux-$vrs.tar.*"
-          wrt_unpack2 "$FILE"
+            name="linux"
+            pkg_tarball=$(get_package_tarball_name $name)
+            wrt_unpack2 "$pkg_tarball"
        ;;
     esac
 
@@ -502,7 +495,7 @@
 	  if ! mount -l | grep "\$(MOUNT_PT)/proc" >/dev/null ; then \\
 	    mount -vt proc proc \$(MOUNT_PT)/proc;\\
 	  fi;\\
-	  if ! mount -l | grep "$\(MOUNT_PT)/sys" >/dev/null ; then \\
+	  if ! mount -l | grep "\$(MOUNT_PT)/sys" >/dev/null ; then \\
 	    mount -vt sysfs sysfs \$(MOUNT_PT)/sys;\\
 	  fi;\\
 	fi;

Modified: jhalfs/branches/experimental/README
===================================================================
--- jhalfs/branches/experimental/README	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/README	2006-07-26 18:42:01 UTC (rev 2841)
@@ -4,7 +4,7 @@
 
      This collection of scripts, known as jhalfs-X, strives to create
   accurate makefiles from the Linux From Scratch book series XML files.
-  This software is an evolution of the original "jhalfs" code.
+  This software is an evolution of the original "jhalfs-0.2" code.
 
      The usage of this script assumes you have read and are familiar with
   the book(s) and, therefore, the configuration variables found in config
@@ -33,7 +33,16 @@
      The script master.sh cannot be invoked directly but only via the
   supplied symlinks. After editing the config file for the project you wish
   to build, run the script.
-  
+
+     IMPORTANT:
+       If you use the switch -M (automatically run the generated makefile) you
+       must be 'root' or you can run the scripts using 'sudo'
+        i.e.  sudo ./lfs -G -M
+
+       If you want to run make manually you can only do so if you are 'root' or
+       via 'sudo'
+        i.e  (from within the jhalfs directory) sudo make
+
      The term <symlink> refers to the 1 of 3 package symlinks, lfs,hlfs,clfs.
      Replace <symlink> with your choice of packages; i.e.: ./lfs
 
@@ -50,12 +59,52 @@
      ./<symlink> --help		eg: ./lfs --help
      will give you a context sensitive list of command line switches.
 
+   >>>> an expanded example
+
+   export SRC_ARCHIVE=/mnt/SourceFiles
+
+   ./lfs -D /mnt/partition4 \
+         -K ~/jhalfs_configs/linux-2.6.16.19-LFS.config \
+	 -F ~/jhalfs-configs/fstab-sda3 \
+	 -G -T 0 -M
+
+   explanation:::
+
+   export SRC_ARCHIVE=/mnt/SourceFiles
+      # This points to a local archive of existing packages. If the version in
+        the archive is incorrect jhalfs will access the net and download the
+	necessary version and store it here for later use. DO NOT set this to
+	$BUILDDIR/sources. If you do not set this variable to a valid directory
+	ALL package tarballs will be downloaded from the 'net.
+
+   -D /mnt/partition4
+      # where everything takes place.  ..NOTE it must already exist and be mounted
+
+   -K ~/jhalfs_configs/linux-2.6.16.19-LFS.config
+      # If you want to automatically build a the kernel you MUST supply a valid
+        kernel configuration file. The file you supply will be copied and renamed.
+
+   -F ~/jhalfs-configs/fstab-sda3
+      # If you have a fstab file you wish to use it will be copied and renamed
+
+   -G   # Retrieve the package files. You MUST enable this flag at least once if you
+          wish to do a build or whenever you update the book.
+
+   -T 0 # don't run any testsuites
+
+   -M   # automatically run make against Makefile once jhalfs finishes its work.
+
+
 5. LAYOUT::
 
         /CLFS/config
              /master.sh
              /xxxx.xsl
 
+        /CLFS2/config
+              /master.sh
+              /xxxx.xsl
+
         /HLFS/config
              /master.sh
              /xxxx.xsl
@@ -83,18 +132,30 @@
 	 TODO
 
 	 ./clfs  ---|
+	 ./clfs2 ---|
 	 ./hlfs  ---|+---> master.sh
 	 ./lfs   ---|
 
 
 6. FAQ::
+    Q. "This 'help' file is very sparse"
+    A. Yes, it is. This tool, jhalfs, is for those who understand the LFS books
+       and wish to automate the build. 99% of any problems that arise can be
+       solved by reading the book(s).
+
     Q. "It doesn't work!"
     A. Yes it does, try ./lfs --help
 
+    Q. "It still doesn't work"
+    A. jhalfs was designed to work against the developement versions of the LFS
+       series of books. Consequently changes in a book(s) sometimes breaks older
+       versions of jhalfs. Before you start pulling out your hair download the
+       latest version of jhalfs to see if that solves your problem.
+
     Q. "How do I specify the build location?"
-    A. The original LFS document worked against the well know location /mnt/lfs.
+    A. The original LFS document worked against the well known location /mnt/lfs.
        This script automates the build of all of the LFS series of books and uses
-       a generic location $BUILDDIR with a default value a /mnt/build_dir.
+       a generic location $BUILDDIR with a default value of /mnt/build_dir.
        You may change this value to suit your needs.
 
        The layout below $BUILDDIR is as follows.
@@ -109,23 +170,39 @@
 
     Q. "What is the function of the SRC_ARCHIVE variable?"
     A. When then symlinked master.sh runs it creates a local copy of the
-       necessary packages in BUILDDIR/sources by downloading the files. If 
-       the variable SRC_ARCHIVE is defined the software will first look in 
+       necessary packages in BUILDDIR/sources by downloading the files. If
+       the variable SRC_ARCHIVE is defined the software will first look in
        this location for the file and, if found, will copy it to BUILDDIR/sources.
-       If the files are not found in SRC_ARCHIVE _and_ you have write priv to 
+       If the files are not found in SRC_ARCHIVE _and_ you have write priv to
        the directory any downloaded files will be mirrored there.
 
     Q. "How do I set the SRC_ARCHIVE location?"
     A. The best way to set the value of SRC_ARCHIVE is
        export SRC_ARCHIVE=/wherever/you/store/downloaded/packages
                        OR
-       you can change the setting in .common/config.
+       you can change the setting in common/config.
 
     Q. "Why have 2 copies of the files?"
-    A. The package files must be visible during the chroot phase and this is a 
+    A. The package files must be visible during the chroot phase and this is a
        simple and reliable method of doing so. This method also handles the CLFS
        build method where the final build may be done on a separate machine.
 
+    Q. "When I try to build 'xxx' with clfs the makefile fails at the mid-point"
+    A. There could be numerous reasons for the failure but the most likely reason
+       is you are doing a cross-build using the 'chroot' method and the target is
+       not compatible with the host.  If you choose to build using the chroot
+       method a test is performed at the end of the temptools phase. If the test
+       succeeds the build continues inside a chroot jail. However if the test fails
+       it means the host and target are not compatible an you should use the
+       'boot' method to create your target code.
+       As an extreme example: You can build a sparc target on a x86 platform but
+       only the temptools phase. You must run ./clfs using the 'boot' method and
+       not the 'chroot.' You must transfer the toolchain to a sparc platform, reboot
+       the sparc box and continue the build.
+       Of all the LFS series of books Cross-LFS requires the greatest
+       understanding of host/target hardware combination. Please read the book
+       carefully and don't skip the easy parts (there are none..)
+
 Authors:
   George Boudreau
   Manuel Canales Esparcia

Modified: jhalfs/branches/experimental/common/common-functions
===================================================================
--- jhalfs/branches/experimental/common/common-functions	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/common/common-functions	2006-07-26 18:42:01 UTC (rev 2841)
@@ -52,8 +52,12 @@
 
 ${BOLD}  -B, --book VER${OFF}
         use VER version of the book as the system to build.
-        Supported versions are: dev*, trunk, SVN
-        These are aliases for the Development version of {C,H}LFS
+        Supported VER values are:
+          dev*, trunk, SVN = aliases for the Development version of {C,H}LFS
+          branch-NAME = a branch of name NAME
+          VERSION = the version of a stable released book
+        To know what branches and stable books work with this version of jhalfs
+        please see http://wiki.linuxfromscratch.org/alfs/wiki/SupportedBooks
 
 ${BOLD}  -D  --directory DIR${OFF}
         use DIR directory for building ${BOLD}$(echo $PROGNAME | tr [a-z] [A-Z])${OFF}; all files jhalfs-X produces
@@ -83,14 +87,14 @@
 ${BOLD}  -W, --working-copy DIR${OFF}
         use the local working copy placed in DIR as the $(echo $PROGNAME | tr [a-z] [A-Z]) book
 
-${BOLD}  -C, --comparasion TYPE${OFF}
+${BOLD}  -C, --comparison TYPE${OFF}
          do iterative comparison analysis. This extends the total build time
          considerably because the entire final system will rebuild itself
          the number of times specified by ITERATIONS in common/config.
          Types allowed are:
            ICA   = do ICA as designed by Greg Schafer
            farce = do the farce analysis designed by Ken Moffat
-           both  = perfom both ICA and farce analysis
+           both  = perform both ICA and farce analysis
 
 ${BOLD}  -F, --fstab FILE${OFF}
         use FILE as the /etc/fstab file for the ${BOLD}$(echo $PROGNAME | tr [a-z] [A-Z])${OFF} system. If not specified,
@@ -104,7 +108,7 @@
         run make on the generated Makefile
 
 ${BOLD}  -R --rebuild${OFF}
-        clean the build directory before perfoming any other task. The directory
+        clean the build directory before performing any other task. The directory
         is cleaned only if it was populated by a previous jhalfs-X run.
 -EOF-
 
@@ -127,6 +131,18 @@
         Select the build method, chroot or boot
 -EOF-
 
+[[ ${PROGNAME} = "clfs2" ]] &&
+cat <<- -EOF-
+
+${BOLD}  -A, --arch ARCH ${OFF}
+        Select the TARGET architecture, valid selections are:
+           32bit builds
+        arm
+           64bit builds
+
+	64bit multi-lib
+-EOF-
+
 [[ ${PROGNAME} = "hlfs" ]] &&
 cat <<- -EOF-
 
@@ -209,6 +225,41 @@
 
 
 #----------------------------------#
+wrt_target_boot() {                # 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 \$@ &
+	@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..
+   # hopefully this will not cause problems.
+   #
+   case $script_name in
+     tcl)   echo $(grep "^tcl" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
+     *)     echo $(grep "^$script_name-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
+   esac
+
+}
+
+#----------------------------------#
 wrt_remove_existing_dirs() {       #
 #----------------------------------#
   local PKG_NAME=$1
@@ -265,6 +316,26 @@
 
 
 #----------------------------------#
+wrt_unpack_clfs() {                # Unpack and set 'ROOT' var
+#----------------------------------#
+  local FILE=$1
+  local optSAVE_PREVIOUS=$2
+
+  if [ "${optSAVE_PREVIOUS}" != "1" ]; then
+    wrt_remove_existing_dirs "$FILE"
+  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 clfs \$(MOUNT_PT)\$(SRC)/\$\$ROOT
+EOF
+) >> $MKFILE.tmp
+}
+
+
+#----------------------------------#
 wrt_unpack2() {                    #
 #----------------------------------#
   local FILE=$1
@@ -367,6 +438,34 @@
 
 
 #----------------------------------#
+wrt_run_as_clfs_su() {             # Execute script inside time { }, footer to log file
+#----------------------------------#
+  local this_script=$1
+  local file=$2
+(
+cat << EOF
+	@( time { su - clfs -c "source /home/clfs/.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
+EOF
+) >> $MKFILE.tmp
+}
+
+
+#----------------------------------#
+wrt_run_as_clfs_root() {           # Some scripts must be run as root..
+#----------------------------------#
+  local this_script=$1
+  local file=$2
+(
+cat << EOF
+	@( time { export CLFS=\$(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
+EOF
+) >> $MKFILE.tmp
+}
+
+
+#----------------------------------#
 wrt_run_as_root2() {               #
 #----------------------------------#
   local this_script=$1
@@ -535,7 +634,7 @@
       echo -ne "Cleaning $BUILDDIR...\n"
       rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,tools,cross-tools,usr,var}
       echo -ne "Cleaning $JHALFSDIR...\n"
-      rm -rf $JHALFSDIR/{0*,1*,envars,sources-dir,*commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
+      rm -rf $JHALFSDIR/{0*,1*,envars,sources-dir,*commands,*logs,Makefile,*.xsl,makefile-functions,pkg_tarball_list,*.config,*.sh}
       echo -ne "Cleaning remainig extracted sources in $BUILDDIR/sources...\n"
       rm -rf `find $BUILDDIR/sources/* -maxdepth 0 -type d`
       echo -ne "done\n"
@@ -558,6 +657,7 @@
       lfs) svn_root="LFS" ;;
       hlfs) svn_root="HLFS" ;;
       clfs) svn_root="cross-lfs" ;;
+      clfs2) svn_root="cross-lfs" ;;
       *) echo "BOOK not defined in function <get_book>"
           exit 1 ;;
     esac
@@ -566,38 +666,34 @@
     # sources.
     if [ -d ${PROGNAME}-$LFSVRS ] ; then
       cd ${PROGNAME}-$LFSVRS
-      if LC_ALL=C svn up | grep -q At && test -d $JHALFSDIR/${PROGNAME}-commands && \
-      test -f $JHALFSDIR/packages ; then
+      if LC_ALL=C svn up | grep -q At && \
+         test -d $JHALFSDIR/${PROGNAME}-commands && \
+         test -f $JHALFSDIR/pkg_tarball_list ; then
+        # Set the canonical book version
         echo -ne "done\n"
-        # Set the canonical book version
         cd $JHALFSDIR
-        VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
+        case $PROGNAME in
+          clfs | clfs2)
+            VERSION=$(xmllint --noent $BOOK/prologue/$ARCH/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //'  -e 's/<\/.*//') ;;
+          *)
+            VERSION=$(xmllint --noent $BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //'  -e 's/<\/.*//')  ;;
+        esac
         get_sources
       else
         echo -ne "done\n"
-        # Set the canonical book version
-        cd $JHALFSDIR
-        VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
         extract_commands
       fi
     else
-      case $LFSVRS in
-        development)
-           svn co $SVN/${svn_root}/trunk/BOOK ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1 ;;
-      esac
+      svn co $SVN/${svn_root}/${TREE} ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1
       echo -ne "done\n"
-      # Set the canonical book version
-      cd $JHALFSDIR
-      VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
       extract_commands
     fi
+
   else
     echo -ne "Using $BOOK as book's sources ...\n"
-    # Set the canonical book version
-    cd $JHALFSDIR
-    VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
     extract_commands
   fi
+  echo -ne " Document version ${L_arrow}${BOLD}${VERSION}${R_arrow}\n"
 }
 
 #----------------------------#
@@ -609,7 +705,12 @@
   exit 1"
 
   cd $JHALFSDIR
-  VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
+  case $PROGNAME in
+    clfs | clfs2 )
+      VERSION=$(xmllint --noent $BOOK/prologue/$ARCH/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //'  -e 's/<\/.*//') ;;
+    *)
+      VERSION=$(xmllint --noent $BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //'  -e 's/<\/.*//')  ;;
+  esac
 
   # Start clean
   if [ -d ${PROGNAME}-commands ]; then
@@ -633,6 +734,19 @@
                  --stringparam keymap $KEYMAP \
                  -o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
       ;;
+
+    clfs2)
+        echo -n " ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture"
+        xsltproc --nonet \
+                 --xinclude \
+                 --stringparam testsuite $TEST \
+                 --stringparam vim-lang $VIMLANG \
+                 --stringparam timezone $TIMEZONE \
+                 --stringparam page $PAGE \
+                 --stringparam lang $LANG \
+                 --stringparam keymap $KEYMAP \
+                 -o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
+      ;;
     hlfs)
         echo -n " ${L_arrow}${BOLD}$MODEL${R_arrow} HLFS libc implementation"
         xsltproc --nonet \
@@ -667,17 +781,39 @@
   chmod -R +x $JHALFSDIR/${PROGNAME}-commands
 
   # Create the packages file. We need it for proper Makefile creation
-  rm -f packages
-  echo -n "Creating <${PROGNAME}> specific packages file"
-  grep "\-version " $BOOK/packages.ent | sed -e 's@<!ENTITY @@' \
-                                             -e 's@">@"@' > packages
-  echo " ...OK"
+  create_package_list
 
   # Done. Moving on...
   get_sources
 }
 
 #----------------------------#
+create_package_list() {      #
+#----------------------------#
+
+  # Create the packages file. We need it for proper Makefile creation
+  rm -f pkg_tarball_list
+  echo -n "Creating <${PROGNAME}> list of tarball names for $BOOK $ARCH"
+  case ${PROGNAME} in
+    clfs | clfs2)
+        xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \
+                 $BOOK/materials/${ARCH}-chapter.xml >>$LOGDIR/$LOG 2>&1
+      ;;
+    hlfs)
+        xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \
+                 $BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1
+      ;;
+    lfs)
+        xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \
+                 $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
+      ;;
+  esac
+  echo " ...OK"
+
+}
+
+
+#----------------------------#
 get_sources() {              # Download file, write name to MISSING_FILES.DMP if an error
 #----------------------------#
   local saveIFS=$IFS
@@ -793,14 +929,13 @@
   done
 
   if [[ -s MISSING_FILES.DMP ]]; then
-    echo  -e "\n\n${tab_}${RED} One or more files were not retrieved or have a bad MD5SUMS chechsum.\n${tab_} Check ${L_arrow}$BUILDDIR/sources/MISSING_FILES.DMP${R_arrow} for names ${OFF}\n"
-      # Do not allow the automatic exection of the Makefile.
+    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
   fi
 }
 
-
 #----------------------------#
 create_urls() {              #
 #----------------------------#
@@ -815,6 +950,14 @@
                  $BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
         echo " ...OK"
       ;;
+    clfs2)
+        echo -n "Creating CLFS2 <${ARCH}> specific URLs file"
+        xsltproc --nonet --xinclude \
+                 --stringparam server $SERVER \
+                 -o $BUILDDIR/sources/urls.lst urls.xsl \
+                 $BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
+        echo " ...OK"
+      ;;
     hlfs)
         echo -n "Creating HLFS <${MODEL}> specific URLs file"
         xsltproc --nonet --xinclude \

Modified: jhalfs/branches/experimental/common/config
===================================================================
--- jhalfs/branches/experimental/common/config	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/common/config	2006-07-26 18:42:01 UTC (rev 2841)
@@ -16,6 +16,8 @@
 REPORT=1
 
 #=== 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
 
@@ -30,7 +32,7 @@
 SERVER=ftp://ftp.lfs-matrix.net
 
 #=== Build options ===
-#--- Run the makefile at the end  0(no)/1(yes)
+#--- Automatically run the makefile once it has been created  0(no)/1(yes)
 RUNMAKE=0
 
 #--- Optimize the build  [0-2]

Modified: jhalfs/branches/experimental/common/func_compare.sh
===================================================================
--- jhalfs/branches/experimental/common/func_compare.sh	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/common/func_compare.sh	2006-07-26 18:42:01 UTC (rev 2841)
@@ -34,8 +34,6 @@
   fi
 
   echo -e "\nsystem_build_$RUN: $PREV_IT $system_build" >> $MKFILE.tmp
-  PREV=system_build_$RUN
-
 }
 
 #----------------------------------#
@@ -112,6 +110,7 @@
 	mv ${LOGS} $ITERATION && \\
 	popd 1> /dev/null
 	@touch \$@ && \\
+        sleep .25 && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
 EOF

Modified: jhalfs/branches/experimental/common/func_validate_configs.sh
===================================================================
--- jhalfs/branches/experimental/common/func_validate_configs.sh	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/common/func_validate_configs.sh	2006-07-26 18:42:01 UTC (rev 2841)
@@ -36,8 +36,8 @@
     ;;
    "x86_64-64")  [[ "${TARGET}" = "x86_64-unknown-linux-gnu" ]] && return
     ;;
-   "mips64-64")  [[ "${TARGET}" = "mipsel-unknown-linux-gnu" ]] && return
-                 [[ "${TARGET}" = "mips-unknown-linux-gnu"   ]] && return
+   "mips64-64")  [[ "${TARGET}" = "mips64el-unknown-linux-gnu" ]] && return
+                 [[ "${TARGET}" = "mips64-unknown-linux-gnu"   ]] && return
     ;;
    "sparc64-64") [[ "${TARGET}" = "sparc64-unknown-linux-gnu" ]] && return
     ;;
@@ -46,18 +46,20 @@
    "x86_64")     [[ "${TARGET}"   = "x86_64-unknown-linux-gnu" ]] &&
                  [[ "${TARGET32}" = "i686-pc-linux-gnu" ]] && return
     ;;
-   "mips64")     [[ "${TARGET}"   = "mipsel-unknown-linux-gnu" ]] &&
+   "mips64")     [[ "${TARGET}"   = "mips64el-unknown-linux-gnu" ]] &&
                  [[ "${TARGET32}" = "mipsel-unknown-linux-gnu" ]] && return
 
-                 [[ "${TARGET}"   = "mips-unknown-linux-gnu" ]] &&
+                 [[ "${TARGET}"   = "mips64-unknown-linux-gnu" ]] &&
                  [[ "${TARGET32}" = "mips-unknown-linux-gnu" ]] && return
     ;;
    "sparc64")    [[ "${TARGET}"   = "sparc64-unknown-linux-gnu" ]] &&
-                 [[ "${TARGET32}" = "sparcv9-unknown-linux-gnu" ]] && return
+                 [[ "${TARGET32}" = "sparc-unknown-linux-gnu" ]] && return
     ;;
    "ppc64")      [[ "${TARGET}"   = "powerpc64-unknown-linux-gnu" ]] &&
                  [[ "${TARGET32}" = "powerpc-unknown-linux-gnu"   ]] && return
     ;;
+   "arm")        [[ "${TARGET}"   = "arm-unknown-linux-gnu" ]] && return
+    ;;
    *)  write_error_and_die
    ;;
  esac
@@ -84,9 +86,10 @@
 inline_doc
 
   # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
-  local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL KEYMAP         PAGE TIMEZONE LANG LC_ALL"
-  local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD  ARCH  TARGET  TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG"
-  local -r  lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                       TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL        VIMLANG PAGE TIMEZONE LANG"
+  local -r  hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL KEYMAP         PAGE TIMEZONE LANG LC_ALL"
+  local -r  clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD  ARCH  TARGET  TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG"
+  local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE         ARCH  TARGET       OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL KEYMAP VIMLANG PAGE TIMEZONE LANG"
+  local -r   lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                       TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL        VIMLANG PAGE TIMEZONE LANG"
 
   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=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
@@ -208,7 +211,7 @@
       MODEL)      validate_against_str "xglibcx xuclibcx" ;;
       PAGE)       validate_against_str "xletterx xA4x" ;;
       METHOD)     validate_against_str "xchrootx xbootx" ;;
-      ARCH)       validate_against_str "xx86x xx86_64x xx86_64-64x xsparcx xsparc64x xsparc64-64x xmipsx xmips64x xmips64-64x xppcx xppc64x xalphax" ;;
+      ARCH)       validate_against_str "xx86x xx86_64x xx86_64-64x xsparcx xsparc64x xsparc64-64x xmipsx xmips64x xmips64-64x xppcx xppc64x xalphax xarmx" ;;
       TARGET)     validate_target ;;
       GRSECURITY_HOST)  validate_against_str "x0x x1x" ;;
 
@@ -216,7 +219,7 @@
       BOOK)        if [[ "${WC}" = "1" ]] ; then
                      validate_dir -z -d
                    else
-                     validate_against_str "x${PROGNAME}-developmentx"
+                     validate_against_str "x${PROGNAME}-${LFSVRS}x"
                    fi ;;
 
       # Validate directories, testable states:

Modified: jhalfs/branches/experimental/common/makefile-functions
===================================================================
--- jhalfs/branches/experimental/common/makefile-functions	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/common/makefile-functions	2006-07-26 18:42:01 UTC (rev 2841)
@@ -54,22 +54,22 @@
   @echo
   @echo -e \\t- Enter to the chroot using the command found
   @echo -e \\tin the section -Entering the Chroot Environment-
-  @echo -e \\texcept if building CLFS with METHOO=boot.
+  @echo -e \\texcept if building CLFS with METHOD=boot.
   @echo
   @echo -e \\t- Set a password for the root user.
   @echo
-  @echo -e \\t- Edit /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
+  @echo -e \\t- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
   @echo -e \\t/etc/sysconfig/console, /etc/sysconfig/network,
   @echo -e \\t/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
   @echo -e \\tany other configuration file required to suit your needs.
   @echo
   @echo -e \\t- Exit from the chroot.
   @echo
-  @echo -e \\t- Set-up the boot loader, except if building CLFS with METHOO=boot.
+  @echo -e \\t- Set-up the boot loader, except if building CLFS with METHOD=boot.
   @echo -e \\tYou can set-up the host bootloader or the new boot-loader
   @echo -e \\tinstalled on the new system.
   @echo -e \\tIf the last, you must to mount the virtual filesystems, re-enter
-  @echo -e \\tto the chroot and be sure that /dev is populated with the
+  @echo -e \\tthe chroot and be sure that /dev is populated with the
   @echo -e \\trequired devices before configure the boot-loader. When ready,
   @echo -e \\texit from the chroot and umount the filesystems
   @echo
@@ -92,7 +92,7 @@
   @echo
   @echo The build is not complete. Follow the next steps:$(WHITE)
   @echo
-  @echo -e \\t- Edit $(MOUNT_PT)/etc/fstab
+  @echo -e \\t- Edit or create $(MOUNT_PT)/etc/fstab
   @echo -e \\t and any other configuration file required to suit your needs.
   @echo $(BOLD)
   @echo $(BOLD)$(YELLOW)

Copied: jhalfs/branches/experimental/common/packages.xsl (from rev 2840, jhalfs/trunk/common/packages.xsl)
===================================================================
--- jhalfs/branches/experimental/common/packages.xsl	                        (rev 0)
+++ jhalfs/branches/experimental/common/packages.xsl	2006-07-26 18:42:01 UTC (rev 2841)
@@ -0,0 +1,46 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!-- $Id$ -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    version="1.0">
+
+  <xsl:output method="text"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="//para"/>
+  </xsl:template>
+
+  <xsl:template match="para">
+    <xsl:if test="contains(string(),'Download:')">
+      <xsl:call-template name="package_name">
+        <xsl:with-param name="url" select="ulink/@url"/>
+      </xsl:call-template>
+      <xsl:text>&#xA;</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="package_name">
+    <xsl:param name="url" select="foo"/>
+    <xsl:param name="sub-url" select="substring-after($url,'/')"/>
+    <xsl:choose>
+      <xsl:when test="contains($sub-url,'/')">
+        <xsl:call-template name="package_name">
+          <xsl:with-param name="url" select="$sub-url"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:choose>
+          <xsl:when test="contains($sub-url,'.patch')"/>
+          <xsl:when test="contains($sub-url,'?')">
+            <xsl:value-of select="substring-before($sub-url,'?')"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$sub-url"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>


Property changes on: jhalfs/branches/experimental/common/packages.xsl
___________________________________________________________________
Name: svn:keywords
   + Author Date Rev Id

Modified: jhalfs/branches/experimental/common/progress_bar.sh
===================================================================
--- jhalfs/branches/experimental/common/progress_bar.sh	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/common/progress_bar.sh	2006-07-26 18:42:01 UTC (rev 2841)
@@ -21,14 +21,16 @@
 declare -i  SEC=0  # Seconds accumulator
 declare -i  PREV_SEC=0
 
+makePID=$(fuser -v . 2>&1 | grep make)
+makePID=$(echo $makePID | cut -d" " -f2)
 
 write_or_exit() {
     # make has been killed or failed or run to completion, leave
-  if ! fuser -v . 2>&1 | grep make >/dev/null ; then
-     echo -n "${CURSOR_ON}" && exit
-  fi
+  [[ ! -e /proc/$makePID ]] && echo -n "${CURSOR_ON}" && exit
+
     # Target build complete, leave.
   [[ -f ${TARGET} ]] && echo -n "${CURSOR_ON}" && exit
+
     # It is safe to write to the screen
   echo -n "$1"
 }

Modified: jhalfs/branches/experimental/master.sh
===================================================================
--- jhalfs/branches/experimental/master.sh	2006-07-25 23:08:29 UTC (rev 2840)
+++ jhalfs/branches/experimental/master.sh	2006-07-26 18:42:01 UTC (rev 2841)
@@ -105,23 +105,24 @@
       case $1 in
         dev* | SVN | trunk )
           LFSVRS=development
+          TREE=trunk/BOOK
           ;;
-        *) if [[ "$PROGNAME" = "lfs" ]]; then
-             case $1 in
-               6.1.1 )
-                 echo "For stable 6.1.1 book, please use jhalfs-0.2."
-                 exit 0
-                ;;
-               * )
-                 echo "$1 is an unsupported version at this time."
-                 exit 0
-                ;;
-             esac
-           else
-             echo "The requested version, ${L_arrow} ${BOLD}$1${OFF} ${R_arrow}, is undefined in the ${BOLD}$(echo $PROGNAME | tr [a-z] [A-Z])${OFF} series."
-             exit 0
-           fi
+        branch-* )
+          LFSVRS=$1
+          TREE=branches/${1#branch-}/BOOK
           ;;
+        * )
+          case $PROGNAME in
+            lfs | hlfs )
+              LFSVRS=$1
+              TREE=tags/$1/BOOK
+              ;;
+            clfs )
+              LFSVRS=$1
+              TREE=tags/$1
+              ;;
+          esac
+          ;;
       esac
       ;;
 
@@ -192,7 +193,7 @@
             WC=1
             BOOK=$1
           else
-            echo -e "\nLooks like $1 isn't a LFS working copy."
+            echo -e "\nLooks like $1 isn't an LFS working copy."
             exit 1
           fi
           ;;
@@ -210,14 +211,14 @@
             WC=1
             BOOK=$1
           else
-            echo -e "\nLooks like $1 isn't a HLFS working copy."
+            echo -e "\nLooks like $1 isn't an HLFS working copy."
             exit 1
           fi
           ;;
       esac
       ;;
 
-    --comparasion | -C )
+    --comparison | -C )
       test $# = 1 && eval "$exit_missing_arg"
       shift
       case $1 in
@@ -262,7 +263,7 @@
       fi
       ;;
 
-    --make | -M )          RUNMAKE=1 ;;
+    --run-make | -M )      RUNMAKE=1 ;;
 
     --rebuild | -R )       CLEAN=1   ;;
 
@@ -271,6 +272,10 @@
       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"
@@ -345,7 +350,7 @@
           TARGET32="powerpc-unknown-linux-gnu"
           ;;
         * )
-          echo -e "\n$1 is an unknown or unsopported arch."
+          echo -e "\n$1 is an unknown or unsupported arch."
           exit 1
           ;;
       esac
@@ -410,7 +415,7 @@
 #===================================================
 
 
-# Check for minumum gcc and kernel versions
+# Check for minimum gcc and kernel versions
 #check_requirements  1 # 0/1  0-do not display values.
 echo
 check_version "2.6.2" "`uname -r`"         "KERNEL"
@@ -493,7 +498,7 @@
   fi
   #
   if [[ -n "$FILES" ]]; then
-    # pushd/popd necessary to deal with mulitiple files
+    # pushd/popd necessary to deal with multiple files
     pushd $PACKAGE_DIR 1> /dev/null
       cp $FILES $JHALFSDIR/
     popd 1> /dev/null
@@ -501,13 +506,15 @@
   #
   if [[ "$REPORT" = "1" ]]; then
     cp $COMMON_DIR/create-sbu_du-report.sh  $JHALFSDIR/
-    # After be sure that all look sane, dump the settings to a file
+    # 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/
   #
+  cp $COMMON_DIR/packages.xsl  $JHALFSDIR/
+  #
   sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
   export XSL=$JHALFSDIR/${XSL}
 fi




More information about the alfs-log mailing list