diff --git a/main.sh b/main.sh index 0b933fe91..46570a259 100644 --- a/main.sh +++ b/main.sh @@ -94,11 +94,11 @@ fi prepare_host # if KERNEL_ONLY, BOARD, BRANCH or RELEASE are not set, display selection menu - if [[ -z $KERNEL_ONLY ]]; then - options+=("yes" "Kernel, u-boot and other packages") - options+=("no" "Full OS image for writing 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[@]}") + options+=("yes" "Kernel and u-boot packages") + 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[@]}") unset options [[ -z $KERNEL_ONLY ]] && exit_with_error "No option selected" fi @@ -108,7 +108,8 @@ if [[ -z $BOARD ]]; then for board in $SRC/lib/config/boards/*.conf; do options+=("$(basename $board | cut -d'.' -f1)" "$(head -1 $board | cut -d'#' -f2)") 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 [[ -z $BOARD ]] && exit_with_error "No board selected" fi @@ -119,14 +120,16 @@ source $SRC/lib/config/boards/$BOARD.conf if [[ -z $BRANCH ]]; then options=() - [[ $KERNEL_TARGET == *default* ]] && options+=("default" "3.4.x - 3.14.x legacy") - [[ $KERNEL_TARGET == *next* ]] && options+=("next" "Latest stable @kernel.org") - [[ $KERNEL_TARGET == *dev* ]] && options+=("dev" "Latest dev @kernel.org") + [[ $KERNEL_TARGET == *default* ]] && options+=("default" "Vendor provided / legacy (3.4.x - 4.4.x)") + [[ $KERNEL_TARGET == *next* ]] && options+=("next" "Mainline (@kernel.org) (4.x)") + [[ $KERNEL_TARGET == *dev* ]] && options+=("dev" "Development version (4.x)") # do not display selection dialog if only one kernel branch is available if [[ "${#options[@]}" == 2 ]]; then BRANCH="${options[0]}" 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 unset options [[ -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" 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 options=() - options+=("wheezy" "Debian 7 Wheezy (oldstable)") - options+=("jessie" "Debian 8 Jessie (stable)") - options+=("trusty" "Ubuntu Trusty 14.04.x LTS") - options+=("xenial" "Ubuntu Xenial 16.04.x 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[@]}") + #options+=("wheezy" "Debian 7 Wheezy") + options+=("jessie" "Debian 8 Jessie") + #options+=("trusty" "Ubuntu Trusty 14.04 LTS") + options+=("xenial" "Ubuntu Xenial 16.04 LTS") + 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 [[ -z $RELEASE ]] && exit_with_error "No release selected" fi if [[ $KERNEL_ONLY != yes && -z $BUILD_DESKTOP && "jessie xenial" == *$RELEASE* ]]; then options=() - options+=("no" "Image with console interface") + options+=("no" "Image with console interface (server)") 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 [[ -z $BUILD_DESKTOP ]] && exit_with_error "No option selected" fi source $SRC/lib/configuration.sh -display_alert "Starting Armbian build script" "@host" "info" - # sync clock if [[ $SYNC_CLOCK != no ]]; then display_alert "Syncing clock" "host" "info" @@ -165,11 +170,10 @@ if [[ $SYNC_CLOCK != no ]]; then fi start=`date +%s` -# fetch_from_repo - [[ $CLEAN_LEVEL == *sources* ]] && cleaning "sources" # ignore updates help on building all images - for internal purposes +# fetch_from_repo if [[ $IGNORE_UPDATES != yes ]]; then display_alert "Downloading sources" "" "info" 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="${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 -# chroot-buildpackages +# build additional packages [[ $EXTERNAL_NEW == compile ]] && chroot_build_packages if [[ $KERNEL_ONLY != yes ]]; then