Rework build configuration dialogs

Remove wheezy and trusty options from release selection menu
This commit is contained in:
zador-blood-stained 2016-12-12 21:45:46 +03:00
parent f0d2425929
commit 89ab53bea5

48
main.sh
View file

@ -94,11 +94,11 @@ fi
prepare_host prepare_host
# if KERNEL_ONLY, BOARD, BRANCH or RELEASE are not set, display selection menu # if KERNEL_ONLY, BOARD, BRANCH or RELEASE are not set, display selection menu
if [[ -z $KERNEL_ONLY ]]; then if [[ -z $KERNEL_ONLY ]]; then
options+=("yes" "Kernel, u-boot and other packages") options+=("yes" "Kernel and u-boot packages")
options+=("no" "Full OS image for writing to SD card") options+=("no" "OS image for installation to SD card")
KERNEL_ONLY=$(dialog --stdout --title "Choose an option" --backtitle "$backtitle" --no-tags --menu "Select what to build" $TTY_Y $TTY_X $(($TTY_Y - 8)) "${options[@]}") KERNEL_ONLY=$(dialog --stdout --title "Choose an option" --backtitle "$backtitle" --no-tags --menu "Select what to build" \
$TTY_Y $TTY_X $(($TTY_Y - 8)) "${options[@]}")
unset options unset options
[[ -z $KERNEL_ONLY ]] && exit_with_error "No option selected" [[ -z $KERNEL_ONLY ]] && exit_with_error "No option selected"
fi fi
@ -108,7 +108,8 @@ if [[ -z $BOARD ]]; then
for board in $SRC/lib/config/boards/*.conf; do for board in $SRC/lib/config/boards/*.conf; do
options+=("$(basename $board | cut -d'.' -f1)" "$(head -1 $board | cut -d'#' -f2)") options+=("$(basename $board | cut -d'.' -f1)" "$(head -1 $board | cut -d'#' -f2)")
done done
BOARD=$(dialog --stdout --title "Choose a board" --backtitle "$backtitle" --scrollbar --menu "Select one of supported boards" $TTY_Y $TTY_X $(($TTY_Y - 8)) "${options[@]}") BOARD=$(dialog --stdout --title "Choose a board" --backtitle "$backtitle" --scrollbar --menu "Select the target board" \
$TTY_Y $TTY_X $(($TTY_Y - 8)) "${options[@]}")
unset options unset options
[[ -z $BOARD ]] && exit_with_error "No board selected" [[ -z $BOARD ]] && exit_with_error "No board selected"
fi fi
@ -119,14 +120,16 @@ source $SRC/lib/config/boards/$BOARD.conf
if [[ -z $BRANCH ]]; then if [[ -z $BRANCH ]]; then
options=() options=()
[[ $KERNEL_TARGET == *default* ]] && options+=("default" "3.4.x - 3.14.x legacy") [[ $KERNEL_TARGET == *default* ]] && options+=("default" "Vendor provided / legacy (3.4.x - 4.4.x)")
[[ $KERNEL_TARGET == *next* ]] && options+=("next" "Latest stable @kernel.org") [[ $KERNEL_TARGET == *next* ]] && options+=("next" "Mainline (@kernel.org) (4.x)")
[[ $KERNEL_TARGET == *dev* ]] && options+=("dev" "Latest dev @kernel.org") [[ $KERNEL_TARGET == *dev* ]] && options+=("dev" "Development version (4.x)")
# do not display selection dialog if only one kernel branch is available # do not display selection dialog if only one kernel branch is available
if [[ "${#options[@]}" == 2 ]]; then if [[ "${#options[@]}" == 2 ]]; then
BRANCH="${options[0]}" BRANCH="${options[0]}"
else else
BRANCH=$(dialog --stdout --title "Choose a kernel" --backtitle "$backtitle" --menu "Select one of supported kernels" $TTY_Y $TTY_X $(($TTY_Y - 8)) "${options[@]}") BRANCH=$(dialog --stdout --title "Choose a kernel" --backtitle "$backtitle" \
--menu "Select the target kernel branch\nExact kernel versions depend on selected board" \
$TTY_Y $TTY_X $(($TTY_Y - 8)) "${options[@]}")
fi fi
unset options unset options
[[ -z $BRANCH ]] && exit_with_error "No kernel branch selected" [[ -z $BRANCH ]] && exit_with_error "No kernel branch selected"
@ -134,30 +137,32 @@ else
[[ $KERNEL_TARGET != *$BRANCH* ]] && exit_with_error "Kernel branch not defined for this board" "$BRANCH" [[ $KERNEL_TARGET != *$BRANCH* ]] && exit_with_error "Kernel branch not defined for this board" "$BRANCH"
fi fi
# wheezy and trusty targets are obsolete, but still accessible via command line arguments
# or custom configuration files
if [[ $KERNEL_ONLY != yes && -z $RELEASE ]]; then if [[ $KERNEL_ONLY != yes && -z $RELEASE ]]; then
options=() options=()
options+=("wheezy" "Debian 7 Wheezy (oldstable)") #options+=("wheezy" "Debian 7 Wheezy")
options+=("jessie" "Debian 8 Jessie (stable)") options+=("jessie" "Debian 8 Jessie")
options+=("trusty" "Ubuntu Trusty 14.04.x LTS") #options+=("trusty" "Ubuntu Trusty 14.04 LTS")
options+=("xenial" "Ubuntu Xenial 16.04.x LTS") options+=("xenial" "Ubuntu Xenial 16.04 LTS")
RELEASE=$(dialog --stdout --title "Choose a release" --backtitle "$backtitle" --menu "Select one of the supported releases" $TTY_Y $TTY_X $(($TTY_Y - 8)) "${options[@]}") RELEASE=$(dialog --stdout --title "Choose a release" --backtitle "$backtitle" --menu "Select the target OS release" \
$TTY_Y $TTY_X $(($TTY_Y - 8)) "${options[@]}")
unset options unset options
[[ -z $RELEASE ]] && exit_with_error "No release selected" [[ -z $RELEASE ]] && exit_with_error "No release selected"
fi fi
if [[ $KERNEL_ONLY != yes && -z $BUILD_DESKTOP && "jessie xenial" == *$RELEASE* ]]; then if [[ $KERNEL_ONLY != yes && -z $BUILD_DESKTOP && "jessie xenial" == *$RELEASE* ]]; then
options=() options=()
options+=("no" "Image with console interface") options+=("no" "Image with console interface (server)")
options+=("yes" "Image with desktop environment") options+=("yes" "Image with desktop environment")
BUILD_DESKTOP=$(dialog --stdout --title "Choose image type" --backtitle "$backtitle" --no-tags --menu "Select image type" $TTY_Y $TTY_X $(($TTY_Y - 8)) "${options[@]}") BUILD_DESKTOP=$(dialog --stdout --title "Choose image type" --backtitle "$backtitle" --no-tags --menu "Select the target image type" \
$TTY_Y $TTY_X $(($TTY_Y - 8)) "${options[@]}")
unset options unset options
[[ -z $BUILD_DESKTOP ]] && exit_with_error "No option selected" [[ -z $BUILD_DESKTOP ]] && exit_with_error "No option selected"
fi fi
source $SRC/lib/configuration.sh source $SRC/lib/configuration.sh
display_alert "Starting Armbian build script" "@host" "info"
# sync clock # sync clock
if [[ $SYNC_CLOCK != no ]]; then if [[ $SYNC_CLOCK != no ]]; then
display_alert "Syncing clock" "host" "info" display_alert "Syncing clock" "host" "info"
@ -165,11 +170,10 @@ if [[ $SYNC_CLOCK != no ]]; then
fi fi
start=`date +%s` start=`date +%s`
# fetch_from_repo <url> <dir> <ref> <subdir_flag>
[[ $CLEAN_LEVEL == *sources* ]] && cleaning "sources" [[ $CLEAN_LEVEL == *sources* ]] && cleaning "sources"
# ignore updates help on building all images - for internal purposes # ignore updates help on building all images - for internal purposes
# fetch_from_repo <url> <dir> <ref> <subdir_flag>
if [[ $IGNORE_UPDATES != yes ]]; then if [[ $IGNORE_UPDATES != yes ]]; then
display_alert "Downloading sources" "" "info" display_alert "Downloading sources" "" "info"
fetch_from_repo "$BOOTSOURCE" "$BOOTDIR" "$BOOTBRANCH" "yes" fetch_from_repo "$BOOTSOURCE" "$BOOTDIR" "$BOOTBRANCH" "yes"
@ -214,9 +218,11 @@ overlayfs_wrapper "cleanup"
VER=$(dpkg --info $DEST/debs/${CHOSEN_KERNEL}_${REVISION}_${ARCH}.deb | grep Descr | awk '{print $(NF)}') VER=$(dpkg --info $DEST/debs/${CHOSEN_KERNEL}_${REVISION}_${ARCH}.deb | grep Descr | awk '{print $(NF)}')
VER="${VER/-$LINUXFAMILY/}" VER="${VER/-$LINUXFAMILY/}"
# create board support package
# TODO: check and remove last part of the condition (! -d)
[[ -n $RELEASE && ! -f $DEST/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}.deb && ! -d $DEST/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH} ]] && create_board_package [[ -n $RELEASE && ! -f $DEST/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}.deb && ! -d $DEST/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH} ]] && create_board_package
# chroot-buildpackages # build additional packages
[[ $EXTERNAL_NEW == compile ]] && chroot_build_packages [[ $EXTERNAL_NEW == compile ]] && chroot_build_packages
if [[ $KERNEL_ONLY != yes ]]; then if [[ $KERNEL_ONLY != yes ]]; then