From 1b7489839561e06d0f64bc1f9b0445725ec59c30 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Mon, 9 Jan 2023 08:00:04 -0700 Subject: util/abuild: Add flags to allow abuild to skip boards This change adds 2 command line parameters, --skip_set and --skip_unset that allows abuild to skip boards with particular Kconfig values either set or not set. Note that it only works on BOOL type variables. This can be set on the abuild command line, or the JENKINS_ABUILD_OPT= variable on the make command line. Signed-off-by: Martin Roth Change-Id: I43336484cf25f83065ec7facf45c123d831024b5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/71730 Tested-by: build bot (Jenkins) Reviewed-by: Fred Reitberger Reviewed-by: Elyes Haouas Reviewed-by: Felix Singer --- util/abuild/abuild | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) (limited to 'util') diff --git a/util/abuild/abuild b/util/abuild/abuild index 6c2f59bee8..d103fce7c3 100755 --- a/util/abuild/abuild +++ b/util/abuild/abuild @@ -11,8 +11,8 @@ #set -x # Turn echo on.... -ABUILD_DATE="Nov 19, 2022" -ABUILD_VERSION="0.11.00" +ABUILD_DATE="Feb 3, 2023" +ABUILD_VERSION="0.11.01" TOP=$PWD @@ -88,6 +88,12 @@ scanbuild=false # Mark whether abuild was called recursively recursive=false +# Skip builds with this Kconfig value set +skipconfig_set="" + +# Skip builds with this Kconfig value notset +skipconfig_unset="" + trap interrupt INT function interrupt @@ -470,6 +476,22 @@ function build_config fi fi + if [ -n "${skipconfig_set}" ]; then + check_config "${build_dir}" "config value" "CONFIG_${skipconfig_set}=y" negate + if [ $? -ne 0 ]; then + echo "${MAINBOARD} has ${skipconfig_set} set. Skipping at user's request." + return + fi + fi + + if [ -n "${skipconfig_unset}" ]; then + check_config "${build_dir}" "config value" "CONFIG_${skipconfig_unset}=y" + if [ $? -ne 0 ]; then + echo "${MAINBOARD} does not have ${skipconfig_unset} set. Skipping at user's request." + return + fi + fi + if [ $BUILDENV_CREATED -ne 0 ] || [ $MAINBOARD_OK -ne 0 ] || [ $VENDOR_OK -ne 0 ] || [ $FORCE_ENABLED_CROS -eq 1 ]; then junit " " @@ -613,6 +635,8 @@ Options:\n [-R|--root ] Absolute path to coreboot sources (defaults to $ROOT) [--scan-build] Use clang's static analyzer + [--skip_set ] Skip building boards with this Kconfig set + [--skip_unset ] Skip building boards with this Kconfig not set [--timeless] Generate timeless builds [-t|--target ] Attempt to build target vendor/board only [-T|--test] Submit image(s) to automated test system @@ -671,7 +695,7 @@ 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:,board-variant:,payloads:,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,any-toolchain,clean,clean-somewhat,outdir:,chromeos,xmlfile:,kconfig:,dir:,root:,recursive,checksum:,timeless,exitcode,asserts,name: -o Vvqhat:b:p:c:sJCl:rP:uyBLAzZo:xX:K:d:R:Ien: -- "$@") || 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,clean-somewhat,outdir:,chromeos,xmlfile:,kconfig:,dir:,root:,recursive,checksum:,timeless,exitcode,asserts,name:,skip_set:,skip_unset: -o Vvqhat:b:p:c:sJCl:rP:uyBLAzZo:xX:K:d:R:Ien: -- "$@") || exit 1 eval set -- $args retval=$? else @@ -725,6 +749,16 @@ while true ; do SCANBUILD_ARGS=${SCANBUILD_ARGS:-'-k'} configoptions="${configoptions}CONFIG_FATAL_ASSERTS=y\n" ;; + --skip_set) shift + skipconfig_set="$1" + customizing="${customizing}, Skipping CONFIG_${skipconfig_set}=Y" + shift + ;; + --skip_unset) shift + skipconfig_unset="$1" + customizing="${customizing}, Skipping CONFIG_${skipconfig_unset} not set" + shift + ;; --asserts) shift configoptions="${configoptions}CONFIG_FATAL_ASSERTS=y\n" ;; @@ -822,6 +856,11 @@ if ! mkdir -p "$TARGET"; then exit 1 fi +if echo "${skipconfig_set}${skipconfig_unset}" | grep -q "CONFIG_" >/dev/null 2>&1; then + echo "Error: Do not include CONFIG_ in the Kconfig value to skip" + exit 1 +fi + customizing=$(echo "$customizing" | cut -c3-) if [ "$customizing" = "" ]; then customizing="default configuration" -- cgit v1.2.3