r2857 - in jhalfs/branches/1.0: HLFS LFS common

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sun Jul 30 04:34:50 PDT 2006


Author: manuel
Date: 2006-07-30 05:34:49 -0600 (Sun, 30 Jul 2006)
New Revision: 2857

Modified:
   jhalfs/branches/1.0/HLFS/hlfs.xsl
   jhalfs/branches/1.0/HLFS/master.sh
   jhalfs/branches/1.0/LFS/lfs.xsl
   jhalfs/branches/1.0/LFS/master.sh
   jhalfs/branches/1.0/common/common-functions
   jhalfs/branches/1.0/common/config
Log:
Ported new HLFS code and LFS Udev fix to 1.0 branch.

Modified: jhalfs/branches/1.0/HLFS/hlfs.xsl
===================================================================
--- jhalfs/branches/1.0/HLFS/hlfs.xsl	2006-07-30 11:24:47 UTC (rev 2856)
+++ jhalfs/branches/1.0/HLFS/hlfs.xsl	2006-07-30 11:34:49 UTC (rev 2857)
@@ -26,7 +26,7 @@
        0 = none
        1 = only chapter06 Glibc, GCC and Binutils testsuites
        2 = all chapter06 testsuites
-       3 = all chapter05 and chapter06 testsuites-->
+       3 = alias to 2 -->
   <xsl:param name="testsuite" select="1"/>
 
   <!-- Time zone -->
@@ -94,32 +94,30 @@
           </xsl:otherwise>
         </xsl:choose>
         <xsl:if test="(sect2[@role='installation'] and
-                     not(@id='bootable-kernel')) or
-                     @id='ch-tools-adjusting' or
-                     @id='ch-system-readjusting'">
+                           not(@id='bootable-kernel'))">
           <xsl:text>cd $PKGDIR&#xA;</xsl:text>
           <xsl:if test="@id='ch-tools-uclibc' or @id='ch-system-uclibc'">
              <xsl:text>pushd ../; tar -xvf gettext-&gettext-version;.*; popd; &#xA;</xsl:text>
           </xsl:if>
-          <xsl:if test="@id='ch-tools-glibc' or @id='ch-system-glibc'">
-             <xsl:text>tar -xvf ../glibc-libidn-&glibc-version;.*&#xA;</xsl:text>
+
+          <!-- NEW toolchain format, from inside ./sources dir unpack binutils and gcc -->
+	  <xsl:if test="@id='ch-tools-embryo-toolchain' or
+                        @id='ch-tools-cocoon-toolchain' or
+                        @id='ch-system-butterfly-toolchain'">
+             <xsl:text>tar -xvf gcc-core-&gcc-version;.*; &#xA;</xsl:text>
+             <xsl:text>tar -xvf gcc-g++-&gcc-version;.*; &#xA;</xsl:text>
+             <xsl:text>tar -xvf binutils-&binutils-version;.*; &#xA;</xsl:text>
           </xsl:if>
-          <xsl:if test="@id='ch-tools-gcc' or @id='ch-system-gcc'">
-             <xsl:text>pushd ../; tar -xvf gcc-g++-&gcc-version;.*; popd; &#xA;</xsl:text>
+          <!-- ONLY butterfly has a testsuite -->
+          <xsl:if test="@id='ch-tools-butterfly-toolchain' and $testsuite != '0'">
+            <xsl:text>tar -xvf gcc-testsuite-&gcc-version;.*; &#xA;</xsl:text>
           </xsl:if>
-          <xsl:if test="@id='ch-tools-gcc' and $testsuite = '3'">
-            <xsl:text>pushd ../; tar -xvf gcc-testsuite-&gcc-version;.*; popd; &#xA;</xsl:text>
-          </xsl:if>
-          <xsl:if test="@id='ch-system-gcc' and $testsuite != '0'">
-            <xsl:text>pushd ../; tar -xvf gcc-testsuite-&gcc-version;.*; popd; &#xA;</xsl:text>
-          </xsl:if>
+          <!-- END new toolchain format -->
+
           <xsl:if test="@id='bootable-bootscripts'">
              <xsl:text>pushd ../; tar -xvf blfs-bootscripts-&blfs-bootscripts-version;.* ; popd; &#xA;</xsl:text>
           </xsl:if>
         </xsl:if>
-        <xsl:if test="@id='ch-system-kernfs'">
-          <xsl:text>export HLFS=$LFS&#xA;</xsl:text>
-        </xsl:if>
         <xsl:apply-templates select=".//para/userinput | .//screen"/>
         <xsl:text>exit</xsl:text>
       </exsl:document>
@@ -135,24 +133,12 @@
 
   <xsl:template match="para/userinput">
     <xsl:if test="(contains(string(),'test') or
-            contains(string(),'check')) and
-            (($testsuite = '1' and
-            (ancestor::sect1[@id='ch-system-gcc'] or
-            ancestor::sect1[@id='ch-system-glibc'])) or
-            ($testsuite = '2' and
-            ancestor::chapter[@id='chapter-building-system']) or
-            $testsuite = '3')">
-      <xsl:choose>
-        <xsl:when test="ancestor::sect1[@id='ch-system-gcc']">
-          <xsl:text>make -k check >> $TEST_LOG 2>&1 || true&#xA;</xsl:text>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="substring-before(string(),'make')"/>
-          <xsl:text>make -k</xsl:text>
-          <xsl:value-of select="substring-after(string(),'make')"/>
-          <xsl:text> >> $TEST_LOG 2>&1 || true&#xA;</xsl:text>
-        </xsl:otherwise>
-      </xsl:choose>
+                  contains(string(),'check')) and
+                  ($testsuite = '2' or $testsuite = '3')">
+      <xsl:value-of select="substring-before(string(),'make')"/>
+      <xsl:text>make -k</xsl:text>
+      <xsl:value-of select="substring-after(string(),'make')"/>
+      <xsl:text> >> $TEST_LOG 2>&1 || true&#xA;</xsl:text>
     </xsl:if>
   </xsl:template>
 
@@ -227,29 +213,23 @@
           </xsl:otherwise>
         </xsl:choose>
       </xsl:when>
-      <!-- Fixing toolchain test suites run -->
-      <xsl:when test="string() = 'make check' or
-                string() = 'make -k check'">
+      <!-- Fixing butterfly toolchain test suites run -->
+      <xsl:when test="string() = 'make -k check'">
         <xsl:choose>
-          <xsl:when test="(($testsuite = '1' or $testsuite = '2') and
-                    ancestor::chapter[@id='chapter-building-system']) or
-                    $testsuite = '3'">
+          <xsl:when test="$testsuite != '0'">
             <xsl:text>make -k check >> $TEST_LOG 2>&1 || true&#xA;</xsl:text>
           </xsl:when>
         </xsl:choose>
       </xsl:when>
-      <xsl:when test="contains(string(),'make check') and
-                ancestor::sect1[@id='ch-system-binutils']">
+      <!-- Fixing Glbc test suite  -->
+      <xsl:when test="contains(string(),'glibc-check-log')">
         <xsl:choose>
           <xsl:when test="$testsuite != '0'">
-            <xsl:value-of select="substring-before(string(),'make check')"/>
-            <xsl:text>make -k check >> $TEST_LOG 2>&1 || true&#xA;</xsl:text>
+            <xsl:value-of select="substring-before(string(),'> glibc-')"/>
+            <xsl:text>>> $TEST_LOG 2>&1 || true&#xA;</xsl:text>
           </xsl:when>
         </xsl:choose>
       </xsl:when>
-      <xsl:when test="contains(string(),'hardened-specs') and
-                ancestor::sect1[@id='ch-system-binutils']
-                and $testsuite = '0'"/>
       <!-- Don't stop on strip run and chapter05 GCC installation test-->
       <xsl:when test="contains(string(),'strip ') or
                 ancestor::sect2[@id='testing-gcc'] and
@@ -265,6 +245,12 @@
     </xsl:choose>
   </xsl:template>
 
+  <xsl:template match="literal">
+    <xsl:if test="@condition=$model or not(@condition)">
+      <xsl:apply-templates/>
+    </xsl:if>
+  </xsl:template>
+
   <xsl:template match="replaceable">
     <xsl:choose>
       <xsl:when test="ancestor::sect1[@id='ch-system-glibc'] or

Modified: jhalfs/branches/1.0/HLFS/master.sh
===================================================================
--- jhalfs/branches/1.0/HLFS/master.sh	2006-07-30 11:24:47 UTC (rev 2856)
+++ jhalfs/branches/1.0/HLFS/master.sh	2006-07-30 11:34:49 UTC (rev 2857)
@@ -7,24 +7,121 @@
 ###          FUNCTIONS          ###
 ###################################
 
+#----------------------------------#
+wrt_ExecuteAsUser() {              # Execute the file ($3) under the users account ($1), log in $2
+#----------------------------------#
+  local this_user=$1
+  local this_script=$2
+  local file=$3
 
+(
+cat << EOF
+	@( time { su - ${this_user} -c "source /home/${this_user}/.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_Unpack_SetOwner() {            # Unpack and set owner. Assign 'ROOT' var
+#----------------------------------#
+  local USER_ACCT=$1
+  local FILE=$2
+  local optSAVE_PREVIOUS=$3
+
+  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 ${USER_ACCT} \$(MOUNT_PT)\$(SRC)/\$\$ROOT
+EOF
+) >> $MKFILE.tmp
+}
+
+#----------------------------------#
+wrt_RunAsRoot() {                  # Some scripts must be run as root..
+#----------------------------------#
+  local user_ACCT=$(echo $1 | tr [a-z] [A-Z])
+  local this_script=$2
+  local file=$3
+
+(
+cat << EOF
+	@( time { export ${user_ACCT}=\$(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
+}
+
+
 #----------------------------#
+process_toolchain() {        # embryo,cocoon and butterfly need special handling
+#----------------------------#
+  local toolchain=$1
+  local this_script=$2
+  local  tc_phase
+
+  echo "${tab_}${tab_}${GREEN}toolchain ${L_arrow}${toolchain}${R_arrow}"
+
+  case ${toolchain} in
+    *butterfly*)
+      [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
+(
+cat << EOF
+	@echo "export PKGDIR=\$(SRC)" > envars
+EOF
+) >> $MKFILE.tmp
+      wrt_run_as_chroot1 "$toolchain" "$this_script"
+      ;;
+
+    *)
+(
+cat << EOF
+	@echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)" > envars
+EOF
+) >> $MKFILE.tmp
+      wrt_ExecuteAsUser "hlfs" "$toolchain" "$this_script"
+      ;;
+  esac
+  #
+  # Safe method to remove packages unpacked outside the toolchain
+  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"
+  #
+  # Manually remove the toolchain directories..
+  tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's at -toolchain@@'`
+(
+cat << EOF
+	@rm -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-toolchain && \\
+	rm  -r \$(MOUNT_PT)\$(SRC)/${tc_phase}-build
+EOF
+) >> $MKFILE.tmp
+
+}
+
+
+#----------------------------#
 chapter3_Makefiles() {       # Initialization of the system
 #----------------------------#
-  local TARGET LOADER
 
   echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter3${R_arrow}"
 
   # Define a few model dependant variables
   if [[ ${MODEL} = "uclibc" ]]; then
-    TARGET="tools-linux-uclibc"; LOADER="ld-uClibc.so.0"
+    TARGET="pc-linux-gnu"; LOADER="ld-uClibc.so.0"
   else
-    TARGET="tools-linux-gnu";    LOADER="ld-linux.so.2"
+    TARGET="pc-linux-gnu";    LOADER="ld-linux.so.2"
   fi
 
-  # NOTE: We use the lfs username and groupname also in HLFS
-  # If /home/lfs is already present in the host, we asume that the
-  # lfs user and group are also presents in the host, and a backup
+  # If /home/hlfs is already present in the host, we asume that the
+  # hlfs user and group are also presents in the host, and a backup
   # of their bash init files is made.
 (
 cat << EOF
@@ -43,38 +140,38 @@
 
 021-addinguser:  020-creatingtoolsdir
 	@\$(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/hlfs ]; then \\
+		groupadd hlfs; \\
+		useradd -s /bin/bash -g hlfs -m -k /dev/null hlfs; \\
 	else \\
-		touch user-lfs-exist; \\
+		touch user-hlfs-exist; \\
 	fi;
-	@chown lfs \$(MOUNT_PT)/tools && \\
-	chown lfs \$(MOUNT_PT)/sources && \\
+	@chown hlfs \$(MOUNT_PT)/tools && \\
+	chown hlfs \$(MOUNT_PT)/sources && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
 
 022-settingenvironment:  021-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/hlfs/.bashrc -a ! -f /home/hlfs/.bashrc.XXX ]; then \\
+		mv /home/hlfs/.bashrc /home/hlfs/.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/hlfs/.bash_profile  -a ! -f /home/hlfs/.bash_profile.XXX ]; then \\
+		mv /home/hlfs/.bash_profile /home/hlfs/.bash_profile.XXX; \\
 	fi;
-	@echo "set +h" > /home/lfs/.bashrc && \\
-	echo "umask 022" >> /home/lfs/.bashrc && \\
-	echo "HLFS=\$(MOUNT_PT)" >> /home/lfs/.bashrc && \\
-	echo "LC_ALL=POSIX" >> /home/lfs/.bashrc && \\
-	echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/lfs/.bashrc && \\
-	echo "export HLFS LC_ALL PATH" >> /home/lfs/.bashrc && \\
-	echo "" >> /home/lfs/.bashrc && \\
+	@echo "set +h" > /home/hlfs/.bashrc && \\
+	echo "umask 022" >> /home/hlfs/.bashrc && \\
+	echo "HLFS=\$(MOUNT_PT)" >> /home/hlfs/.bashrc && \\
+	echo "LC_ALL=POSIX" >> /home/hlfs/.bashrc && \\
+	echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/hlfs/.bashrc && \\
+	echo "export HLFS LC_ALL PATH" >> /home/hlfs/.bashrc && \\
+	echo "" >> /home/hlfs/.bashrc && \\
 	echo "target=$(uname -m)-${TARGET}" >> /home/lfs/.bashrc && \\
 	echo "ldso=/tools/lib/${LOADER}" >> /home/lfs/.bashrc && \\
 	echo "export target ldso" >> /home/lfs/.bashrc && \\
-	echo "source $JHALFSDIR/envars" >> /home/lfs/.bashrc && \\
-	chown lfs:lfs /home/lfs/.bashrc && \\
+	echo "source $JHALFSDIR/envars" >> /home/hlfs/.bashrc && \\
+	chown hlfs:hlfs /home/hlfs/.bashrc && \\
 	touch envars && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
@@ -113,14 +210,11 @@
     # the names of the targets in the Makefile
     chapter5="$chapter5 $this_script"
 
-    # Grab the name of the target (minus the -headers or -cross in the case of gcc
-    # and binutils in chapter 5)
-    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's at -cross@@' -e 's at -headers@@'`
+    # Grab the name of the target
+    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
 
     # Adjust 'name'
     case $name in
-      linux-libc) name="linux-libc-headers" ;;
-      gcc)        name="gcc-core"  ;;
       uclibc)     name="uClibc"  ;;
     esac
 
@@ -133,66 +227,41 @@
     #
     # Drop in the name of the target on a new line, and the previous target
     # as a dependency. Also call the echo_message function.
+
+    # This is a very special script and requires manual processing
+    # NO Optimization allowed
+    if [[ ${name} = "embryo-toolchain" ]] || \
+       [[ ${name} = "cocoon-toolchain" ]]; then
+       wrt_target "$this_script" "$PREV"
+         process_toolchain "${this_script}" "${file}"
+       wrt_touch
+       PREV=$this_script
+       continue
+    fi
+    #
     wrt_target "$this_script" "$PREV"
-
     # Find the version of the command files, if it corresponds with the building of
     # a specific package
     pkg_tarball=$(get_package_tarball_name $name)
     # If $pkg_tarball isn't empty, we've got a package...
     if [ "$pkg_tarball" != "" ] ; then
       # Insert instructions for unpacking the package and to set the PKGDIR variable.
-      case $this_script in
-        *binutils* )  wrt_unpack "$pkg_tarball" 1 ;; # Do not delete an existing package directories
-        *)            wrt_unpack "$pkg_tarball" ;;
-      esac
+      wrt_Unpack_SetOwner "hlfs" "$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
       [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
-
-    case $this_script in
-      *binutils* )  # Dump the path to sources directory for later removal
-(
-cat << EOF
-	@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	echo "\$(MOUNT_PT)\$(SRC)/\$\$ROOT" >> sources-dir
-EOF
-) >> $MKFILE.tmp
-        ;;
-      *adjusting* )  # For the Adjusting phase we must to cd to the binutils-build directory.
-        echo -e '\t at echo "export PKGDIR=$(MOUNT_PT)$(SRC)/binutils-build" > envars' >> $MKFILE.tmp
-        ;;
-    esac
-
     # Insert date and disk usage at the top of the log file, the script run
     # and date and disk usage again at the bottom of the log file.
-    wrt_run_as_su "${this_script}" "${file}"
+    wrt_ExecuteAsUser "hlfs" "$this_script" "${file}"
 
     # 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 [ "$pkg_tarball" != "" ] ; then
-      case "${this_script}" in
-        *binutils*) : ;;   # do NOTHING
-	*gcc*) wrt_remove_build_dirs "gcc"    ;;
-        *)     wrt_remove_build_dirs "$name"    ;;
-      esac
+       wrt_remove_build_dirs "$name"
     fi
 
-    # Remove the Binutils pass 1 sources after a successful Adjusting phase.
-    case "${this_script}" in
-     *adjusting*)
-(
-cat << EOF
-	@rm -r \`cat sources-dir\` && \\
-	rm -r \$(MOUNT_PT)\$(SRC)/binutils-build && \\
-	rm sources-dir
-EOF
-) >> $MKFILE.tmp
-      ;;
-    esac
-
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
     #
@@ -209,7 +278,6 @@
 #----------------------------#
 chapter6_Makefiles() {       # sysroot or chroot build phase
 #----------------------------#
-  local TARGET LOADER
   local file
   local this_script
   # Set envars and scripts for iteration targets
@@ -237,14 +305,6 @@
   fi
 
   echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}"
-  #
-  # Set these definitions early and only once
-  #
-  if [[ ${MODEL} = "uclibc" ]]; then
-    TARGET="pc-linux-uclibc"; LOADER="ld-uClibc.so.0"
-  else
-    TARGET="pc-linux-gnu";    LOADER="ld-linux.so.2"
-  fi
 
   for file in chapter06$N/* ; do
     # Keep the script file name
@@ -262,17 +322,7 @@
     # 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
 
@@ -301,17 +351,24 @@
     #--------------------------------------------------------------------#
     #
     # 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.
+    if [[ ${name} = "butterfly-toolchain" ]]; then
+       wrt_target "$this_script" "$PREV"
+         process_toolchain "${this_script}" "${file}"
+       wrt_touch
+       PREV=$this_script
+       continue
+    fi
+
     wrt_target "${this_script}${N}" "$PREV"
 
     # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     if [ "$pkg_tarball" != "" ] ; then
       wrt_unpack2 "$pkg_tarball"
-      wrt_target_vars
       # If the testsuites must be run, initialize the log file
       case $name in
-        binutils | gcc-core | glibc )
+        glibc )
           [[ "$TEST" != "0" ]] && wrt_test_log2 "${this_script}"
           ;;
         * )
@@ -322,16 +379,10 @@
       [[ "$OPTIMIZE" != "0" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     fi
 
-    case $this_script in
-      *readjusting*) # For the Re-Adjusting phase we must to cd to the binutils-build directory.
-        echo -e '\t at echo "export PKGDIR=$(SRC)/binutils-build" > envars' >> $MKFILE.tmp
-        ;;
-    esac
-
-    # In the mount of kernel filesystems we need to set LFS and not to use chroot.
+    # In the mount of kernel filesystems we need to set HLFS and not to use chroot.
     case "${this_script}" in
       *kernfs*)
-        wrt_run_as_root "${this_script}" "${file}"
+        wrt_RunAsRoot "hlfs" "${this_script}" "${file}"
         ;;
       *)   # The rest of Chapter06
         wrt_run_as_chroot1 "${this_script}" "${file}"
@@ -343,19 +394,6 @@
       wrt_remove_build_dirs "$name"
     fi
     #
-    # Remove the Binutils pass 2 sources after a successful Re-Adjusting phase.
-    case "${this_script}" in
-      *readjusting*)
-(
-cat << EOF
-	@rm -r \`cat sources-dir\` && \\
-	rm -r \$(MOUNT_PT)\$(SRC)/binutils-build && \\
-	rm sources-dir
-EOF
-) >> $MKFILE.tmp
-      ;;
-    esac
-
     # Include a touch of the target name so make can check if it's already been made.
     wrt_touch
     #
@@ -389,7 +427,6 @@
     case $this_script in
       *usage)   continue  ;; # Contains example commands
       *grub)    continue  ;;
-      *reboot)  continue  ;;
       *console) continue  ;; # Use the file generated by lfs-bootscripts
 
       *kernel)
@@ -519,7 +556,7 @@
 
 chapter3:  020-creatingtoolsdir 021-addinguser 022-settingenvironment
 
-chapter5:  chapter3 $chapter5 restore-lfs-env
+chapter5:  chapter3 $chapter5 restore-hlfs-env
 
 chapter6:  chapter5 $chapter6
 
@@ -533,18 +570,18 @@
 restart: restart_code all
 
 clean-chapter3:
-	-if [ ! -f user-lfs-exist ]; then \\
-		userdel lfs; \\
-		rm -rf /home/lfs; \\
+	-if [ ! -f user-hlfs-exist ]; then \\
+		userdel hlfs; \\
+		rm -rf /home/hlfs; \\
 	fi;
 	rm -rf \$(MOUNT_PT)/tools
 	rm -f /tools
-	rm -f envars user-lfs-exist
+	rm -f envars user-hlfs-exist
 	rm -f 02* logs/02*.log
 
 clean-chapter5:
 	rm -rf \$(MOUNT_PT)/tools/*
-	rm -f $chapter5 restore-lfs-env sources-dir
+	rm -f $chapter5 restore-hlfs-env sources-dir
 	cd logs && rm -f $chapter5 && cd ..
 
 clean-chapter6:
@@ -561,15 +598,15 @@
 	rm -f $chapter7
 	cd logs && rm -f $chapter7 && cd ..
 
-restore-lfs-env:
+restore-hlfs-env:
 	@\$(call echo_message, Building)
-	@if [ -f /home/lfs/.bashrc.XXX ]; then \\
-		mv -f /home/lfs/.bashrc.XXX /home/lfs/.bashrc; \\
+	@if [ -f /home/hlfs/.bashrc.XXX ]; then \\
+		mv -f /home/hlfs/.bashrc.XXX /home/hlfs/.bashrc; \\
 	fi;
-	@if [ -f /home/lfs/.bash_profile.XXX ]; then \\
-		mv /home/lfs/.bash_profile.XXX /home/lfs/.bash_profile; \\
+	@if [ -f /home/hlfs/.bash_profile.XXX ]; then \\
+		mv /home/hlfs/.bash_profile.XXX /home/hlfs/.bash_profile; \\
 	fi;
-	@chown lfs:lfs /home/lfs/.bash* && \\
+	@chown hlfs:hlfs /home/hlfs/.bash* && \\
 	touch \$@ && \\
 	echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
@@ -580,25 +617,25 @@
 	@-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-hlfs-exist ]; then \\
+		userdel hlfs; \\
+		rm -rf /home/hlfs; \\
 	fi;
 
 restart_code:
-	@echo ">>> This feature is experimental, BUGS may exist"	
-	
+	@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;	
+	fi;
 
 	@if [ -f ???-kernfs ]; then \\
 	  mkdir -pv \$(MOUNT_PT)/{proc,sys};\\

Modified: jhalfs/branches/1.0/LFS/lfs.xsl
===================================================================
--- jhalfs/branches/1.0/LFS/lfs.xsl	2006-07-30 11:24:47 UTC (rev 2856)
+++ jhalfs/branches/1.0/LFS/lfs.xsl	2006-07-30 11:34:49 UTC (rev 2857)
@@ -132,6 +132,12 @@
         <xsl:value-of select="substring-after(string(),'patch')"/>
         <xsl:text>&#xA;</xsl:text>
       </xsl:when>
+      <!-- Fix Udev reinstallation after a build failure -->
+      <xsl:when test="contains(string(),'firmware,udev')">
+        <xsl:text>if [[ ! -d /lib/udev/devices ]] ; then&#xA;</xsl:text>
+        <xsl:apply-templates/>
+        <xsl:text>&#xA;fi&#xA;</xsl:text>
+      </xsl:when>
       <!-- Setting $LANG for /etc/profile -->
       <xsl:when test="ancestor::sect1[@id='ch-scripts-profile'] and
                 contains(string(),'export LANG=')">

Modified: jhalfs/branches/1.0/LFS/master.sh
===================================================================
--- jhalfs/branches/1.0/LFS/master.sh	2006-07-30 11:24:47 UTC (rev 2856)
+++ jhalfs/branches/1.0/LFS/master.sh	2006-07-30 11:34:49 UTC (rev 2857)
@@ -165,9 +165,6 @@
     done
     # Remove Bzip2 binaries before make install
     sed -e 's at make install at rm -vf /usr/bin/bz*\n&@' -i chapter06$N/*-bzip2
-    # Let some Udev pre-installation commands to fail
-    sed -e 's@/lib/udev/devices/fd@& || true@' \
-        -e 's/mknod -m.*/& || true/' -i chapter06$N/*-udev
   fi
 
   echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}"

Modified: jhalfs/branches/1.0/common/common-functions
===================================================================
--- jhalfs/branches/1.0/common/common-functions	2006-07-30 11:24:47 UTC (rev 2856)
+++ jhalfs/branches/1.0/common/common-functions	2006-07-30 11:34:49 UTC (rev 2857)
@@ -82,7 +82,7 @@
           1 = only final system Glibc, GCC and Binutils testsuites
           2 = all final system testsuites
           3 = all temporary tools and final system testsuites
-        In CLFS, 3 is an alias to 2
+        In CLFS and HLFS, 3 is an alias to 2
 
 ${BOLD}  -W, --working-copy DIR${OFF}
         use the local working copy placed in DIR as the $(echo $PROGNAME | tr [a-z] [A-Z]) book

Modified: jhalfs/branches/1.0/common/config
===================================================================
--- jhalfs/branches/1.0/common/config	2006-07-30 11:24:47 UTC (rev 2856)
+++ jhalfs/branches/1.0/common/config	2006-07-30 11:34:49 UTC (rev 2857)
@@ -16,7 +16,7 @@
 REPORT=1
 
 #=== Getting packages ===
-#    Files will be retrieved from the local archive SRC_ARCHIVE 
+#    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
@@ -48,7 +48,7 @@
 #  1 = only chapter06 Glibc, GCC and Binutils testsuites
 #  2 = all chapter06 testsuites
 #  3 = all chapter05 and chapter06 testsuites
-#      (in CLFS, alias to 2)
+#      (in CLFS and HLFS, alias to 2)
 TEST=1
 
 #--- Run the stripping phases  0(no)/1(yes)




More information about the alfs-log mailing list