From f0d2425929ef1e4c3f761fd0ffd0dc8c0a36b7be Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Mon, 12 Dec 2016 19:38:55 +0100 Subject: [PATCH] Beta builds are now defined in board configuration - will be live and updated after few test runs. There was also few fixes for parallel building. --- build-all.sh | 65 ++++++++++++++++++++++--------- compile.sh | 8 +++- config/boards/bananapi.conf | 3 ++ config/boards/cubietruck.conf | 3 ++ config/boards/lime2-emmc.conf | 4 ++ config/boards/orangepiplus2e.conf | 3 ++ config/boards/orangepizero.conf | 3 ++ config/boards/pine64.conf | 3 ++ main.sh | 3 +- 9 files changed, 74 insertions(+), 21 deletions(-) diff --git a/build-all.sh b/build-all.sh index 942d739a5d..040ae692f1 100644 --- a/build-all.sh +++ b/build-all.sh @@ -15,13 +15,6 @@ source $SRC/lib/general.sh # when we want to build from certain start from=0 -free_cpu=$(grep -c 'processor' /proc/cpuinfo) -free_cpu=$(($free_cpu + $free_cpu/2)) - -echo $MULTITHREAD -free_cpu=1001 -[[ $MULTITHREAD != yes ]] && free_cpu=0 - rm -rf /run/armbian mkdir -p /run/armbian @@ -37,10 +30,13 @@ fi create_images_list() { + # + # if parameter is true, than we build beta list + # for board in $SRC/lib/config/boards/*.conf; do BOARD=$(basename $board | cut -d'.' -f1) source $SRC/lib/config/boards/$BOARD.conf - if [[ -n $CLI_TARGET ]]; then + if [[ -n $CLI_TARGET && -z $1 ]]; then # RELEASES : BRANCHES CLI_TARGET=($(tr ':' ' ' <<< "$CLI_TARGET")) @@ -57,7 +53,7 @@ create_images_list() done done fi - if [[ -n $DESKTOP_TARGET ]]; then + if [[ -n $DESKTOP_TARGET && -z $1 ]]; then # RELEASES : BRANCHES DESKTOP_TARGET=($(tr ':' ' ' <<< "$DESKTOP_TARGET")) @@ -75,7 +71,43 @@ create_images_list() done fi - unset CLI_TARGET CLI_BRANCH DESKTOP_TARGET DESKTOP_BRANCH KERNEL_TARGET + if [[ -n $CLI_BETA_TARGET && -n $1 ]]; then + + # RELEASES : BRANCHES + CLI_BETA_TARGET=($(tr ':' ' ' <<< "$CLI_BETA_TARGET")) + + build_settings_target=($(tr ',' ' ' <<< "${CLI_BETA_TARGET[0]}")) + build_settings_branch=($(tr ',' ' ' <<< "${CLI_BETA_TARGET[1]}")) + + [[ ${build_settings_target[0]} == "%" ]] && build_settings_target[0]="${RELEASE_LIST[@]}" + [[ ${build_settings_branch[0]} == "%" ]] && build_settings_branch[0]="${BRANCH_LIST[@]}" + + for release in ${build_settings_target[@]}; do + for kernel in ${build_settings_branch[@]}; do + buildlist+=("$BOARD $kernel $release no") + done + done + + fi + if [[ -n $DESKTOP_BETA_TARGET && -n $1 ]]; then + + # RELEASES : BRANCHES + DESKTOP_BETA_TARGET=($(tr ':' ' ' <<< "$DESKTOP_BETA_TARGET")) + + build_settings_target=($(tr ',' ' ' <<< "${DESKTOP_BETA_TARGET[0]}")) + build_settings_branch=($(tr ',' ' ' <<< "${DESKTOP_BETA_TARGET[1]}")) + + [[ ${build_settings_target[0]} == "%" ]] && build_settings_target[0]="${RELEASE_LIST[@]}" + [[ ${build_settings_branch[0]} == "%" ]] && build_settings_branch[0]="${BRANCH_LIST[@]}" + + for release in ${build_settings_target[@]}; do + for kernel in ${build_settings_branch[@]}; do + buildlist+=("$BOARD $kernel $release no") + done + done + + fi + unset CLI_TARGET CLI_BRANCH DESKTOP_TARGET DESKTOP_BRANCH KERNEL_TARGET CLI_BETA_TARGET DESKTOP_BETA_TARGET done } @@ -99,7 +131,7 @@ if [[ $KERNEL_ONLY == yes ]]; then create_kernels_list printf "%-3s %-20s %-10s %-10s %-10s\n" \# BOARD BRANCH else - create_images_list + create_images_list $BETA printf "%-3s %-20s %-10s %-10s %-10s\n" \# BOARD BRANCH RELEASE DESKTOP fi @@ -126,18 +158,15 @@ for line in "${buildlist[@]}"; do if [[ $from -le $n ]]; then - touch "/run/armbian/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid" jobs=$(ls /run/armbian | wc -l) - if [[ $jobs -lt $free_cpu ]]; then + if [[ $jobs -lt $MULTITHREAD ]]; then display_alert "Building in the back $n / ${#buildlist[@]}" "Board: $BOARD Kernel:$BRANCH${RELEASE:+ Release: $RELEASE}${BUILD_DESKTOP:+ Desktop: $BUILD_DESKTOP}" "ext" - source $SRC/lib/main.sh >/dev/null & 2>&1 + (touch "/run/armbian/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid"; source $SRC/lib/main.sh; rm "/run/armbian/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid";) & else display_alert "Building $buildtext $n / ${#buildlist[@]}" "Board: $BOARD Kernel:$BRANCH${RELEASE:+ Release: $RELEASE}${BUILD_DESKTOP:+ Desktop: $BUILD_DESKTOP}" "ext" - source $SRC/lib/main.sh + (touch "/run/armbian/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid"; source $SRC/lib/main.sh; rm "/run/armbian/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid";) fi - # - # fake load - #sleep $[ ( $RANDOM % 3 ) + 1 ]s + fi done diff --git a/compile.sh b/compile.sh index 9fb6b90037..390039c156 100755 --- a/compile.sh +++ b/compile.sh @@ -31,6 +31,9 @@ FORCE_CHECKOUT="yes" # ignore manual changes to source BUILD_ALL="no" # cycle through available boards and make images or kernel/u-boot packages. # set KERNEL_ONLY to "yes" or "no" to build all packages/all images +BETA="" # set yes to add subrevision with tomorrow's date. For internal use. +MULTITHREAD="" # build n images at once. For internal use. + # build script version to use LIB_TAG="" # empty for latest version, # one of listed here: https://github.com/igorpecovnik/lib/tags for stable versions, @@ -80,6 +83,9 @@ fi # source additional configuration file [[ -n $1 && -f $SRC/config-$1.conf ]] && source $SRC/config-$1.conf +# daily beta build contains date in subrevision +if [[ $BETA == yes ]]; then SUBREVISION="."$(date --date="tomorrow" +"%y%m%d"); fi + if [[ $BUILD_ALL == yes || $BUILD_ALL == demo ]]; then source $SRC/lib/build-all.sh else @@ -92,4 +98,4 @@ fi # If you are committing new version of this file, increment VERSION # Only integers are supported -# VERSION=24 +# VERSION=25 diff --git a/config/boards/bananapi.conf b/config/boards/bananapi.conf index f77583eb17..a8e860a18b 100644 --- a/config/boards/bananapi.conf +++ b/config/boards/bananapi.conf @@ -8,6 +8,9 @@ CLI_TARGET="jessie,xenial:default,next" DESKTOP_TARGET="xenial:default,next" KERNEL_TARGET="default,next,dev" # +CLI_BETA_TARGET="xenial:dev" +DESKTOP_BETA_TARGET="" +# BOARDRATING="" CHIP="http://docs.armbian.com/Hardware_Allwinner-A20/" HARDWARE="https://linux-sunxi.org/Banana_Pi" diff --git a/config/boards/cubietruck.conf b/config/boards/cubietruck.conf index 40d940e4ae..0592a347ad 100644 --- a/config/boards/cubietruck.conf +++ b/config/boards/cubietruck.conf @@ -8,6 +8,9 @@ CLI_TARGET="jessie,xenial:default,next" DESKTOP_TARGET="xenial:default,next" KERNEL_TARGET="default,next,dev" # +CLI_BETA_TARGET="xenial:dev" +DESKTOP_BETA_TARGET="" +# BOARDRATING="" CHIP="http://docs.armbian.com/Hardware_Allwinner-A20/" HARDWARE="https://linux-sunxi.org/Cubietruck" diff --git a/config/boards/lime2-emmc.conf b/config/boards/lime2-emmc.conf index 97c09fb1bc..913f58d8a7 100644 --- a/config/boards/lime2-emmc.conf +++ b/config/boards/lime2-emmc.conf @@ -7,3 +7,7 @@ MODULES_NEXT="bonding" CLI_TARGET="" DESKTOP_TARGET="" KERNEL_TARGET="default,next,dev" +# +CLI_BETA_TARGET="xenial:dev" +DESKTOP_BETA_TARGET="" +# \ No newline at end of file diff --git a/config/boards/orangepiplus2e.conf b/config/boards/orangepiplus2e.conf index 38f8108111..0c76beea28 100644 --- a/config/boards/orangepiplus2e.conf +++ b/config/boards/orangepiplus2e.conf @@ -10,6 +10,9 @@ CLI_TARGET="jessie,xenial:default" DESKTOP_TARGET="xenial:default" KERNEL_TARGET="default,dev" # +CLI_BETA_TARGET="" +DESKTOP_BETA_TARGET="" +# BOARDRATING="" CHIP="http://docs.armbian.com/Hardware_Allwinner-H3/" HARDWARE="https://linux-sunxi.org/Orange_Pi_Plus_2E" diff --git a/config/boards/orangepizero.conf b/config/boards/orangepizero.conf index 72deadd2f5..291ffd3411 100644 --- a/config/boards/orangepizero.conf +++ b/config/boards/orangepizero.conf @@ -11,6 +11,9 @@ CLI_TARGET="jessie,xenial:default" DESKTOP_TARGET="" KERNEL_TARGET="default,dev" # +CLI_BETA_TARGET="xenial:dev" +DESKTOP_BETA_TARGET="" +# BOARDRATING="" CHIP="http://docs.armbian.com/Hardware_Allwinner-H3/" HARDWARE="http://linux-sunxi.org/Xunlong_Orange_Pi_Zero" diff --git a/config/boards/pine64.conf b/config/boards/pine64.conf index 5a37d6faeb..6b65541865 100644 --- a/config/boards/pine64.conf +++ b/config/boards/pine64.conf @@ -8,6 +8,9 @@ MODULES_NEXT="" CLI_TARGET="jessie,xenial:default,dev" DESKTOP_TARGET="xenial:default" # +CLI_BETA_TARGET="xenial:dev" +DESKTOP_BETA_TARGET="" +# BOARDRATING="" CHIP="http://docs.armbian.com/Hardware_Allwinner-H5-A64/" REVIEW="http://forum.armbian.com/index.php/topic/1917-armbian-running-on-pine64-and-other-a64h5-devices/#entry14642" diff --git a/main.sh b/main.sh index f637da8931..0b933fe918 100644 --- a/main.sh +++ b/main.sh @@ -229,5 +229,4 @@ fi end=`date +%s` runtime=$(((end-start)/60)) -display_alert "Runtime" "$runtime min" "info" -rm -f "/run/armbian/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid" \ No newline at end of file +display_alert "Runtime" "$runtime min" "info" \ No newline at end of file