From 768dbcc2f2a1c5f66984d2f2dec02419b5488744 Mon Sep 17 00:00:00 2001 From: "J. Avila" Date: Fri, 23 Apr 2021 19:59:25 +0000 Subject: [PATCH] build_slider: Don't allow BUILD_KERNEL=0 and GKI_DEFCONFIG_FRAGMENT The prebuilts do not have any GKI_DEFCONFIG_FRAGMENT; allowing this combination of flags would result in an invalid build. This, however, is possible if the user explicitly sets BUILD_KERNEL=0. Throw an error if this is attempted. Bug: 184667897 Signed-off-by: J. Avila Change-Id: Ic7c000b60559318a17ad07dd00f2a37c77060f4c --- build_slider.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/build_slider.sh b/build_slider.sh index fcbcea46c10d..b6131dba4eab 100755 --- a/build_slider.sh +++ b/build_slider.sh @@ -82,15 +82,18 @@ if [ -n "${BUILD_CONFIG}" ]; then exit_if_error 1 "BUILD_CONFIG is not supported for $0" fi -if [ "${BUILD_KERNEL}" = "0" -a "${EXPERIMENTAL_BUILD}" != "0" ]; then - exit_if_error 1 "BUILD_KERNEL=0 is incompatible with EXPERIMENTAL_BUILD" -fi - -if [ "${LTO}" = "none" -a "${BUILD_KERNEL}" = "0" ]; then - exit_if_error 1 "LTO=none requires BUILD_KERNEL=1 or EXPERIMENTAL_BUILD=1" +if [ "${BUILD_KERNEL}" = "0" ]; then + if [ "${EXPERIMENTAL_BUILD}" != "0" -o -n "${GKI_DEFCONFIG_FRAGMENT}" ]; then + echo "BUILD_KERNEL=0 is incompatible with EXPERIMENTAL_BUILD=1 and" + echo " GKI_DEFCONFIG_FRAGMENT." + exit_if_error 1 "Flags incompatible with BUILD_KERNEL=0 detected" + elif [ "${LTO}" = "none" ]; then + echo "LTO=none requires BUILD_KERNEL=1, EXPERIMENTAL_BUILD=1, or" + echo " GKI_DEFCONFIG_FRAGMENT to be set." + exit_if_error 1 "LTO=none requires building the kernel" + fi fi - if [ "${EXPERIMENTAL_BUILD}" = "0" -a "${BUILD_KERNEL}" != "0" ]; then pushd aosp/ > /dev/null # Booting AOSP ToT does not always work; throw a warning to prevent this.