armbian-next: a few fixes (shortcircuits...) and enhancements for the GUI building; thanks NicoD
This commit is contained in:
parent
b606ae9715
commit
b4da0c869c
@ -103,10 +103,15 @@ function interactive_config_ask_board_list() {
|
|||||||
# if BOARD is not set, display selection menu, otherwise return success
|
# if BOARD is not set, display selection menu, otherwise return success
|
||||||
[[ -n ${BOARD} ]] && return 0
|
[[ -n ${BOARD} ]] && return 0
|
||||||
|
|
||||||
WIP_STATE=supported
|
declare WIP_STATE=supported
|
||||||
WIP_BUTTON='CSC/WIP/EOS/TVB'
|
if [[ "${EXPERT}" == "yes" ]]; then
|
||||||
STATE_DESCRIPTION=' - boards with high level of software maturity'
|
display_alert "Expert mode!" "You can select all boards" "info"
|
||||||
temp_rc=$(mktemp) # @TODO: this is a _very_ early call to mktemp - no TMPDIR set yet - it needs to be cleaned-up somehow
|
WIP_STATE=unsupported
|
||||||
|
fi
|
||||||
|
|
||||||
|
declare WIP_BUTTON='CSC/WIP/EOS/TVB'
|
||||||
|
declare STATE_DESCRIPTION=' - boards with high level of software maturity'
|
||||||
|
declare temp_rc=$(mktemp) # @TODO: this is a _very_ early call to mktemp - no TMPDIR set yet - it needs to be cleaned-up somehow
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
declare -a arr_all_board_names=() arr_all_board_options=() # arrays
|
declare -a arr_all_board_names=() arr_all_board_options=() # arrays
|
||||||
@ -129,7 +134,7 @@ function interactive_config_ask_board_list() {
|
|||||||
--colors --extra-label "Show $WIP_BUTTON" --extra-button \
|
--colors --extra-label "Show $WIP_BUTTON" --extra-button \
|
||||||
--menu "Select the target board. Displaying:\n$STATE_DESCRIPTION" $TTY_Y $TTY_X $((TTY_Y - 8)) "${arr_all_board_options[@]}"
|
--menu "Select the target board. Displaying:\n$STATE_DESCRIPTION" $TTY_Y $TTY_X $((TTY_Y - 8)) "${arr_all_board_options[@]}"
|
||||||
BOARD="${DIALOG_RESULT}"
|
BOARD="${DIALOG_RESULT}"
|
||||||
STATUS=${DIALOG_EXIT_CODE}
|
declare STATUS=${DIALOG_EXIT_CODE}
|
||||||
|
|
||||||
if [[ $STATUS == 3 ]]; then
|
if [[ $STATUS == 3 ]]; then
|
||||||
if [[ $WIP_STATE == supported ]]; then
|
if [[ $WIP_STATE == supported ]]; then
|
||||||
@ -156,21 +161,21 @@ function interactive_config_ask_board_list() {
|
|||||||
|
|
||||||
function interactive_config_ask_branch() {
|
function interactive_config_ask_branch() {
|
||||||
# if BRANCH not set, display selection menu
|
# if BRANCH not set, display selection menu
|
||||||
[[ -n $BRANCH ]] && return 0
|
if [[ -n $BRANCH ]]; then
|
||||||
|
display_alert "Already set BRANCH, skipping interactive" "${BRANCH}" "info"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
declare -a options=()
|
declare -a options=()
|
||||||
[[ $KERNEL_TARGET == *current* ]] && options+=("current" "Recommended. Usually an LTS kernel")
|
[[ $KERNEL_TARGET == *current* ]] && options+=("current" "Recommended. Usually an LTS kernel")
|
||||||
[[ $KERNEL_TARGET == *legacy* ]] && options+=("legacy" "Old stable / Legacy / Vendor kernel")
|
[[ $KERNEL_TARGET == *legacy* ]] && options+=("legacy" "Old stable / Legacy / Vendor kernel")
|
||||||
[[ $KERNEL_TARGET == *edge* ]] && options+=("edge" "Bleeding edge / latest possible")
|
[[ $KERNEL_TARGET == *edge* ]] && options+=("edge" "Bleeding edge / latest possible")
|
||||||
|
|
||||||
# do not display selection dialog if only one kernel branch is available
|
dialog_if_terminal_set_vars --title "Choose a kernel" --backtitle "$backtitle" --colors \
|
||||||
if [[ "${#options[@]}" == 2 ]]; then
|
--menu "Select the target kernel branch.\nSelected BOARD='${BOARD}'\nExact kernel versions depend on selected board and its family." \
|
||||||
BRANCH="${options[0]}"
|
$TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}"
|
||||||
else
|
|
||||||
dialog_if_terminal_set_vars --title "Choose a kernel" --backtitle "$backtitle" --colors \
|
BRANCH="${DIALOG_RESULT}"
|
||||||
--menu "Select the target kernel branch\nExact kernel versions depend on selected board and its family." \
|
|
||||||
$TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}"
|
|
||||||
BRANCH="${DIALOG_RESULT}"
|
|
||||||
fi
|
|
||||||
[[ -z ${BRANCH} ]] && exit_with_error "No kernel branch selected"
|
[[ -z ${BRANCH} ]] && exit_with_error "No kernel branch selected"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -181,9 +186,11 @@ function interactive_config_ask_release() {
|
|||||||
|
|
||||||
declare -a options=()
|
declare -a options=()
|
||||||
distros_options
|
distros_options
|
||||||
dialog_if_terminal_set_vars --title "Choose a release package base" --backtitle "$backtitle" --menu "Select the target OS release package base" $TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}"
|
dialog_if_terminal_set_vars --title "Choose a release package base" --backtitle "$backtitle" --menu "Select the target OS release package base; selected BRANCH='${BRANCH}'" $TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}"
|
||||||
RELEASE="${DIALOG_RESULT}"
|
RELEASE="${DIALOG_RESULT}"
|
||||||
[[ -z ${RELEASE} ]] && exit_with_error "No release selected"
|
[[ -z ${RELEASE} ]] && exit_with_error "No release selected"
|
||||||
|
|
||||||
|
return 0 # shortcircuit above!
|
||||||
}
|
}
|
||||||
|
|
||||||
function interactive_config_ask_desktop_build() {
|
function interactive_config_ask_desktop_build() {
|
||||||
@ -227,4 +234,5 @@ function interactive_config_ask_standard_or_minimal() {
|
|||||||
else
|
else
|
||||||
SELECTED_CONFIGURATION="cli_standard"
|
SELECTED_CONFIGURATION="cli_standard"
|
||||||
fi
|
fi
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,6 +33,9 @@ function dialog_if_terminal_set_vars() {
|
|||||||
set -e # back to normal
|
set -e # back to normal
|
||||||
set -o errtrace # back to normal
|
set -o errtrace # back to normal
|
||||||
set -o errexit # back to normal
|
set -o errexit # back to normal
|
||||||
|
|
||||||
|
# clear the screen after dialog exits; that way we can see the log output that comes after it?
|
||||||
|
clear
|
||||||
|
|
||||||
return 0 # always success, caller must check DIALOG_EXIT_CODE and DIALOG_RESULT
|
return 0 # always success, caller must check DIALOG_EXIT_CODE and DIALOG_RESULT
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,7 @@ function prepare_and_config_main_build_single() {
|
|||||||
|
|
||||||
interactive_config_ask_branch
|
interactive_config_ask_branch
|
||||||
[[ -z $BRANCH ]] && exit_with_error "No kernel branch selected: BRANCH"
|
[[ -z $BRANCH ]] && exit_with_error "No kernel branch selected: BRANCH"
|
||||||
[[ ${KERNEL_TARGET} != *${BRANCH}* && ${BRANCH} != "ddk" ]] && display_alert "Kernel branch not defined for this board" "${BRANCH} for ${BOARD}" "warn"
|
[[ ${KERNEL_TARGET} != *${BRANCH}* && ${BRANCH} != "ddk" ]] && exit_with_error "Kernel branch not defined for this board: '${BRANCH}' for '${BOARD}'"
|
||||||
|
|
||||||
interactive_config_ask_release
|
interactive_config_ask_release
|
||||||
[[ -z $RELEASE && ${KERNEL_ONLY} != yes ]] && exit_with_error "No release selected: RELEASE"
|
[[ -z $RELEASE && ${KERNEL_ONLY} != yes ]] && exit_with_error "No release selected: RELEASE"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user