diff options
author | phk <phk@FreeBSD.org> | 2005-07-31 14:16:13 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-07-31 14:16:13 +0000 |
commit | 13782c6aeb1a5f5899aa63eeba5d135b1d077ade (patch) | |
tree | 90de906c399a4475c00f18f837de867213764791 /tools | |
parent | bf6281231277a2786bcbeead9d303571a972694e (diff) | |
download | FreeBSD-src-13782c6aeb1a5f5899aa63eeba5d135b1d077ade.zip FreeBSD-src-13782c6aeb1a5f5899aa63eeba5d135b1d077ade.tar.gz |
The beginnings of a tool to survey the build options (NO_THIS, NO_THAT etc)
for effect.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tools/build_option_survey/mkhtml.sh | 85 | ||||
-rw-r--r-- | tools/tools/build_option_survey/no_list | 49 | ||||
-rw-r--r-- | tools/tools/build_option_survey/option_survey.sh | 145 |
3 files changed, 279 insertions, 0 deletions
diff --git a/tools/tools/build_option_survey/mkhtml.sh b/tools/tools/build_option_survey/mkhtml.sh new file mode 100644 index 0000000..6ecb79c --- /dev/null +++ b/tools/tools/build_option_survey/mkhtml.sh @@ -0,0 +1,85 @@ +#!/bin/sh +# This file is in the public domain +# $FreeBSD$ + +rm -rf HTML +mkdir -p HTML + +ref_blk=`awk 'NR == 2 {print $3}' Tmp/Ref/_.df` + +echo $ref_blk + +H=HTML/index.html +echo "<HTML>" > ${H} + +echo "<TABLE border=2>" >> ${H} +echo ' + +<TR> +<TH COLSPAN=13>Build option survey</TH> +</TR> + +<TR> +<TH ROWSPAN=2>make.conf</TH> +<TH COLSPAN=4>InstallWorld</TH> +<TH COLSPAN=4>BuildWorld</TH> +<TH COLSPAN=4>Build + InstallWorld</TH> +</TR> + +<TR> +<TH>Blocks</TH> +<TH>Delta</TH> +<TH COLSPAN=2>Files</TH> +<TH>Blocks</TH> +<TH>Delta</TH> +<TH COLSPAN=2>Files</TH> +<TH>Blocks</TH> +<TH>Delta</TH> +<TH COLSPAN=2>Files</TH> +</TR> +' >> $H +echo '<TR><TD><I>[empty]</I></TD>' >> $H +echo "<TD align=right>$ref_blk</TD>" >> $H +echo "<TD></TD><TD></TD><TD></TD>" >> $H +echo "<TD align=right>$ref_blk</TD>" >> $H +echo "<TD></TD><TD></TD><TD></TD>" >> $H +echo "<TD align=right>$ref_blk</TD>" >> $H +echo "<TD></TD><TD></TD><TD></TD>" >> $H +echo "</TR>" >> $H + +cat no_list | while read o +do + m=`echo "$o=YES" | md5` + echo "<TR>" >> $H + echo "<TD>" >> $H + cat Tmp/$m/iw/make.conf >> $H + echo "</TD>" >> $H + for d in iw bw w + do + if [ ! -d Tmp/$m/$d ] ; then + echo "<TD>-</TD><TD>-</TD><TD>-</TD><TD>-</TD>" >> $H + continue + fi + if [ ! -f Tmp/$m/$d/_.df ] ; then + echo "<TD>-</TD><TD>-</TD><TD>-</TD><TD>-</TD>" >> $H + continue + fi + blk=`awk 'NR == 2 {print $3}' Tmp/$m/$d/_.df` + echo "<TD align=right>$blk</TD>" >> $H + echo "<TD align=right>`expr $blk - $ref_blk`</TD>" >> $H + mtree -f Tmp/Ref/_.mtree -f Tmp/$m/$d/_.mtree | + sed '/^ /d' > HTML/$m.$d.mtree.txt + + sub=`grep -cv '^ ' < HTML/$m.$d.mtree.txt` + add=`grep -c '^ ' < HTML/$m.$d.mtree.txt` + echo "<TD align=right><A href=\"$m.$d.mtree.txt\">+$add</A></TD>" >> $H + echo "<TD align=right><A href=\"$m.$d.mtree.txt\">-$sub</A></TD>" >> $H + + done + echo "</TR>" >> $H +done +echo "</TABLE>" >> ${H} +echo "</HTML>" >> ${H} + +scp -r HTML phk@critter:/tmp +#scp -r HTML phk@phk:www/misc/kernel_options diff --git a/tools/tools/build_option_survey/no_list b/tools/tools/build_option_survey/no_list new file mode 100644 index 0000000..787a42f --- /dev/null +++ b/tools/tools/build_option_survey/no_list @@ -0,0 +1,49 @@ +# This file is in the public domain +# $FreeBSD$ +NO_ACPI +NO_ATM +NO_AUTHPF +NO_BIND +NO_BIND_DNSSEC +NO_BIND_LIBS_LWRES +NO_BIND_UTILS +NO_BLUETOOTH +NO_CVS +NO_CXX +NO_DICT +NO_FORTRAN +NO_GAMES +NO_GCOV +NO_GDB +NO_GPIB +NO_HESIOD_LIBC +NO_HTML +NO_I4B +NO_INET6 +NO_INFO +NO_IPFILTER +NO_KERBEROS +NO_KLDLOAD +NO_LIBC_R +NO_LIBPTHREAD +NO_LIBTHR +NO_LPR +NO_MAILWRAPER +NO_MAN +NO_MODULES +NO_NETCAT +NO_NETGRAPH +NO_NIS +NO_OBJC +NO_P1003_1B +NO_PAM +NO_PF +NO_PROFILE +NO_RCMDS +NO_RESCUE +NO_SENDMAIL +NO_SHAREDOCS +NO_TOOLCHAIN +NO_USB +PPP_NO_NETGRAPH +PPP_NO_RADIUS diff --git a/tools/tools/build_option_survey/option_survey.sh b/tools/tools/build_option_survey/option_survey.sh new file mode 100644 index 0000000..2beadb5 --- /dev/null +++ b/tools/tools/build_option_survey/option_survey.sh @@ -0,0 +1,145 @@ +#!/bin/sh +# This file is in the public domain +# $FreeBSD$ + +set -e + +bw ( ) ( + cd ../../.. + make -j 4 buildworld \ + __MAKE_CONF=${ODIR}/make.conf \ + > ${ODIR}/_.bw 2>&1 + make -j 4 buildkernel \ + KERNCONF=GENERIC \ + __MAKE_CONF=${ODIR}/make.conf \ + > ${ODIR}/_.bk 2>&1 +) + +iw ( ) ( + dd if=/dev/zero of=${ODIR}/_.i bs=1m count=200 + mkdir -p ${MNT} + MD=`mdconfig -a -t vnode -f ${ODIR}/_.i` + trap "umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT + newfs -O1 -U -b 4096 -f 512 /dev/$MD + mount /dev/${MD} ${MNT} + + cd ../../.. + make installworld \ + __MAKE_CONF=${ODIR}/make.conf \ + DESTDIR=${MNT} \ + > ${ODIR}/_.iw 2>&1 + cd etc + make distribution \ + __MAKE_CONF=${ODIR}/make.conf \ + DESTDIR=${MNT} \ + > ${ODIR}/_.etc 2>&1 + cd .. + make installkernel \ + KERNCONF=GENERIC \ + DESTDIR=${MNT} \ + __MAKE_CONF=${ODIR}/make.conf \ + > ${ODIR}/_.ik 2>&1 + + sync ${MNT} + ( cd ${MNT} && mtree -c ) > ${ODIR}/_.mtree + ( cd ${MNT} && du ) > ${ODIR}/_.du + ( df -i ${MNT} ) > ${ODIR}/_.df +) + +ODIR=/usr/obj/`pwd` +MNT=${ODIR}/_.mnt +MAKEOBJDIRPREFIX=$ODIR +export MAKEOBJDIRPREFIX ODIR MNT + +if false ; then + if rm -rf ${ODIR} ; then + true + else + chflags -R noschg ${ODIR} + rm -rf ${ODIR} + fi + mkdir -p ${ODIR} + + echo '' > ${ODIR}/make.conf + + bw +fi + +if false ; then + rm -rf Tmp + + echo '' > ${ODIR}/make.conf + + if iw ; then + m=Tmp/Ref + mkdir -p $m + cp ${ODIR}/_.df $m + cp ${ODIR}/_.mtree $m + cp ${ODIR}/_.du $m + fi + + cat no_list | while read o + do + echo "IW $o" + echo "$o=YES" > ${ODIR}/make.conf + m=Tmp/`md5 < ${ODIR}/make.conf`/iw + mkdir -p $m + echo $m + cp ${ODIR}/make.conf $m + if iw ; then + cp ${ODIR}/_.df $m + cp ${ODIR}/_.mtree $m + cp ${ODIR}/_.du $m + else + cp ${ODIR}/_.iw $m + cp ${ODIR}/_.ik $m + fi + done +fi + +if true ; then + cat no_list | while read o + do + # First build+installworld + echo "W $o" + echo "$o=YES" > ${ODIR}/make.conf + + m=Tmp/`md5 < ${ODIR}/make.conf`/w + mkdir -p $m + echo $m + cp ${ODIR}/make.conf $m + + if bw ; then + true + else + cp ${ODIR}/_.bw $m || true + cp ${ODIR}/_.bk $m || true + fi + if iw ; then + cp ${ODIR}/_.df $m + cp ${ODIR}/_.mtree $m + cp ${ODIR}/_.du $m + else + cp ${ODIR}/_.iw $m + cp ${ODIR}/_.ik $m + fi + + # Then only buildworld + echo "BW $o" + m=Tmp/`md5 < ${ODIR}/make.conf`/bw + mkdir -p $m + echo $m + cp ${ODIR}/make.conf $m + echo '' > ${ODIR}/make.conf + if iw ; then + cp ${ODIR}/_.df $m + cp ${ODIR}/_.mtree $m + cp ${ODIR}/_.du $m + else + cp ${ODIR}/_.iw $m + cp ${ODIR}/_.ik $m + fi + + + done +fi |