Added wrt_do_X_work functions.
This commit is contained in:
parent
a101844a48
commit
8ba8df489f
2 changed files with 40 additions and 16 deletions
|
@ -68,18 +68,18 @@ ITERATIONS=3
|
||||||
#--- Run ICA testing 0(no)/1(yes)
|
#--- Run ICA testing 0(no)/1(yes)
|
||||||
RUN_ICA=0
|
RUN_ICA=0
|
||||||
|
|
||||||
#--- ICA report log directory
|
|
||||||
ICALOGDIR=$JHALFSDIR/logs/ICA
|
|
||||||
|
|
||||||
#--- Run farce testing 0(no)/1(yes)
|
#--- Run farce testing 0(no)/1(yes)
|
||||||
RUN_FARCE=0
|
RUN_FARCE=0
|
||||||
|
|
||||||
#--- farce report log directory
|
|
||||||
FARCELOGDIR=$JHALFSDIR/logs/farce
|
|
||||||
|
|
||||||
#==== INTERNAL VARIABLES ====
|
#==== INTERNAL VARIABLES ====
|
||||||
# Don't edit it unless you know what you are doing
|
# Don't edit it unless you know what you are doing
|
||||||
|
|
||||||
#--- Working directories
|
#--- Working directories
|
||||||
JHALFSDIR=$BUILDDIR/jhalfs
|
JHALFSDIR=$BUILDDIR/jhalfs
|
||||||
LOGDIR=$JHALFSDIR/logs
|
LOGDIR=$JHALFSDIR/logs
|
||||||
|
|
||||||
|
#--- ICA report log directory
|
||||||
|
ICALOGDIR=$LOGDIR/ICA
|
||||||
|
|
||||||
|
#--- farce report log directory
|
||||||
|
FARCELOGDIR=$LOGDIR/farce
|
||||||
|
|
|
@ -32,21 +32,15 @@ wrt_iterations() { #
|
||||||
echo "$ITERATION: chapter06" >> $MKFILE
|
echo "$ITERATION: chapter06" >> $MKFILE
|
||||||
wrt_prepare "$ITERATION"
|
wrt_prepare "$ITERATION"
|
||||||
wrt_logs_and_clean "$ITERATION"
|
wrt_logs_and_clean "$ITERATION"
|
||||||
echo -e "\t@touch \$@\n" >> $MKFILE
|
|
||||||
PREV=$ITERATION
|
PREV=$ITERATION
|
||||||
elif [ "$N" = "$ITERATIONS" ] ; then
|
elif [ "$N" = "$ITERATIONS" ] ; then
|
||||||
echo "iteration-last: $PREV system_rebuild" >> $MKFILE
|
echo "iteration-last: $PREV system_rebuild" >> $MKFILE
|
||||||
wrt_prepare "$ITERATION"
|
wrt_prepare "$ITERATION" "$PREV"
|
||||||
wrt_logs "$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@touch \$@\n" >> $MKFILE
|
|
||||||
else
|
else
|
||||||
echo "$ITERATION: $PREV system_rebuild" >> $MKFILE
|
echo "$ITERATION: $PREV system_rebuild" >> $MKFILE
|
||||||
wrt_prepare "$ITERATION"
|
wrt_prepare "$ITERATION" "$PREV"
|
||||||
wrt_logs_and_clean "$ITERATION"
|
wrt_logs_and_clean "$ITERATION"
|
||||||
echo -e "\t@touch \$@\n" >> $MKFILE
|
|
||||||
PREV=$ITERATION
|
PREV=$ITERATION
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -56,18 +50,21 @@ wrt_iterations() { #
|
||||||
wrt_prepare() { #
|
wrt_prepare() { #
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
local ITERATION=$1
|
local ITERATION=$1
|
||||||
|
local PREV=$2
|
||||||
|
|
||||||
if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
|
if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
|
||||||
local PRUNEPATH="/jhalfs /sources /var/log/paco /opt /dev /home /mnt /proc \
|
local PRUNEPATH="/jhalfs /sources /var/log/paco /opt /dev /home /mnt /proc \
|
||||||
/root /sys /tmp /usr/src /lost+found /tools"
|
/root /sys /tmp /usr/src /lost+found /tools"
|
||||||
local ROOT_DIR=/
|
local ROOT_DIR=/
|
||||||
local DEST_TOPDIR=/jhalfs
|
local DEST_TOPDIR=/jhalfs
|
||||||
|
local ICALOGDIR=/jhalfs/logs/ICA
|
||||||
|
local FARCELOGDIR=/jhalfs/logs/farce
|
||||||
else
|
else
|
||||||
local PRUNEPATH="$BUILDDIR/jhalfs $BUILDDIR/sources $BUILDDIR/var/log/paco \
|
local PRUNEPATH="$BUILDDIR/jhalfs $BUILDDIR/sources $BUILDDIR/var/log/paco \
|
||||||
$BUILDDIR/opt $BUILDDIR/dev $BUILDDIR/home $BUILDDIR/mnt \
|
$BUILDDIR/opt $BUILDDIR/dev $BUILDDIR/home $BUILDDIR/mnt \
|
||||||
$BUILDDIR/proc $BUILDDIR/root $BUILDDIR/sys $BUILDDIR/tmp \
|
$BUILDDIR/proc $BUILDDIR/root $BUILDDIR/sys $BUILDDIR/tmp \
|
||||||
$BUILDDIR/usr/src $BUILDDIR/lost+found $BUILDDIR/tools"
|
$BUILDDIR/usr/src $BUILDDIR/lost+found $BUILDDIR/tools"
|
||||||
local ROOT_DIR=$BUILDDIR
|
local ROOT_DIR=$BUILDDIR
|
||||||
local DEST_TOPDIR=$BUILDDIR/jhalfs
|
local DEST_TOPDIR=$BUILDDIR/jhalfs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -79,6 +76,9 @@ $BUILDDIR/usr/src $BUILDDIR/lost+found $BUILDDIR/tools"
|
||||||
extras/do_ica_prep $DEST_ICA/$ITERATION
|
extras/do_ica_prep $DEST_ICA/$ITERATION
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE
|
) >> $MKFILE
|
||||||
|
if [[ "$ITERATION" != "iteration-1" ]] ; then
|
||||||
|
wrt_do_ica_work "$PREV" "$ITERATION" "$DEST_ICA"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$RUN_FARCE" = "1" ]] ; then
|
if [[ "$RUN_FARCE" = "1" ]] ; then
|
||||||
|
@ -89,9 +89,29 @@ EOF
|
||||||
extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/$ITERATION.filelist
|
extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/$ITERATION.filelist
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE
|
) >> $MKFILE
|
||||||
|
if [[ "$ITERATION" != "iteration-1" ]] ; then
|
||||||
|
wrt_do_farce_work "$PREV" "$ITERATION" "$DEST_FARCE"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------#
|
||||||
|
wrt_do_ica_work() { #
|
||||||
|
#----------------------------------#
|
||||||
|
echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3" >> $MKFILE
|
||||||
|
}
|
||||||
|
|
||||||
|
#----------------------------------#
|
||||||
|
wrt_do_farce_work() { #
|
||||||
|
#----------------------------------#
|
||||||
|
local OUTPUT=$FARCELOGDIR/${1}_V_${2}
|
||||||
|
local PREDIR=$3/$1
|
||||||
|
local PREFILE=$3/$1.filelist
|
||||||
|
local ITEDIR=$3/$2
|
||||||
|
local ITEFILE=$3/$2.filelist
|
||||||
|
echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE" >> $MKFILE
|
||||||
|
}
|
||||||
|
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
wrt_logs_and_clean() { #
|
wrt_logs_and_clean() { #
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
|
@ -104,6 +124,8 @@ wrt_logs_and_clean() { #
|
||||||
mv $system_rebuild $ITERATION && \\
|
mv $system_rebuild $ITERATION && \\
|
||||||
popd
|
popd
|
||||||
@rm -f $system_rebuild
|
@rm -f $system_rebuild
|
||||||
|
@touch \$@
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE
|
) >> $MKFILE
|
||||||
}
|
}
|
||||||
|
@ -119,6 +141,8 @@ wrt_logs() { #
|
||||||
mkdir $ITERATION && \\
|
mkdir $ITERATION && \\
|
||||||
cp $system_rebuild $ITERATION && \\
|
cp $system_rebuild $ITERATION && \\
|
||||||
popd
|
popd
|
||||||
|
@touch \$@
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE
|
) >> $MKFILE
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue