From a872fe877356b62e7d859d8674d8dd9bb4c697a8 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Sun, 7 May 2023 15:52:10 +0200 Subject: [PATCH] config-prepare: `config_pre_main()`: try to be more helpful when BRANCH is unset or wrong instead of just "bad KERNEL_MAJOR_MINOR" --- lib/functions/main/config-prepare.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/functions/main/config-prepare.sh b/lib/functions/main/config-prepare.sh index 467bd6e1e6..85c44ca328 100644 --- a/lib/functions/main/config-prepare.sh +++ b/lib/functions/main/config-prepare.sh @@ -214,7 +214,17 @@ function config_post_main() { if [[ "${skip_kernel:-"no"}" != "yes" ]]; then if [[ -n "${KERNELSOURCE}" ]]; then if [[ "x${KERNEL_MAJOR_MINOR}x" == "xx" ]]; then - exit_with_error "BAD config, missing" "KERNEL_MAJOR_MINOR" "err" + display_alert "Problem: after configuration, there's not enough kernel info" "Might happen if you used the wrong BRANCH. Make sure 'BRANCH=${BRANCH}' is valid." "err" + # if we have KERNEL_TARGET set. + if [[ -n "${KERNEL_TARGET}" ]]; then + # Split KERNEL_TARGET by commas, and display each one. + declare -a KERNEL_TARGET_ARRAY=() + IFS=',' read -ra KERNEL_TARGET_ARRAY <<< "${KERNEL_TARGET}" + for i in "${KERNEL_TARGET_ARRAY[@]}"; do + display_alert "Valid branches for current board" "BOARD=${BOARD} BRANCH=${i}" "info" + done + fi + exit_with_error "BAD config, missing" "KERNEL_MAJOR_MINOR; check BOARD and BRANCH combination" "err" fi # assume the worst, and all surprises will be happy ones declare -g KERNEL_HAS_WORKING_HEADERS="no"