r2590 - jhalfs/branches/experimental/HLFS

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Fri Apr 28 11:53:59 PDT 2006


Author: manuel
Date: 2006-04-28 12:53:59 -0600 (Fri, 28 Apr 2006)
New Revision: 2590

Modified:
   jhalfs/branches/experimental/HLFS/master.sh
Log:
Added ICA/farce support to HLFS module.

Modified: jhalfs/branches/experimental/HLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/HLFS/master.sh	2006-04-28 17:43:41 UTC (rev 2589)
+++ jhalfs/branches/experimental/HLFS/master.sh	2006-04-28 18:53:59 UTC (rev 2590)
@@ -295,8 +295,31 @@
   local TARGET LOADER
   local file
   local this_script
+  # Set envars and scripts for iteration targets
+  LOGS="" # Start with an empty global LOGS envar
+  if [[ -z "$1" ]] ; then
+    local N=""
+  else
+    local N=-build_$1
+    local chapter6=""
+    mkdir chapter06$N
+    cp chapter06/* chapter06$N
+    for script in chapter06$N/* ; do
+      # Overwrite existing symlinks, files, and dirs
+      sed -e 's/ln -s /ln -sf /g' \
+          -e 's/^mv /&-f/g' -i ${script}
+    done
+    # Remove Bzip2 binaries before make install
+    sed -e 's at make install at rm -vf /usr/bin/bz*\n&@' -i chapter06$N/*-bzip2
+    # Fix how Module-Init-Tools do the install target
+    sed -e 's at make install at make INSTALL=install install@' -i chapter06$N/*-module-init-tools
+    # Delete *old Readline libraries just after make install
+    sed -e 's at make install@&\nrm -v /lib/lib{history,readline}*old@' -i chapter06$N/*-readline
+    # Don't readd already existing groups
+    sed -e '/groupadd/d' -i chapter06$N/*-udev
+  fi
 
-  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6${R_arrow}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter6$N${R_arrow}"
   #
   # Set these definitions early and only once
   #
@@ -306,7 +329,7 @@
     TARGET="pc-linux-gnu";    LOADER="ld-linux.so.2"
   fi
 
-  for file in chapter06/* ; do
+  for file in chapter06$N/* ; do
     # Keep the script file name
     this_script=`basename $file`
 
@@ -317,26 +340,40 @@
       *chroot* )  continue ;;
         # Test if the stripping phase must be skipped
       *-stripping* )  [[ "$STRIP" = "0" ]] && continue ;;
-      *) ;;
     esac
 
-    # First append each name of the script files to a list (this will become
-    # the names of the targets in the Makefile
-    chapter6="$chapter6 $this_script"
-
     # Grab the name of the target
     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'`
+
+    if [[ "$vrs" = "" ]] && [[ -n "$N" ]] ; then
+      case "${this_script}" in
+        *stripping*) ;;
+        *)  continue ;;
+      esac
+    fi
+
+    # Append each name of the script files to a list (this will become
+    # the names of the targets in the Makefile
+    chapter6="$chapter6 ${this_script}${N}"
+
+    # Append each name of the script files to a list (this will become
+    # the names of the targets in the Makefile)
+    chapter6="$chapter6 ${this_script}${N}"
+
     #
     # 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/$this_script
+          sed 's/rm /rm -f /' -i chapter06$N/$this_script
         ;;
       gcc)
-          sed 's/rm /rm -f /' -i chapter06/$this_script
+          sed 's/rm /rm -f /' -i chapter06$N/$this_script
         ;;
     esac
 
@@ -346,12 +383,8 @@
     #
     # 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 "${this_script}${N}" "$PREV"
 
-    # 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...
     # Insert instructions for unpacking the package and changing directories
     if [ "$vrs" != "" ] ; then
@@ -408,7 +441,9 @@
     #--------------------------------------------------------------------#
 
     # Keep the script file name for Makefile dependencies.
-    PREV=$this_script
+    PREV=${this_script}${N}
+    # Set system_build envar for iteration targets
+    system_build=$chapter6
   done # end for file in chapter06/*
 
 }
@@ -518,6 +553,8 @@
   chapter3_Makefiles
   chapter5_Makefiles
   chapter6_Makefiles
+  # Add the iterations targets, if needed
+  [[ "$COMPARE" != "0" ]] && wrt_compare_targets
   chapter7_Makefiles
 
   # Add a header, some variables and include the function file




More information about the alfs-log mailing list