r2697 - in jhalfs/branches/experimental: . CLFS HLFS LFS common

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Tue May 16 11:27:04 PDT 2006


Author: manuel
Date: 2006-05-16 12:27:02 -0600 (Tue, 16 May 2006)
New Revision: 2697

Modified:
   jhalfs/branches/experimental/CLFS/master.sh
   jhalfs/branches/experimental/HLFS/master.sh
   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_validate_configs.sh
   jhalfs/branches/experimental/common/urls.xsl
   jhalfs/branches/experimental/master.sh
Log:
Updated experimental to current trunk.

Modified: jhalfs/branches/experimental/CLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/CLFS/master.sh	2006-05-15 19:02:41 UTC (rev 2696)
+++ jhalfs/branches/experimental/CLFS/master.sh	2006-05-16 18:27:02 UTC (rev 2697)
@@ -1016,7 +1016,7 @@
 if [[ "${METHOD}" = "chroot" ]]; then
 (
 	cat << EOF
-all:  chapter2 chapter3 chapter4 chapter5 chapter6 chapter7 chapter8
+all:  chapter2 chapter3 chapter4 chapter5 chapter6 chapter7 chapter8 do-housekeeping
 	@\$(call echo_finished,$VERSION)
 
 chapter2:  023-creatingtoolsdir 024-creatingcrossdir 025-addinguser 026-settingenvironment
@@ -1077,6 +1077,17 @@
 	@chown lfs:lfs /home/lfs/.bash* && \\
 	touch \$@
 
+do-housekeeping:
+	-umount \$(MOUNT_PT)/dev/pts
+	-umount \$(MOUNT_PT)/dev/shm
+	-umount \$(MOUNT_PT)/dev
+	-umount \$(MOUNT_PT)/sys
+	-umount \$(MOUNT_PT)/proc
+	-if [ ! -f user-lfs-exist ]; then \\
+		userdel lfs; \\
+		rm -rf /home/lfs; \\
+	fi;
+
 EOF
 ) >> $MKFILE
 fi
@@ -1146,6 +1157,7 @@
 	@chown lfs:lfs /home/lfs/.bash* && \\
 	touch \$@
 
+
 EOF
 ) >> $MKFILE
 fi

Modified: jhalfs/branches/experimental/HLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/HLFS/master.sh	2006-05-15 19:02:41 UTC (rev 2696)
+++ jhalfs/branches/experimental/HLFS/master.sh	2006-05-16 18:27:02 UTC (rev 2697)
@@ -505,7 +505,7 @@
   # as a dependency.
 (
   cat << EOF
-all:  chapter3 chapter5 chapter6 chapter7
+all:  chapter3 chapter5 chapter6 chapter7 do-housekeeping
 	@\$(call echo_finished,$VERSION)
 
 chapter3:  020-creatingtoolsdir 021-addinguser 022-settingenvironment
@@ -561,6 +561,17 @@
 	@chown lfs:lfs /home/lfs/.bash* && \\
 	touch \$@
 
+do-housekeeping:
+	-umount \$(MOUNT_PT)/dev/pts
+	-umount \$(MOUNT_PT)/dev/shm
+	-umount \$(MOUNT_PT)/dev
+	-umount \$(MOUNT_PT)/sys
+	-umount \$(MOUNT_PT)/proc
+	-if [ ! -f user-lfs-exist ]; then \\
+		userdel lfs; \\
+		rm -rf /home/lfs; \\
+	fi;
+	
 EOF
 ) >> $MKFILE
 

Modified: jhalfs/branches/experimental/LFS/master.sh
===================================================================
--- jhalfs/branches/experimental/LFS/master.sh	2006-05-15 19:02:41 UTC (rev 2696)
+++ jhalfs/branches/experimental/LFS/master.sh	2006-05-16 18:27:02 UTC (rev 2697)
@@ -47,7 +47,7 @@
 	fi;
 	@echo "set +h" > /home/lfs/.bashrc && \\
 	echo "umask 022" >> /home/lfs/.bashrc && \\
-	echo "LFS=/mnt/lfs" >> /home/lfs/.bashrc && \\
+	echo "LFS=\$(MOUNT_PT)" >> /home/lfs/.bashrc && \\
 	echo "LC_ALL=POSIX" >> /home/lfs/.bashrc && \\
 	echo "PATH=/tools/bin:/bin:/usr/bin" >> /home/lfs/.bashrc && \\
 	echo "export LFS LC_ALL PATH" >> /home/lfs/.bashrc && \\
@@ -376,7 +376,7 @@
   # as a dependency.
 (
     cat << EOF
-all:  chapter4 chapter5 chapter6 chapter789
+all:  chapter4 chapter5 chapter6 chapter789 do_housekeeping
 	@\$(call echo_finished,$VERSION)
 
 chapter4:  020-creatingtoolsdir 021-addinguser 022-settingenvironment
@@ -431,7 +431,18 @@
 	fi;
 	@chown lfs:lfs /home/lfs/.bash* && \\
 	touch \$@
-
+	
+do_housekeeping:
+	-umount \$(MOUNT_PT)/sys
+	-umount \$(MOUNT_PT)/proc
+	-umount \$(MOUNT_PT)/dev/shm
+	-umount \$(MOUNT_PT)/dev/pts
+	-umount \$(MOUNT_PT)/dev
+	-if [ ! -f user-lfs-exist ]; then \\
+		userdel lfs; \\
+		rm -rf /home/lfs; \\
+	fi;
+	
 EOF
 ) >> $MKFILE
 

Modified: jhalfs/branches/experimental/README
===================================================================
--- jhalfs/branches/experimental/README	2006-05-15 19:02:41 UTC (rev 2696)
+++ jhalfs/branches/experimental/README	2006-05-16 18:27:02 UTC (rev 2697)
@@ -16,7 +16,7 @@
   Lay in a supply of caffeine beverages.
 
   *.  It is recommended that you temporarily unpack your linux kernel,
-  run <make menuconfig>, configure the kernal as per the book and save
+  run <make menuconfig>, configure the kernel as per the book and save
   the resulting .config file. This suggestion also applies to the
   configuration of the uClibc package when building a HLFS system using
   uClibc rather than glibc.
@@ -94,10 +94,10 @@
 	 
 	 
 6. FAQ::
-    Q. "It doesn't work"
+    Q. "It doesn't work!"
     A. Yes it does, try ./lfs --help
     
-    Q. "How do I specify the build location"
+    Q. "How do I specify the build location?"
     A. The original LFS document worked against the well know 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.
@@ -113,7 +113,7 @@
 	    FHS dir structure
 	        ...
     
-    Q. "What is the function of the SRC_ARCHIVE variable
+    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 
@@ -121,13 +121,13 @@
        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"
+    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. 
     
-    Q. "Why have 2 copies of the files."
+    Q. "Why have 2 copies of the files?"
     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.

Modified: jhalfs/branches/experimental/common/common-functions
===================================================================
--- jhalfs/branches/experimental/common/common-functions	2006-05-15 19:02:41 UTC (rev 2696)
+++ jhalfs/branches/experimental/common/common-functions	2006-05-16 18:27:02 UTC (rev 2697)
@@ -612,32 +612,13 @@
 
   # Create the packages file. We need it for proper Makefile creation
   rm -f packages
-  case "${PROGNAME}" in
-    clfs)
-      echo -n "Creating <${PROGNAME}> specific packages file"
-      grep "\-version " $BOOK/packages.ent | sed -e 's@<!ENTITY @@' \
-                                                 -e 's@">@"@' \
-                                                 -e '/generic/d' > packages
-     echo " ...OK"
-     ;;
+  if [[ "${PROGNAME}" != "blfs" ]] ; then
+    echo -n "Creating <${PROGNAME}> specific packages file"
+    grep "\-version " $BOOK/packages.ent | sed -e 's@<!ENTITY @@' \
+                                                -e 's@">@"@' > packages
+    echo " ...OK"
+  fi
 
-    hlfs)
-      echo -n "Creating <${PROGNAME}> specific packages file"
-      grep "\-version" $BOOK/general.ent | sed -e 's@<!ENTITY @@' \
-                                               -e 's@">@"@' \
-                                               -e '/generic/d' >> packages
-      echo " ...OK"
-      ;;
-
-    lfs)
-      echo -n "Creating <${PROGNAME}> specific packages file"
-      grep "\-version" $BOOK/general.ent | sed -e 's@<!ENTITY @@' \
-                                               -e 's@">@"@' \
-                                               -e '/generic/d' >> packages
-      echo " ...OK"
-      ;;
-  esac
-
   # Done. Moving on...
   get_sources
 }
@@ -659,13 +640,9 @@
   [[ ! -d $BUILDDIR/sources ]] && mkdir $BUILDDIR/sources
   cd $BUILDDIR/sources
   [[ -f MD5SUMS ]] && rm MD5SUMS
-  [[ -f MD5SUMS-$VERSION ]] && rm MD5SUMS-$VERSION
   [[ -f MISSING_FILES.DMP ]] && rm MISSING_FILES.DMP
   [[ -f urls.lst ]] && rm urls.lst
 
-    # Download a fresh MD5SUMS file
-  wget $SERVER/pub/lfs/conglomeration/MD5SUMS
-
     # Generate URLs file
   create_urls
 
@@ -681,6 +658,9 @@
         */vim-*-lang* )
             [[ "$VIMLANG" = "0" ]] && continue
           ;;
+        *linux/linux-* )
+            [[ -z "$CONFIG" ]] && [[ -z "$BOOT_CONFIG" ]] && continue
+          ;;
     esac
 
       # Locations
@@ -689,21 +669,9 @@
     FILE=`basename $URL1` # File name
     BOOKMD5=`echo $line | cut -d" " -f3` # MD5 book value
 
-    if [[ x"$BOOKMD5" != "x" ]]; then
-      HAVEMD5=1
-      MD5="$BOOKMD5  $FILE"
-    else
-      # Find the md5 sum for this package in the server MD5SUMS file.
-      set +e
-      HAVEMD5=1  # Always assume we have a MD5SUM
-      MD5=`grep "  $FILE" MD5SUMS`
-      if [ $? -ne 0 ]; then
-        set -e
-        gs_wrt_message "$FILE not found in MD5SUMS"
-          # IMPORTANT:: There is no MD5SUM for this file.
-        HAVEMD5=0
-      fi
-    fi
+      # Validation pair
+    MD5="$BOOKMD5  $FILE"
+    HAVEMD5=1
 
     set -e
       # If the file exists in the archive copy it to the
@@ -717,7 +685,7 @@
     else
       echo "${BOLD}${YELLOW}$FILE: not found in ${SRC_ARCHIVE}${OFF}"
       fromARCHIVE=0
-      # If the file does not exist in /sources download a fresh one
+      # If the file does not exist yet in /sources download a fresh one
       if [ ! -f $FILE ] ; then
         if ! wget $URL1 && ! wget $URL2 ; then
           gs_wrt_message "$FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
@@ -726,26 +694,23 @@
       fi
     fi
 
-      # Is there a MD5SUM to validate the file against.
-    if [[ "$HAVEMD5" = "1" ]] ; then
-        # IF the md5sum does not match the existing files
-      if ! echo "$MD5" | md5sum -c - >/dev/null ; then
-        [[ $fromARCHIVE = "1" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match SRC_ARCHIVE copy${OFF}"
-        [[ $fromARCHIVE = "0" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match REMOTE copy${OFF}"
-          # Remove the old file and download a new one
-        rm -fv $FILE
-          # Force generation of MD5SUM and storage in SRC_ARCHIVE
-        fromARCHIVE=0;
-          # Try and retrieve the file. Servers in reverse order.
-        if ! wget $URL2 && ! wget $URL1 ; then
-          gs_wrt_message "$FILE not found on the servers.. SKIPPING"
-          continue
-        fi
+      # IF the md5sum does not match the existing files
+    if ! echo "$MD5" | md5sum -c - >/dev/null ; then
+      [[ $fromARCHIVE = "1" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match SRC_ARCHIVE copy${OFF}"
+      [[ $fromARCHIVE = "0" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match REMOTE copy${OFF}"
+        # Remove the old file and download a new one
+      rm -fv $FILE
+        # Force storage in SRC_ARCHIVE
+      fromARCHIVE=0;
+        # Try to retrieve again the file. Servers in reverse order.
+      if ! wget $URL2 && ! wget $URL1 ; then
+        gs_wrt_message "$FILE not found on the servers.. SKIPPING"
+        continue
       fi
     fi
 
       # Validate the MD5SUM one last time
-    if [[ "$HAVEMD5" = "1" ]] && ! echo "$MD5" | md5sum -c - >/dev/null ; then
+    if ! echo "$MD5" | md5sum -c - >/dev/null ; then
       gs_wrt_message "$FILE does not match MD5SUMS value"
       # Force generation of MD5SUM
       HAVEMD5=0
@@ -754,11 +719,11 @@
       # Generate a fresh MD5SUM for this file
     if [[ "$HAVEMD5" = "0" ]] ; then
       echo "${BOLD}${YELLOW}Generating a new MD5SUM for ${OFF}$FILE"
-      echo "NEW MD5SUM $(md5sum $FILE)" >> MISSING_FILES.DMP
+      echo "NEW MD5SUM: $(md5sum $FILE)" >> MISSING_FILES.DMP
     fi
 
       # Good or bad we write the original md5sum to a file
-    echo "$MD5" >> MD5SUMS-$VERSION
+    echo "$MD5" >> MD5SUMS
 
      # Copy the freshly downloaded file
      # to the source archive.

Modified: jhalfs/branches/experimental/common/config
===================================================================
--- jhalfs/branches/experimental/common/config	2006-05-15 19:02:41 UTC (rev 2696)
+++ jhalfs/branches/experimental/common/config	2006-05-16 18:27:02 UTC (rev 2697)
@@ -60,7 +60,7 @@
 PAGE=letter
 
 #--- set default timezone.
-TIMEZONE=GMT
+TIMEZONE=${TZ:-GMT}
 
 #--- install the optional vim-lang package  0(no)/1(yes)
 VIMLANG=1

Modified: jhalfs/branches/experimental/common/func_validate_configs.sh
===================================================================
--- jhalfs/branches/experimental/common/func_validate_configs.sh	2006-05-15 19:02:41 UTC (rev 2696)
+++ jhalfs/branches/experimental/common/func_validate_configs.sh	2006-05-16 18:27:02 UTC (rev 2697)
@@ -169,11 +169,6 @@
   for config_param in ${!PARAM_GROUP}; do
     # This is a tricky little piece of code.. executes a cmd string.
     case $config_param in
-      BUILDDIR) # We cannot have an <empty> or </> root mount point
-                  echo -e "`eval echo $PARAM_VALS`"
-                  [[ "xx x/x" =~ "x${!config_param}x" ]] &&
-                       write_error_and_die
-                  ;;
       TIMEZONE)   echo -e "`eval echo $PARAM_VALS`" ;;
 
       # Validate general parameters..
@@ -227,6 +222,11 @@
       #  fatal   -z -d -w,
       #  warning -z+   -w+
       SRC_ARCHIVE) validate_dir -z+ -d -w+ ;;
+      BUILDDIR)   # The build directory/partition MUST exist and be writable by the user
+                  validate_dir -z -d -w
+                  [[ "xx x/x" =~ "x${!config_param}x" ]] &&
+                       write_error_and_die
+                  ;;
 
       # Validate files, testable states:
       #  fatal   -z -e -s -w -x -r,

Modified: jhalfs/branches/experimental/common/urls.xsl
===================================================================
--- jhalfs/branches/experimental/common/urls.xsl	2006-05-15 19:02:41 UTC (rev 2696)
+++ jhalfs/branches/experimental/common/urls.xsl	2006-05-16 18:27:02 UTC (rev 2697)
@@ -54,18 +54,25 @@
       <xsl:value-of select="$server"/>
       <xsl:text>/pub/lfs/conglomeration/</xsl:text>
       <xsl:choose>
-        <!-- Fix some directories. Test against dirname to be sure that we
-        are matching the start of a package name, not a string in a patch name -->
+        <!-- Fix some directories. Test against $dirname to be sure that we
+        are matching the start of a package name, not a string in a patch name
+        But some packages requires test against $package. -->
         <xsl:when test="contains($dirname, 'bash')">
           <xsl:text>bash/</xsl:text>
         </xsl:when>
+        <xsl:when test="contains($package, 'dvhtool')">
+          <xsl:text>dvhtool/</xsl:text>
+        </xsl:when>
         <xsl:when test="contains($dirname, 'gcc')">
           <xsl:text>gcc/</xsl:text>
         </xsl:when>
         <xsl:when test="contains($dirname, 'glibc')">
           <xsl:text>glibc/</xsl:text>
         </xsl:when>
-        <xsl:when test="contains($dirname, 'tcl')">
+        <xsl:when test="contains($package, 'powerpc-utils')">
+          <xsl:text>powerpc-utils/</xsl:text>
+        </xsl:when>
+        <xsl:when test="contains($package, 'tcl')">
           <xsl:text>tcl/</xsl:text>
         </xsl:when>
         <xsl:when test="contains($dirname, 'uClibc')">

Modified: jhalfs/branches/experimental/master.sh
===================================================================
--- jhalfs/branches/experimental/master.sh	2006-05-15 19:02:41 UTC (rev 2696)
+++ jhalfs/branches/experimental/master.sh	2006-05-16 18:27:02 UTC (rev 2697)
@@ -446,7 +446,6 @@
 
 validate_config
 echo "${SD_BORDER}${nl_}"
-
 echo -n "Are you happy with these settings? yes/no (no): "
 read ANSWER
 if [ x$ANSWER != "xyes" ] ; then
@@ -455,7 +454,7 @@
 fi
 echo "${nl_}${SD_BORDER}${nl_}"
 
-# Loadd additional modules or configuration files based on global settings
+# Load additional modules or configuration files based on global settings
 # compare module
 if [[ "$COMPARE" = "1" ]]; then
   [[ $VERBOSITY > 0 ]] && echo -n "Loading compare module..."
@@ -470,30 +469,19 @@
   source optimize/optimize_functions
   [[ $? > 0 ]] && echo " optimize/optimize_functions did not load.." && exit
   [[ $VERBOSITY > 0 ]] && echo "OK"
-fi
-#
-# optimize configurations
-if [[ "$OPTIMIZE" != "0" ]]; then
+  #
+  # optimize configurations
   [[ $VERBOSITY > 0 ]] && echo -n "Loading optimization config..."
   source optimize/opt_config
   [[ $? > 0 ]] && echo " optimize/opt_config did not load.." && exit
   [[ $VERBOSITY > 0 ]] && echo "OK"
+  # Validate optimize settings, if required
+  validate_opt_settings
 fi
 #
 
-# Validate optimize settings, if required
-[[ "$OPTIMIZE" != "0" ]] && validate_opt_settings
-
-# Prevents setting "-d /" by mistake.
-
-if [ $BUILDDIR = / ] ; then
-  echo -ne "\nThe root directory can't be used to build LFS.\n\n"
-  exit 1
-fi
-
 # If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
 # and notify the user about that.
-
 if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
   eval "$no_empty_builddir"
 fi
@@ -504,7 +492,19 @@
 if [[ ! -d $JHALFSDIR ]]; then
   mkdir -p $JHALFSDIR
 fi
-
+#
+# Create $BUILDDIR/sources even though it could be created by get_sources()
+if [[ ! -d $BUILDDIR/sources ]]; then
+  mkdir -p $BUILDDIR/sources
+fi
+#
+# Create the log directory
+if [[ ! -d $LOGDIR ]]; then
+  mkdir $LOGDIR
+fi
+>$LOGDIR/$LOG
+#
+#
 if [[ "$PWD" != "$JHALFSDIR" ]]; then
   cp $COMMON_DIR/makefile-functions $JHALFSDIR/
   [[ "$OPTIMIZE" != "0" ]] && cp optimize/opt_override $JHALFSDIR/
@@ -512,33 +512,33 @@
     mkdir -p $JHALFSDIR/extras
     cp extras/* $JHALFSDIR/extras
   fi
+  #
   if [[ -n "$FILES" ]]; then
     # pushd/popd necessary to deal with mulitiple files
     pushd $PACKAGE_DIR 1> /dev/null
       cp $FILES $JHALFSDIR/
     popd 1> /dev/null
   fi
+  #
   if [[ "$PROGNAME" != "blfs" ]]; then
-    [[ "$REPORT" = "1" ]] && cp $COMMON_DIR/create-sbu_du-report.sh  $JHALFSDIR/
+    if [[ "$REPORT" = "1" ]]; then
+      cp $COMMON_DIR/create-sbu_du-report.sh  $JHALFSDIR/
+      # After be sure that all look sane and if REPORT=1, 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/
   fi
+  #
   sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
   export XSL=$JHALFSDIR/${XSL}
 fi
 
-if [[ ! -d $LOGDIR ]]; then
-  mkdir $LOGDIR
-fi
 
-# After be sure that all look sane and if REPORT=1, dump the settings to a file
-# This file will be used to create the REPORT header
-[[ "$PROGNAME" != "blfs" ]] && [[ "$REPORT" = "1" ]] && validate_config > $JHALFSDIR/jhalfs.config
-
->$LOGDIR/$LOG
-
 get_book
 echo "${SD_BORDER}${nl_}"
 
+
 build_Makefile
 echo "${SD_BORDER}${nl_}"
 




More information about the alfs-log mailing list