diff --git a/configuration.sh b/configuration.sh index 4150a41e29..f632d30326 100644 --- a/configuration.sh +++ b/configuration.sh @@ -28,26 +28,22 @@ # common options REVISION="5.07" # all boards have same revision -ARCH="armhf" -CROSS_COMPILE="$CCACHE arm-linux-gnueabihf-" -TARGETS="zImage" ROOTPWD="1234" # Must be changed @first login MAINTAINER="Igor Pecovnik" # deb signature MAINTAINERMAIL="igor.pecovnik@****l.com" # deb signature SDSIZE="4000" # SD image size in MB TZDATA=`cat /etc/timezone` # Timezone for target is taken from host or defined here. USEALLCORES="yes" # Use all CPU cores for compiling -OFFSET="1" # Bootloader space in MB (1 x 2048 = default) -BOOTSIZE=${BOOTSIZE-0} # Mb size of boot partition EXIT_PATCHING_ERROR="" # exit patching if failed -SERIALCON="ttyS0" MISC1="https://github.com/linux-sunxi/sunxi-tools.git" # Allwinner fex compiler / decompiler MISC1_DIR="sunxi-tools" # local directory MISC5="https://github.com/hglm/a10disp/" # Display changer for Allwinner MISC5_DIR="sunxi-display-changer" # local directory CACHEDIR=$DEST/cache -# board configurations +# board configurations (obsolete, used only for build-all.sh to determine build targets) +# please edit board templates in config/boards to change configuration +if false; then case $BOARD in @@ -374,17 +370,8 @@ case $BOARD in SERIALCON="ttyS0" CLI_TARGET="%,%" ;; - - *) - if [[ -f $SRC/lib/config/boards/$BOARD.board ]]; then - source $SRC/lib/config/boards/$BOARD.board - else - exit_with_error "Board configuration not found" "$BOARD" - fi - ;; esac - - +fi # board family configurations case $LINUXFAMILY in @@ -608,8 +595,13 @@ case $LINUXFAMILY in ;; esac - # Let's set defalt data if not defined in board configuration above + +[[ -z $OFFSET ]] && OFFSET=1 # Bootloader space in MB (1 x 2048 = default) +[[ -z $ARCH ]] && ARCH=armhf +[[ -z $SERIALCON ]] && SERIALCON=ttyS0 +[[ -z $BOOTSIZE ]] && BOOTSIZE=0 # Mb size of boot partition + [[ -z $LINUXCONFIG ]] && LINUXCONFIG="linux-$LINUXFAMILY-$BRANCH" [[ -z $LINUXKERNEL ]] && eval LINUXKERNEL=\$KERNEL_${BRANCH^^} [[ -z $LINUXSOURCE ]] && eval LINUXSOURCE=\$KERNEL_${BRANCH^^}"_SOURCE" @@ -626,7 +618,19 @@ esac [[ -z $CPUMIN && ($LINUXFAMILY == udoo || $LINUXFAMILY == neo ) ]] && CPUMIN="392000" && CPUMAX="996000" && GOVERNOR="interactive" [[ -z $GOVERNOR ]] && GOVERNOR="ondemand" -if [[ $ARCH == *64* ]]; then ARCHITECTURE=arm64; else ARCHITECTURE=arm; fi +case $ARCH in + arm64) + TARGETS=Image + CROSS_COMPILE="$CCACHE aarch64-linux-gnu-" + ARCHITECTURE=arm64 + ;; + + armhf) + TARGETS=zImage + CROSS_COMPILE="$CCACHE arm-linux-gnueabihf-" + ARCHITECTURE=arm + ;; +esac # Essential packages PACKAGE_LIST="automake bash-completion bc bridge-utils build-essential cmake cpufrequtils \ diff --git a/general.sh b/general.sh index 3dc3973398..4088027da0 100644 --- a/general.sh +++ b/general.sh @@ -287,7 +287,7 @@ prepare_host() { PAK="ca-certificates device-tree-compiler pv bc lzop zip binfmt-support build-essential ccache debootstrap ntpdate pigz \ gawk gcc-arm-linux-gnueabihf gcc-arm-linux-gnueabi qemu-user-static u-boot-tools uuid-dev zlib1g-dev unzip libusb-1.0-0-dev ntpdate \ parted pkg-config libncurses5-dev whiptail debian-keyring debian-archive-keyring f2fs-tools libfile-fcntllock-perl rsync libssl-dev \ - nfs-kernel-server btrfs-tools gcc-aarch64-linux-gnu" + nfs-kernel-server btrfs-tools gcc-aarch64-linux-gnu ncurses-term" # warning: apt-cacher-ng will fail if installed and used both on host and in container/chroot environment with shared network # set NO_APT_CACHER=yes to prevent installation errors in such case diff --git a/main.sh b/main.sh index 3d6fcbe505..c8faeb2549 100644 --- a/main.sh +++ b/main.sh @@ -70,118 +70,60 @@ backtitle="Armbian building script, http://www.armbian.com | Author: Igor Pecovn # Check and fix dependencies, directory structure and settings prepare_host -# Choose destination - creating board list from file configuration.sh -if [ "$BOARD" == "" ]; then - IFS=";" - MYARRAY=($(cat $SRC/lib/configuration.sh | awk '/\)#enabled/ || /#des/' | sed -e 's/\t\t//' | sed 's/)#enabled//g' \ - | sed 's/#description //g' | sed -e 's/\t//' | sed ':a;N;$!ba;s/\n/;/g')) - MYPARAMS=( --title "Choose a board" --backtitle $backtitle --menu "\n Supported:" 36 67 26 ) - i=0; j=1 - while [[ $i -lt ${#MYARRAY[@]} ]]; do - MYPARAMS+=( "${MYARRAY[$i]}" " ${MYARRAY[$j]}" ) - i=$[$i+2]; j=$[$j+2] +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[@]}") + unset options + [[ -z $KERNEL_ONLY ]] && exit_with_error "No option selected" +fi + +if [[ -z $BOARD ]]; then + options=() + for board in $SRC/lib/config/boards/*.conf; do + options+=("$(basename $board | cut -d'.' -f1)" "$(head -1 $board | cut -d'#' -f2)") done - whiptail "${MYPARAMS[@]}" 2>results - BOARD=$(results - RELEASE=$(results - BUILD_DESKTOP=$(results - BRANCH=$(