summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Roth <martin.roth@se-eng.com>2014-12-08 01:57:52 -0700
committerMartin Roth <gaumless@gmail.com>2014-12-10 00:17:31 +0100
commitddb7a9d4a1e41132f43841d7378d38f2d8dc4175 (patch)
tree63a4358e0e7b050a626c91b6d35ad531cae971ee
parentec9293fb5af2c0f798a8ee6e5fead819487f1587 (diff)
downloadcoreboot-ddb7a9d4a1e41132f43841d7378d38f2d8dc4175.tar.xz
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>
-rwxr-xr-xutil/abuild/abuild35
1 files changed, 19 insertions, 16 deletions
diff --git a/util/abuild/abuild b/util/abuild/abuild
index a6b96c059a..682da96d98 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -6,7 +6,7 @@
#
# (C) 2004 by Stefan Reinauer <stepan@openbios.org>
# (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>
#
# 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
silent=
+# quiet mode: only print pass, failure, and 'skipped' messages
+quiet=false
+
# clang mode enabled by -sb option.
scanbuild=false
@@ -159,7 +162,7 @@ function create_config
printf " Using existing configuration $CONFIG ... "
cp src/mainboard/$VENDOR/$MAINBOARD/$CONFIG ${build_dir}/config.build
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 | \
sed "s,^.*\(VENDOR_.*\)[^A-Z0-9_]*,CONFIG_\1=y," > ${build_dir}/config.build
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
fi
- printf "($customizing) "
+ if [ "$quiet" == "false" ]; then printf " $VENDOR/$MAINBOARD ($customizing)\n"; fi
printf "$configoptions" >> ${build_dir}/config.build
fi
yes "" 2>/dev/null | $MAKE oldconfig $silent DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log
ret=$?
if [ $ret -eq 0 ]; then
- printf "ok; "
+ if [ "$quiet" == "false" ]; then printf " $VENDOR/$MAINBOARD config created.\n"; fi
return 0
else
# 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
return 1
fi
@@ -225,7 +228,7 @@ function compile_target
VENDOR=$1
MAINBOARD=$2
- printf " Compiling image $cpuconfig .. "
+ if [ "$quiet" == "false" ]; then printf " Compiling $VENDOR/$MAINBOARD image$cpuconfig...\n"; fi
CURR=$( pwd )
#stime=`perl -e 'print time();' 2>/dev/null || date +%s`
@@ -245,13 +248,13 @@ function compile_target
junitfile make.log
junit "</system-out>"
printf "ok\n" > compile.status
- printf "ok. (took ${duration}s)\n"
+ printf "$VENDOR/$MAINBOARD built successfully. (took ${duration}s)\n"
else
ret=1
junit "<failure type='BuildFailed'>"
junitfile make.log
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
failed=1
fi
@@ -276,7 +279,7 @@ function build_target
HOSTCC='gcc'
- printf "Building $VENDOR/$MAINBOARD; "
+ if [ "$quiet" == "false" ]; then printf "Building $VENDOR/$MAINBOARD\n"; fi
mkdir -p $TARGET/${VENDOR}_${MAINBOARD} $TARGET/abuild
ABSPATH=`cd $TARGET/abuild; pwd`
XMLFILE=$ABSPATH/${VENDOR}_${MAINBOARD}.xml
@@ -311,8 +314,6 @@ function build_target
#duration=$(( $etime - $stime ))
junit "</testcase>"
-
- printf "\n"
}
function test_target
@@ -381,6 +382,7 @@ function myhelp
printf "Options:\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 " [-r|--remove] remove output dir after build\n"
printf " [-t|--target <vendor/board>] attempt to build target vendor/board only\n"
@@ -443,11 +445,11 @@ cmdline="$* -c 1"
getoptbrand="`getopt -V`"
if [ "${getoptbrand:0:6}" == "getopt" ]; then
# 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
else
# Detected non-GNU getopt
- args=`getopt Vvhat:bp:Tc:sJxCl:rP:uy $*`
+ args=`getopt Vvqhat:bp:Tc:sJxCl:rP:uy $*`
set -- $args
fi
@@ -466,6 +468,7 @@ while true ; do
-a|--all) shift; buildall=true;;
-r|--remove) shift; remove=true;;
-v|--verbose) shift; verbose=true; silent='V=1';;
+ -q|--quiet) shift; quiet=true;;
-V|--version) shift; myversion; exit 0;;
-h|--help) shift; myversion; myhelp; exit 0;;
-p|--payloads) shift; payloads="$1"; shift;;
@@ -473,9 +476,9 @@ while true ; do
-c|--cpus) shift
export MAKEFLAGS="-j $1"
cpus=$1
- test "$MAKEFLAGS" == "-j max" && export MAKEFLAGS="-j" && cpuconfig="in parallel"
- test "$1" == "1" && cpuconfig="on 1 cpu"
- expr "$1" : '-\?[0-9]\+$' > /dev/null && test 0$1 -gt 1 && cpuconfig="on $1 cpus in parallel"
+ test "$MAKEFLAGS" == "-j max" && export MAKEFLAGS="-j" && cpuconfig=" in parallel"
+ test "$1" == "1" && cpuconfig=" on 1 cpu"
+ expr "$1" : '-\?[0-9]\+$' > /dev/null && test 0$1 -gt 1 && cpuconfig=" on $1 cpus in parallel"
shift;;
-s|--silent) shift; silent="-s";;
--scan-build) shift