# This config file set up an environment similar to phk's "ROVER"
# machine.
#
# This is a performance measurement tool for kernel changes - it does
# a timed 'buildworld' on one kernel, then repeat the process with
# another kernel.
#

#
# Override a single file from a here-document - in this case, make
# rc.local do the repeat-magic for different kernels.
#
override-file: /etc/rc.local <<EOF
OLDNUMBER=$(($(cat /var/tmp/buildworld-counter 2> /dev/null) + 0))
NUMBER=$(($(cat /var/tmp/buildworld-counter 2> /dev/null) + 1))
echo -n $NUMBER > /var/tmp/buildworld-counter
cd /usr/src
rm -rf /usr/obj
chflags -R noschg /usr/obj
rm -rf /usr/obj
mkdir /usr/obj
time make buildworld 2>&1 > /var/tmp/build${NUMBER}.log
if [ -e /kernel.${NUMBER} ]
then
	chflags noschg /kernel
	chflags noschg /kernel.${NUMBER}
	mv /kernel /kernel.${OLDNUMBER}-done
	mv /kernel.${NUMBER} /kernel
	/sbin/reboot
else
	echo; echo; echo
	echo "All tests done!"
	echo; echo; echo
fi
EOF

# I run with a serial console
override-file: /boot.config << EOF
-h
EOF

# We need a kernel, don't we?
kernel:	/kernel i386 GENERIC ../../sys/i386/conf/GENERIC

# For the rest of the kernels, add them as .1, .2 etc here.
