summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2021-02-10 19:49:15 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-02-11 20:49:27 +0000
commitfe5cf512587244558565685904b21be3b859e55a (patch)
treec191efcdf8bd84e14d75e3c338851b527eb286ff /util
parent373769f1030fd4f5f350229c5bfd177945caae98 (diff)
util/abuild: Ensure that non-Chrome OS builds are non-Chrome OS
Sometimes boards enable it by default, making the Kconfig option impossible to disable without messing with the Kconfig files. This shouldn't happen, so report on such occurrences early. TEST=Tried building GOOGLE_KOHAKU through abuild with -x, without -x and both cases after having added a "select CHROMEOS" for testing and it failed in the "without -x with select" scenario while properly configuring and passing all other builds. Change-Id: Ieb6bcbf3e9ca8cd4ced85c7c9ffaa39505f5a9b7 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/50494 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'util')
-rwxr-xr-xutil/abuild/abuild29
1 files changed, 24 insertions, 5 deletions
diff --git a/util/abuild/abuild b/util/abuild/abuild
index 408de12e7a..0b7b05c551 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -330,14 +330,23 @@ function check_config
local BUILD_DIR="$1"
local TEST_TYPE="$2"
local TEST_STRING="$3"
+ local NEGATE="$4"
local CONFIG_FILE="$BUILD_DIR/config.build"
local CONFIG_LOG="$BUILD_DIR/config.log"
- if ! grep -q "$TEST_STRING" "$CONFIG_FILE"; then
- echo "config file: $CONFIG_FILE has incorrect $TEST_TYPE"
- echo "Error: Expected '$TEST_STRING' in config file." >> "$CONFIG_LOG"
- return 1
+ if [ -z "$NEGATE" ]; then
+ if ! grep -q "$TEST_STRING" "$CONFIG_FILE"; then
+ echo "config file: $CONFIG_FILE has incorrect $TEST_TYPE"
+ echo "Error: Expected '$TEST_STRING' in config file." >> "$CONFIG_LOG"
+ return 1
+ fi
+ else
+ if grep -q "$TEST_STRING" "$CONFIG_FILE"; then
+ echo "config file: $CONFIG_FILE has incorrect $TEST_TYPE"
+ echo "Error: Expected not to see '$TEST_STRING' in config file." >> "$CONFIG_LOG"
+ return 1
+ fi
fi
return 0
@@ -443,7 +452,17 @@ function build_config
check_config "$build_dir" "vendor" "CONFIG_VENDOR_$(mainboard_vendor "${MAINBOARD}")=y"
local VENDOR_OK=$?
- if [ $BUILDENV_CREATED -ne 0 ] || [ $MAINBOARD_OK -ne 0 ] || [ $VENDOR_OK -ne 0 ]; then
+ if [ "$chromeos" = false ]; then
+ # Skip this rule for configs created from templates that already
+ # come with CHROMEOS enabled.
+ grep -q "^CONFIG_CHROMEOS=y" ${config_file:-/dev/null} || \
+ check_config "$build_dir" "Chrome OS" "CONFIG_CHROMEOS=y" negate
+ local FORCE_ENABLED_CROS=$?
+ else
+ local FORCE_ENABLED_CROS=0
+ fi
+
+ if [ $BUILDENV_CREATED -ne 0 ] || [ $MAINBOARD_OK -ne 0 ] || [ $VENDOR_OK -ne 0 ] || [ $FORCE_ENABLED_CROS -eq 1 ]; then
junit " <testcase classname='board${testclass/#/.}' name='$BUILD_NAME' >"
junit "<failure type='BuildFailed'>"