2006-03-09 04:38:59 +01:00
|
|
|
# $Id$
|
|
|
|
|
2006-04-08 16:02:59 +02:00
|
|
|
#----------------------------------#
|
2006-04-12 00:06:37 +02:00
|
|
|
wrt_compare_targets() { #
|
2006-04-08 18:30:12 +02:00
|
|
|
#----------------------------------#
|
|
|
|
|
|
|
|
for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
|
|
|
|
# and "ITERATIONS" with no "$".
|
2006-04-09 17:07:36 +02:00
|
|
|
ITERATION=iteration-$N
|
2006-04-12 00:06:37 +02:00
|
|
|
if [ "$N" != "1" ] ; then
|
2006-04-12 21:38:42 +02:00
|
|
|
wrt_system_build "$N" "$PREV_IT"
|
2006-04-09 17:07:36 +02:00
|
|
|
fi
|
2006-04-24 20:25:56 +02:00
|
|
|
this_script=$ITERATION
|
2006-04-12 00:06:37 +02:00
|
|
|
wrt_target "$ITERATION" "$PREV"
|
|
|
|
wrt_compare_work "$ITERATION" "$PREV_IT"
|
|
|
|
wrt_logs "$N"
|
|
|
|
PREV_IT=$ITERATION
|
2006-04-11 22:03:19 +02:00
|
|
|
PREV=$ITERATION
|
2006-04-09 17:07:36 +02:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------------#
|
2006-04-11 22:03:19 +02:00
|
|
|
wrt_system_build() { #
|
|
|
|
#----------------------------------#
|
2006-04-12 21:38:42 +02:00
|
|
|
local RUN=$1
|
|
|
|
local PREV_IT=$2
|
2006-04-12 19:12:35 +02:00
|
|
|
|
|
|
|
if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "chroot" ]] ; then
|
|
|
|
final_system_Makefiles $RUN
|
|
|
|
elif [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
|
|
|
|
bm_final_system_Makefiles $RUN
|
|
|
|
else
|
|
|
|
chapter6_Makefiles $RUN
|
|
|
|
fi
|
|
|
|
|
2006-04-12 21:38:42 +02:00
|
|
|
echo -e "\nsystem_build_$RUN: $PREV_IT $system_build" >> $MKFILE.tmp
|
|
|
|
PREV=system_build_$RUN
|
|
|
|
|
2006-04-11 22:03:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------------#
|
2006-04-12 00:06:37 +02:00
|
|
|
wrt_compare_work() { #
|
2006-04-09 17:07:36 +02:00
|
|
|
#----------------------------------#
|
|
|
|
local ITERATION=$1
|
2006-04-12 00:06:37 +02:00
|
|
|
local PREV_IT=$2
|
2006-06-02 19:53:17 +02:00
|
|
|
local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
|
2006-04-10 21:35:23 +02:00
|
|
|
/sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
|
2006-04-09 17:07:36 +02:00
|
|
|
|
2006-04-09 17:16:49 +02:00
|
|
|
if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
|
2006-04-09 22:31:19 +02:00
|
|
|
local ROOT_DIR=/
|
2006-06-02 19:53:17 +02:00
|
|
|
local DEST_TOPDIR=/${SCRIPT_ROOT}
|
|
|
|
local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
|
|
|
|
local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
|
2006-04-09 17:07:36 +02:00
|
|
|
else
|
2006-04-09 22:31:19 +02:00
|
|
|
local ROOT_DIR=$BUILDDIR
|
2006-06-02 19:53:17 +02:00
|
|
|
local DEST_TOPDIR=$BUILDDIR/${SCRIPT_ROOT}
|
2006-04-09 17:07:36 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$RUN_ICA" = "1" ]] ; then
|
|
|
|
local DEST_ICA=$DEST_TOPDIR/ICA && \
|
2006-04-08 18:30:12 +02:00
|
|
|
(
|
|
|
|
cat << EOF
|
2006-04-14 18:46:50 +02:00
|
|
|
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >>logs/$ITERATION.log 2>&1 && \\
|
|
|
|
extras/do_ica_prep $DEST_ICA/$ITERATION >>logs/$ITERATION.log 2>&1
|
2006-04-08 18:30:12 +02:00
|
|
|
EOF
|
2006-04-12 00:06:37 +02:00
|
|
|
) >> $MKFILE.tmp
|
2006-04-09 22:31:19 +02:00
|
|
|
if [[ "$ITERATION" != "iteration-1" ]] ; then
|
2006-04-12 00:06:37 +02:00
|
|
|
wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
|
2006-04-09 22:31:19 +02:00
|
|
|
fi
|
2006-04-09 17:07:36 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$RUN_FARCE" = "1" ]] ; then
|
|
|
|
local DEST_FARCE=$DEST_TOPDIR/farce && \
|
2006-04-08 18:30:12 +02:00
|
|
|
(
|
|
|
|
cat << EOF
|
2006-04-14 18:46:50 +02:00
|
|
|
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >>logs/$ITERATION.log 2>&1 && \\
|
|
|
|
extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >>logs/$ITERATION.log 2>&1
|
2006-04-08 18:30:12 +02:00
|
|
|
EOF
|
2006-04-12 00:06:37 +02:00
|
|
|
) >> $MKFILE.tmp
|
2006-04-09 22:31:19 +02:00
|
|
|
if [[ "$ITERATION" != "iteration-1" ]] ; then
|
2006-04-12 00:06:37 +02:00
|
|
|
wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
|
2006-04-09 22:31:19 +02:00
|
|
|
fi
|
2006-04-09 17:07:36 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2006-04-09 22:31:19 +02:00
|
|
|
#----------------------------------#
|
|
|
|
wrt_do_ica_work() { #
|
|
|
|
#----------------------------------#
|
2006-04-14 18:46:50 +02:00
|
|
|
echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/$ITERATION.log 2>&1" >> $MKFILE.tmp
|
2006-04-09 22:31:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------------#
|
2006-04-12 00:06:37 +02:00
|
|
|
wrt_do_farce_work() { #
|
2006-04-09 22:31:19 +02:00
|
|
|
#----------------------------------#
|
|
|
|
local OUTPUT=$FARCELOGDIR/${1}_V_${2}
|
|
|
|
local PREDIR=$3/$1
|
2006-04-14 18:46:50 +02:00
|
|
|
local PREFILE=$3/filelist-$1
|
2006-04-09 22:31:19 +02:00
|
|
|
local ITEDIR=$3/$2
|
2006-04-14 18:46:50 +02:00
|
|
|
local ITEFILE=$3/filelist-$2
|
|
|
|
echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/$ITERATION.log 2>&1" >> $MKFILE.tmp
|
2006-04-09 17:07:36 +02:00
|
|
|
}
|
2006-04-08 18:30:12 +02:00
|
|
|
|
2006-04-09 17:07:36 +02:00
|
|
|
#----------------------------------#
|
2006-06-10 18:48:25 +02:00
|
|
|
wrt_logs() { #
|
2006-04-09 17:07:36 +02:00
|
|
|
#----------------------------------#
|
2006-04-14 18:46:50 +02:00
|
|
|
local ITERATION=iteration-$1
|
2006-04-09 17:07:36 +02:00
|
|
|
|
|
|
|
(
|
|
|
|
cat << EOF
|
2006-04-14 18:46:50 +02:00
|
|
|
@pushd logs 1> /dev/null && \\
|
2006-04-09 17:07:36 +02:00
|
|
|
mkdir $ITERATION && \\
|
2006-04-24 20:25:56 +02:00
|
|
|
mv ${LOGS} $ITERATION && \\
|
2006-04-14 18:46:50 +02:00
|
|
|
popd 1> /dev/null
|
2006-06-10 18:48:25 +02:00
|
|
|
@touch \$@ && \\
|
|
|
|
echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
|
|
|
|
echo --------------------------------------------------------------------------------\$(WHITE)
|
2006-04-08 18:30:12 +02:00
|
|
|
EOF
|
2006-04-12 00:06:37 +02:00
|
|
|
) >> $MKFILE.tmp
|
2006-04-08 18:30:12 +02:00
|
|
|
}
|