diff --git a/config/sources/common.conf b/config/sources/common.conf index b6d2f386de..4b4194dda4 100644 --- a/config/sources/common.conf +++ b/config/sources/common.conf @@ -55,6 +55,11 @@ function late_family_config__common_defaults_for_mainline_kernel() { # KERNEL_MAJOR_MINOR is the key to all this stuff. It must be set. if [[ -z ${KERNEL_MAJOR_MINOR} ]]; then display_alert "KERNEL_MAJOR_MINOR is unset" "common_defaults_for_mainline" "warn" + + # Done late (here) to allow family to set it first, so we don't have to add KERNEL_TARGET to all boards for experimental kernels. + if [[ "${BRANCH_VALID_FOR_BOARD}" == "no" ]]; then # Set in config-interactive by comparing KERNEL_TARGETS + exit_with_error "Invalid BRANCH='${BRANCH}' for BOARD='${BOARD}'; please select a valid branch for this board, eg one of '${KERNEL_TARGET}'" + fi ((problems++)) fi diff --git a/lib/functions/main/config-interactive.sh b/lib/functions/main/config-interactive.sh index 131dae5d94..37a1cd4db1 100644 --- a/lib/functions/main/config-interactive.sh +++ b/lib/functions/main/config-interactive.sh @@ -22,7 +22,13 @@ function config_possibly_interactive_kernel_board() { function config_possibly_interactive_branch_release_desktop_minimal() { interactive_config_ask_branch [[ -z $BRANCH ]] && exit_with_error "No kernel branch selected: BRANCH" - [[ ${KERNEL_TARGET} != *${BRANCH}* && ${BRANCH} != "ddk" ]] && exit_with_error "Kernel branch not defined for this board: '${BRANCH}' for '${BOARD}'" + + # Check for BRANCH validity, warn but don't break the build if invalid; mark it as invalid for later checks -- if really no valid config, common.conf will exit with error later. + declare -g BRANCH_VALID_FOR_BOARD='yes' + if [[ ${KERNEL_TARGET} != *${BRANCH}* && ${BRANCH} != "ddk" ]]; then + display_alert "BRANCH not found for board" "BRANCH='${BRANCH}' not valid for BOARD='${BOARD}' - listed KERNEL_TARGET='${KERNEL_TARGET}'" "warn" + declare -g BRANCH_VALID_FOR_BOARD='no' + fi interactive_config_ask_release # If building image or rootfs (and thus "NEEDS_BINFMT=yes"), then RELEASE must be set.