[1b9148c] | 1 | # $Id$
|
---|
| 2 |
|
---|
[a5fa1a9] | 3 | #----------------------------------#
|
---|
[d27c9ca] | 4 | wrt_compare_targets() { #
|
---|
[bfbd927] | 5 | #----------------------------------#
|
---|
| 6 |
|
---|
| 7 | for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
|
---|
| 8 | # and "ITERATIONS" with no "$".
|
---|
[6794fe4] | 9 | ITERATION=iteration-$N
|
---|
[d27c9ca] | 10 | if [ "$N" != "1" ] ; then
|
---|
[aa08925] | 11 | wrt_system_build "$N" "$PREV_IT"
|
---|
[6794fe4] | 12 | fi
|
---|
[d27c9ca] | 13 | wrt_target "$ITERATION" "$PREV"
|
---|
| 14 | wrt_compare_work "$ITERATION" "$PREV_IT"
|
---|
| 15 | wrt_logs "$N"
|
---|
| 16 | PREV_IT=$ITERATION
|
---|
[eb024db] | 17 | PREV=$ITERATION
|
---|
[6794fe4] | 18 | done
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | #----------------------------------#
|
---|
[eb024db] | 22 | wrt_system_build() { #
|
---|
| 23 | #----------------------------------#
|
---|
[aa08925] | 24 | local RUN=$1
|
---|
| 25 | local PREV_IT=$2
|
---|
[d80021c3] | 26 |
|
---|
| 27 | if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "chroot" ]] ; then
|
---|
| 28 | final_system_Makefiles $RUN
|
---|
| 29 | elif [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
|
---|
| 30 | bm_final_system_Makefiles $RUN
|
---|
| 31 | else
|
---|
| 32 | chapter6_Makefiles $RUN
|
---|
| 33 | fi
|
---|
| 34 |
|
---|
[aa08925] | 35 | echo -e "\nsystem_build_$RUN: $PREV_IT $system_build" >> $MKFILE.tmp
|
---|
| 36 | PREV=system_build_$RUN
|
---|
| 37 |
|
---|
[eb024db] | 38 | }
|
---|
| 39 |
|
---|
| 40 | #----------------------------------#
|
---|
[d27c9ca] | 41 | wrt_compare_work() { #
|
---|
[6794fe4] | 42 | #----------------------------------#
|
---|
| 43 | local ITERATION=$1
|
---|
[d27c9ca] | 44 | local PREV_IT=$2
|
---|
[5112239] | 45 | local PRUNEPATH="/dev /home /jhalfs /lost+found /media /mnt /opt /proc \
|
---|
| 46 | /sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
|
---|
[6794fe4] | 47 |
|
---|
[aab6e73] | 48 | if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
|
---|
[8ba8df4] | 49 | local ROOT_DIR=/
|
---|
[6794fe4] | 50 | local DEST_TOPDIR=/jhalfs
|
---|
[8ba8df4] | 51 | local ICALOGDIR=/jhalfs/logs/ICA
|
---|
| 52 | local FARCELOGDIR=/jhalfs/logs/farce
|
---|
[6794fe4] | 53 | else
|
---|
[8ba8df4] | 54 | local ROOT_DIR=$BUILDDIR
|
---|
[6794fe4] | 55 | local DEST_TOPDIR=$BUILDDIR/jhalfs
|
---|
| 56 | fi
|
---|
| 57 |
|
---|
| 58 | if [[ "$RUN_ICA" = "1" ]] ; then
|
---|
| 59 | local DEST_ICA=$DEST_TOPDIR/ICA && \
|
---|
[bfbd927] | 60 | (
|
---|
| 61 | cat << EOF
|
---|
[685e4fc] | 62 | @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION && \\
|
---|
[6794fe4] | 63 | extras/do_ica_prep $DEST_ICA/$ITERATION
|
---|
[bfbd927] | 64 | EOF
|
---|
[d27c9ca] | 65 | ) >> $MKFILE.tmp
|
---|
[8ba8df4] | 66 | if [[ "$ITERATION" != "iteration-1" ]] ; then
|
---|
[d27c9ca] | 67 | wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
|
---|
[8ba8df4] | 68 | fi
|
---|
[6794fe4] | 69 | fi
|
---|
| 70 |
|
---|
| 71 | if [[ "$RUN_FARCE" = "1" ]] ; then
|
---|
| 72 | local DEST_FARCE=$DEST_TOPDIR/farce && \
|
---|
[bfbd927] | 73 | (
|
---|
| 74 | cat << EOF
|
---|
[685e4fc] | 75 | @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION && \\
|
---|
[6794fe4] | 76 | extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/$ITERATION.filelist
|
---|
[bfbd927] | 77 | EOF
|
---|
[d27c9ca] | 78 | ) >> $MKFILE.tmp
|
---|
[8ba8df4] | 79 | if [[ "$ITERATION" != "iteration-1" ]] ; then
|
---|
[d27c9ca] | 80 | wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
|
---|
[8ba8df4] | 81 | fi
|
---|
[6794fe4] | 82 | fi
|
---|
| 83 | }
|
---|
| 84 |
|
---|
[8ba8df4] | 85 | #----------------------------------#
|
---|
| 86 | wrt_do_ica_work() { #
|
---|
| 87 | #----------------------------------#
|
---|
[d27c9ca] | 88 | echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3" >> $MKFILE.tmp
|
---|
[8ba8df4] | 89 | }
|
---|
| 90 |
|
---|
| 91 | #----------------------------------#
|
---|
[d27c9ca] | 92 | wrt_do_farce_work() { #
|
---|
[8ba8df4] | 93 | #----------------------------------#
|
---|
| 94 | local OUTPUT=$FARCELOGDIR/${1}_V_${2}
|
---|
| 95 | local PREDIR=$3/$1
|
---|
| 96 | local PREFILE=$3/$1.filelist
|
---|
| 97 | local ITEDIR=$3/$2
|
---|
| 98 | local ITEFILE=$3/$2.filelist
|
---|
[d27c9ca] | 99 | echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE" >> $MKFILE.tmp
|
---|
[6794fe4] | 100 | }
|
---|
[bfbd927] | 101 |
|
---|
[6794fe4] | 102 | #----------------------------------#
|
---|
| 103 | wrt_logs() { #
|
---|
| 104 | #----------------------------------#
|
---|
[d27c9ca] | 105 | local ITERATION=iteration$1
|
---|
[6794fe4] | 106 |
|
---|
| 107 | (
|
---|
| 108 | cat << EOF
|
---|
| 109 | @pushd logs && \\
|
---|
| 110 | mkdir $ITERATION && \\
|
---|
[2034373] | 111 | cp ${chapter6} $ITERATION && \\
|
---|
[6794fe4] | 112 | popd
|
---|
[8ba8df4] | 113 | @touch \$@
|
---|
[bfbd927] | 114 | EOF
|
---|
[d27c9ca] | 115 | ) >> $MKFILE.tmp
|
---|
[bfbd927] | 116 | }
|
---|