r2507 - jhalfs/branches/experimental/common

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sun Apr 9 08:07:36 PDT 2006


Author: manuel
Date: 2006-04-09 09:07:36 -0600 (Sun, 09 Apr 2006)
New Revision: 2507

Modified:
   jhalfs/branches/experimental/common/func_ICA.sh
Log:
Added farce support into func_ICA.sh

Modified: jhalfs/branches/experimental/common/func_ICA.sh
===================================================================
--- jhalfs/branches/experimental/common/func_ICA.sh	2006-04-09 14:27:24 UTC (rev 2506)
+++ jhalfs/branches/experimental/common/func_ICA.sh	2006-04-09 15:07:36 UTC (rev 2507)
@@ -27,51 +27,98 @@
 
   for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
                                           # and "ITERATIONS" with no "$".
-   ITERATION=iteration-$N
-   if [ "$N" = "1" ] ; then
+    ITERATION=iteration-$N
+    if [ "$N" = "1" ] ; then
+      echo "$ITERATION:  chapter06" >> $MKFILE
+      wrt_prepare        "$ITERATION"
+      wrt_logs_and_clean "$ITERATION"
+      echo -e "\t at touch \$@\n" >> $MKFILE
+      PREV=$ITERATION
+    elif [ "$N" = "$ITERATIONS" ] ; then
+      echo "iteration-last:  $PREV  system_rebuild" >> $MKFILE
+      wrt_prepare        "$ITERATION"
+      wrt_logs           "$ITERATION"
+      #I need to gigure out how to handle this for ITERATIONS > 2
+      # @do_ica_work $1 $2
+      # @farce $1 $2
+      echo -e "\t at touch \$@\n" >> $MKFILE
+    else
+      echo "$ITERATION:  $PREV  system_rebuild" >> $MKFILE
+      wrt_prepare        "$ITERATION"
+      wrt_logs_and_clean "$ITERATION"
+      echo -e "\t at touch \$@\n" >> $MKFILE
+      PREV=$ITERATION
+    fi
+  done
+}
+
+#----------------------------------#
+wrt_prepare() {                    #
+#----------------------------------#
+  local ITERATION=$1
+
+  if [[ "$PROGNAME" = "CLFS" ]] && [[ "$METHOD" = "boot" ]] ; then
+    local PRUNEPATH="/jhalfs /sources /var/log/paco /opt /dev /home /mnt /proc \
+/root /sys /tmp /usr/src /lost+found /tools"
+    local ROOT_DIR=/
+    local DEST_TOPDIR=/jhalfs
+  else
+    local PRUNEPATH="$BUILDDIR/jhalfs $BUILDDIR/sources $BUILDDIR/var/log/paco \
+$BUILDDIR/opt $BUILDDIR/dev $BUILDDIR/home $BUILDDIR/mnt \
+$BUILDDIR/proc $BUILDDIR/root $BUILDDIR/sys $BUILDDIR/tmp \
+$BUILDDIR/usr/src $BUILDDIR/lost+found $BUILDDIR/tools"
+    local ROOT_DIR=$BUILDDIR
+    local DEST_TOPDIR=$BUILDDIR/jhalfs
+  fi
+
+  if [[ "$RUN_ICA" = "1" ]] ; then
+    local DEST_ICA=$DEST_TOPDIR/ICA && \
 (
     cat << EOF
-$ITERATION:  chapter06
-	@do_ica_prep
-	@pushd logs && \\
-	mkdir $ITERATION && \\
-	mv $system_rebuild $ITERATION && \\
-	popd
-	@rm -f $system_rebuild
-	@touch \$@
+	@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION \\
+	extras/do_ica_prep $DEST_ICA/$ITERATION
+EOF
+) >> $MKFILE
+  fi
 
+  if [[ "$RUN_FARCE" = "1" ]] ; then
+    local DEST_FARCE=$DEST_TOPDIR/farce && \
+(
+    cat << EOF
+	@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION \\
+	extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/$ITERATION.filelist
 EOF
 ) >> $MKFILE
-      PREV=$ITERATION
-    elif [ "$N" = "$ITERATIONS" ] ; then
+  fi
+}
+
+#----------------------------------#
+wrt_logs_and_clean() {             #
+#----------------------------------#
+  local ITERATION=$1
+
 (
     cat << EOF
-iteration-last: $PREV  ICA_rebuild
-	@do_ica_prep
 	@pushd logs && \\
-	mkdir iteration-last && \\
-	cp $system_rebuild iteration-last && \\
+	mkdir $ITERATION && \\
+	mv $system_rebuild $ITERATION && \\
 	popd
-	@do_ica_work
-	@touch \$@
-
+	@rm -f $system_rebuild
 EOF
 ) >> $MKFILE
-    else
+}
+
+#----------------------------------#
+wrt_logs() {             #
+#----------------------------------#
+  local ITERATION=$1
+
 (
     cat << EOF
-$ITERATION: $PREV  ICA_rebuild
-	@do_ica_prep
 	@pushd logs && \\
 	mkdir $ITERATION && \\
-	mv $system_rebuild $ITERATION && \\
+	cp $system_rebuild $ITERATION && \\
 	popd
-	@rm -f $system_rebuild
-	@touch \$@
-
 EOF
 ) >> $MKFILE
-      PREV=$ITERATION
-    fi
-  done
 }




More information about the alfs-log mailing list