abuild: update output so multithreaded is decipherable

- add a 'quiet' mode that only prints important messages
- add vendor/mainboard to all strings printed

With quiet on, multithreaded looks like this:
skipping google/storm because we're missing compilers for (arm armv4 armv7)
iwill/dk8_htx built successfully. (took 5s)
jetway/j7f2 built successfully. (took 6s)
iwill/dk8x built successfully. (took 8s)
iwill/dk8s2 built successfully. (took 8s)
jetway/j7f4k1g5d built successfully. (took 10s)

With quiet off, single threaded now looks like this:
Building intel/emeraldlake2
Creating config file for intel/emeraldlake2...
    intel/emeraldlake2 (blobs, ccache)
intel/emeraldlake2 config created.
Compiling intel/emeraldlake2 image...
intel/emeraldlake2 built successfully. (took 5s)

And quiet off multithreaded looks like this:
Building iwill/dk8_htx
Creating config file for iwill/dk8_htx...
    iwill/dk8_htx (blobs, ccache)
intel/mohonpeak config created.
Compiling intel/mohonpeak image on 1 cpu...
intel/minnowmax config created.
--- snip ---
intel/mtarvon built successfully. (took 4s)
Building iwill/dk8s2
Creating config file for iwill/dk8s2...
    iwill/dk8s2 (blobs, ccache)
intel/mohonpeak built successfully. (took 5s)
Building iwill/dk8x

Change-Id: Ib7b9a625d77bb8e0663afc00d7133e415866ecec
Signed-off-by: Martin Roth <martin.roth@se-eng.com>
Reviewed-on: http://review.coreboot.org/7716
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
This commit is contained in:
Martin Roth 2014-12-08 01:57:52 -07:00 committed by Martin Roth
parent ec9293fb5a
commit ddb7a9d4a1
1 changed files with 19 additions and 16 deletions

View File

@ -6,7 +6,7 @@
# #
# (C) 2004 by Stefan Reinauer <stepan@openbios.org> # (C) 2004 by Stefan Reinauer <stepan@openbios.org>
# (C) 2006-2010 by coresystems GmbH <info@coresystems.de> # (C) 2006-2010 by coresystems GmbH <info@coresystems.de>
# (C) 2013 Sage Electronic Engineering, LLC # (C) 2013-2014 Sage Electronic Engineering, LLC
# (C) 2014 Patrick Georgi <patrick@georgi-clan.de> # (C) 2014 Patrick Georgi <patrick@georgi-clan.de>
# #
# This file is subject to the terms and conditions of the GNU General # This file is subject to the terms and conditions of the GNU General
@ -70,6 +70,9 @@ mode=text
# this is disabled per default but can be enabled with -s # this is disabled per default but can be enabled with -s
silent= silent=
# quiet mode: only print pass, failure, and 'skipped' messages
quiet=false
# clang mode enabled by -sb option. # clang mode enabled by -sb option.
scanbuild=false scanbuild=false
@ -159,7 +162,7 @@ function create_config
printf " Using existing configuration $CONFIG ... " printf " Using existing configuration $CONFIG ... "
cp src/mainboard/$VENDOR/$MAINBOARD/$CONFIG ${build_dir}/config.build cp src/mainboard/$VENDOR/$MAINBOARD/$CONFIG ${build_dir}/config.build
else else
printf " Creating config file... " if [ "$quiet" == "false" ]; then printf " Creating config file for $VENDOR/$MAINBOARD... \n"; fi
grep "if[\t ]*VENDOR" src/mainboard/$VENDOR/$MAINBOARD/../Kconfig | \ grep "if[\t ]*VENDOR" src/mainboard/$VENDOR/$MAINBOARD/../Kconfig | \
sed "s,^.*\(VENDOR_.*\)[^A-Z0-9_]*,CONFIG_\1=y," > ${build_dir}/config.build sed "s,^.*\(VENDOR_.*\)[^A-Z0-9_]*,CONFIG_\1=y," > ${build_dir}/config.build
grep "if[\t ]*BOARD" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \ grep "if[\t ]*BOARD" src/mainboard/$VENDOR/$MAINBOARD/Kconfig | \
@ -176,18 +179,18 @@ function create_config
echo "CONFIG_PAYLOAD_FILE=\"$PAYLOAD\"" >> ${build_dir}/config.build echo "CONFIG_PAYLOAD_FILE=\"$PAYLOAD\"" >> ${build_dir}/config.build
fi fi
printf "($customizing) " if [ "$quiet" == "false" ]; then printf " $VENDOR/$MAINBOARD ($customizing)\n"; fi
printf "$configoptions" >> ${build_dir}/config.build printf "$configoptions" >> ${build_dir}/config.build
fi fi
yes "" 2>/dev/null | $MAKE oldconfig $silent DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log yes "" 2>/dev/null | $MAKE oldconfig $silent DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log
ret=$? ret=$?
if [ $ret -eq 0 ]; then if [ $ret -eq 0 ]; then
printf "ok; " if [ "$quiet" == "false" ]; then printf " $VENDOR/$MAINBOARD config created.\n"; fi
return 0 return 0
else else
# Does this ever happen? # Does this ever happen?
printf "FAILED!\nLog excerpt:\n" if [ "$quiet" == "false" ]; then printf "$VENDOR/$MAINBOARD config creation FAILED!\nLog excerpt:\n"; fi
tail -n $CONTEXT $build_dir/config.log 2> /dev/null || tail -$CONTEXT $build_dir/config.log tail -n $CONTEXT $build_dir/config.log 2> /dev/null || tail -$CONTEXT $build_dir/config.log
return 1 return 1
fi fi
@ -225,7 +228,7 @@ function compile_target
VENDOR=$1 VENDOR=$1
MAINBOARD=$2 MAINBOARD=$2
printf " Compiling image $cpuconfig .. " if [ "$quiet" == "false" ]; then printf " Compiling $VENDOR/$MAINBOARD image$cpuconfig...\n"; fi
CURR=$( pwd ) CURR=$( pwd )
#stime=`perl -e 'print time();' 2>/dev/null || date +%s` #stime=`perl -e 'print time();' 2>/dev/null || date +%s`
@ -245,13 +248,13 @@ function compile_target
junitfile make.log junitfile make.log
junit "</system-out>" junit "</system-out>"
printf "ok\n" > compile.status printf "ok\n" > compile.status
printf "ok. (took ${duration}s)\n" printf "$VENDOR/$MAINBOARD built successfully. (took ${duration}s)\n"
else else
ret=1 ret=1
junit "<failure type='BuildFailed'>" junit "<failure type='BuildFailed'>"
junitfile make.log junitfile make.log
junit "</failure>" junit "</failure>"
printf "FAILED after ${duration}s!\nLog excerpt:\n" printf "$VENDOR/$MAINBOARD build FAILED after ${duration}s!\nLog excerpt:\n"
tail -n $CONTEXT make.log 2> /dev/null || tail -$CONTEXT make.log tail -n $CONTEXT make.log 2> /dev/null || tail -$CONTEXT make.log
failed=1 failed=1
fi fi
@ -276,7 +279,7 @@ function build_target
HOSTCC='gcc' HOSTCC='gcc'
printf "Building $VENDOR/$MAINBOARD; " if [ "$quiet" == "false" ]; then printf "Building $VENDOR/$MAINBOARD\n"; fi
mkdir -p $TARGET/${VENDOR}_${MAINBOARD} $TARGET/abuild mkdir -p $TARGET/${VENDOR}_${MAINBOARD} $TARGET/abuild
ABSPATH=`cd $TARGET/abuild; pwd` ABSPATH=`cd $TARGET/abuild; pwd`
XMLFILE=$ABSPATH/${VENDOR}_${MAINBOARD}.xml XMLFILE=$ABSPATH/${VENDOR}_${MAINBOARD}.xml
@ -311,8 +314,6 @@ function build_target
#duration=$(( $etime - $stime )) #duration=$(( $etime - $stime ))
junit "</testcase>" junit "</testcase>"
printf "\n"
} }
function test_target function test_target
@ -381,6 +382,7 @@ function myhelp
printf "Options:\n" printf "Options:\n"
printf " [-v|--verbose] print more messages\n" printf " [-v|--verbose] print more messages\n"
printf " [-q|--quiet] print fewer messages\n"
printf " [-a|--all] build previously succeeded ports as well\n" printf " [-a|--all] build previously succeeded ports as well\n"
printf " [-r|--remove] remove output dir after build\n" printf " [-r|--remove] remove output dir after build\n"
printf " [-t|--target <vendor/board>] attempt to build target vendor/board only\n" printf " [-t|--target <vendor/board>] attempt to build target vendor/board only\n"
@ -443,11 +445,11 @@ cmdline="$* -c 1"
getoptbrand="`getopt -V`" getoptbrand="`getopt -V`"
if [ "${getoptbrand:0:6}" == "getopt" ]; then if [ "${getoptbrand:0:6}" == "getopt" ]; then
# Detected GNU getopt that supports long options. # Detected GNU getopt that supports long options.
args=`getopt -l version,verbose,help,all,target:,payloads:,test,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,clean,outdir: -o Vvhat:p:Tc:sJCl:rP:uyBLzo: -- "$@"` || exit 1 args=`getopt -l version,verbose,quiet,help,all,target:,payloads:,test,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,clean,outdir: -o Vvqhat:p:Tc:sJCl:rP:uyBLzo: -- "$@"` || exit 1
eval set -- $args eval set -- $args
else else
# Detected non-GNU getopt # Detected non-GNU getopt
args=`getopt Vvhat:bp:Tc:sJxCl:rP:uy $*` args=`getopt Vvqhat:bp:Tc:sJxCl:rP:uy $*`
set -- $args set -- $args
fi fi
@ -466,6 +468,7 @@ while true ; do
-a|--all) shift; buildall=true;; -a|--all) shift; buildall=true;;
-r|--remove) shift; remove=true;; -r|--remove) shift; remove=true;;
-v|--verbose) shift; verbose=true; silent='V=1';; -v|--verbose) shift; verbose=true; silent='V=1';;
-q|--quiet) shift; quiet=true;;
-V|--version) shift; myversion; exit 0;; -V|--version) shift; myversion; exit 0;;
-h|--help) shift; myversion; myhelp; exit 0;; -h|--help) shift; myversion; myhelp; exit 0;;
-p|--payloads) shift; payloads="$1"; shift;; -p|--payloads) shift; payloads="$1"; shift;;
@ -473,9 +476,9 @@ while true ; do
-c|--cpus) shift -c|--cpus) shift
export MAKEFLAGS="-j $1" export MAKEFLAGS="-j $1"
cpus=$1 cpus=$1
test "$MAKEFLAGS" == "-j max" && export MAKEFLAGS="-j" && cpuconfig="in parallel" test "$MAKEFLAGS" == "-j max" && export MAKEFLAGS="-j" && cpuconfig=" in parallel"
test "$1" == "1" && cpuconfig="on 1 cpu" test "$1" == "1" && cpuconfig=" on 1 cpu"
expr "$1" : '-\?[0-9]\+$' > /dev/null && test 0$1 -gt 1 && cpuconfig="on $1 cpus in parallel" expr "$1" : '-\?[0-9]\+$' > /dev/null && test 0$1 -gt 1 && cpuconfig=" on $1 cpus in parallel"
shift;; shift;;
-s|--silent) shift; silent="-s";; -s|--silent) shift; silent="-s";;
--scan-build) shift --scan-build) shift