summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-06-23 01:00:32 -0700
committerFurquan Shaikh <furquan@google.com>2018-06-25 17:41:26 +0000
commit57ccb9c5e859f515aa4f07e6bf81a9f2ae58a988 (patch)
tree88abed8eb340d123f9f5126b010414e55a8b833f /util
parent0be087deee20dee48284e867c378d0ebd1b57940 (diff)
util/abuild: Enable abuild to compile a single variant
There are many boards in coreboot which support multiple variants. When abuild is used to compile a single target, it builds all its variants. If a target has 5 variants, then abuild takes nearly 10x the time to compile all variants of the target. This change adds an option -b/--board-variant to enable abuild to compile only a single variant of the target. TEST=Verified: 1. abuild builds all variants of the target if -b option is not provided. 2. abuild builds a single variant if -b option is provided. 3. abuild prints appropriate error message if invalid variant name is provided. Change-Id: I3781568c6409c5ec2610a8386a21d86037428e7f Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/27215 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/abuild/abuild16
1 files changed, 13 insertions, 3 deletions
diff --git a/util/abuild/abuild b/util/abuild/abuild
index cebb7b735f..85881b3411 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -168,8 +168,11 @@ function normalize_target
{
local targets
+ local VARIANT_UC=$(echo "${variant}" | tr '[:lower:]' '[:upper:]')
+
targets=$(get_mainboards "$1")
if [ -n "$targets" ]; then
+ targets=$(grep "${VARIANT_UC}\$" <<< ${targets})
echo "$targets"
return
fi
@@ -537,6 +540,8 @@ Usage: $0 [options]
Options:\n"
[-a|--all] Build previously succeeded ports as well
[-A|--any-toolchain] Use any toolchain
+ [-b|--board-variant <name>] Build specific board variant under the
+ given target.
[-B|--blobs] Allow using binary files
[--checksum <path/basefile>] Store checksums at path/basefile
[-c|--cpus <numcpus>] Build on <numcpus> at the same time
@@ -613,12 +618,12 @@ getoptbrand="$(getopt -V)"
# shellcheck disable=SC2086
if [ "${getoptbrand:0:6}" == "getopt" ]; then
# Detected GNU getopt that supports long options.
- args=$(getopt -l version,verbose,quiet,help,all,target:,payloads:,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,any-toolchain,clean,outdir:,chromeos,xmlfile:,kconfig:,dir:,root:,recursive,checksum:,timeless,exitcode -o Vvqhat:p:c:sJCl:rP:uyBLAzo:xX:K:d:R:Ie -- "$@") || exit 1
+ args=$(getopt -l version,verbose,quiet,help,all,target:,board-variant:,payloads:,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,any-toolchain,clean,outdir:,chromeos,xmlfile:,kconfig:,dir:,root:,recursive,checksum:,timeless,exitcode -o Vvqhat:b:p:c:sJCl:rP:uyBLAzo:xX:K:d:R:Ie -- "$@") || exit 1
eval set -- $args
retval=$?
else
# Detected non-GNU getopt
- args=$(getopt Vvqhat:p:c:sJCl:rP:uyBLAzo:xX:K:d:R:Ie "$@")
+ args=$(getopt Vvqhat:b:p:c:sJCl:rP:uyBLAzo:xX:K:d:R:Ie "$@")
set -- $args
retval=$?
fi
@@ -639,6 +644,7 @@ while true ; do
case "$1" in
-J|--junit) shift; mode=junit; rm -f "$XMLFILE" ;;
-t|--target) shift; target="$1"; shift;;
+ -b|--board-variant) shift; variant="$1"; shift;;
-a|--all) shift; buildall=true;;
-d|--dir) shift; configdir="$1"; shift;;
-e|--exitcode) shift; exitcode=1;;
@@ -829,7 +835,11 @@ if [ "$target" != "" ]; then
# build a single board
MAINBOARD=$(normalize_target "${target}")
if [ -z "${MAINBOARD}" ]; then
- printf "No such target: %s\n" "$target"
+ printf "No such target: %s" "${target}"
+ if [ -n "${variant}" ]; then
+ printf ", variant: %s" "${variant}"
+ fi
+ printf "\n"
exit 1
fi
build_srcdir="$(mainboard_directory "${MAINBOARD}")"