2015-12-02 20:33:32 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Copyright (c) 2015 Igor Pecovnik, igor.pecovnik@gma**.com
|
|
|
|
#
|
|
|
|
# This file is licensed under the terms of the GNU General Public
|
|
|
|
# License version 2. This program is licensed "as is" without any
|
|
|
|
# warranty of any kind, whether express or implied.
|
|
|
|
#
|
2016-04-17 00:01:27 +03:00
|
|
|
# This file is a part of tool chain https://github.com/igorpecovnik/lib
|
|
|
|
#
|
2015-12-02 20:33:32 +01:00
|
|
|
|
2015-12-27 14:46:51 +01:00
|
|
|
# Include here to make "display_alert" and "prepare_host" available
|
2016-02-10 20:01:02 +01:00
|
|
|
source $SRC/lib/general.sh
|
2015-12-27 14:46:51 +01:00
|
|
|
|
2016-04-30 21:25:51 +02:00
|
|
|
# when we want to build from certain start
|
|
|
|
from=0
|
|
|
|
|
2016-04-16 21:42:53 +03:00
|
|
|
RELEASE_LIST=("trusty" "xenial" "wheezy" "jessie")
|
2016-04-18 22:10:31 +02:00
|
|
|
BRANCH_LIST=("default" "next" "dev")
|
2016-04-16 21:42:53 +03:00
|
|
|
|
2016-06-24 16:26:44 +02:00
|
|
|
# add dependencies for converting .md to .pdf
|
|
|
|
if [[ ! -f /etc/apt/sources.list.d/nodesource.list ]]; then
|
|
|
|
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
|
2016-09-18 16:34:45 +02:00
|
|
|
apt-get install -y libfontconfig1 nodejs
|
2016-06-24 16:26:44 +02:00
|
|
|
npm install -g markdown-pdf
|
|
|
|
fi
|
|
|
|
|
2016-04-16 21:42:53 +03:00
|
|
|
create_images_list()
|
2015-12-02 20:33:32 +01:00
|
|
|
{
|
2016-04-16 21:42:53 +03:00
|
|
|
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
|
2016-04-20 19:12:46 +03:00
|
|
|
|
2016-04-18 22:10:31 +02:00
|
|
|
# RELEASES : BRANCHES
|
|
|
|
CLI_TARGET=($(tr ':' ' ' <<< "$CLI_TARGET"))
|
2016-04-20 19:12:46 +03:00
|
|
|
|
2016-04-18 22:10:31 +02:00
|
|
|
build_settings_target=($(tr ',' ' ' <<< "${CLI_TARGET[0]}"))
|
|
|
|
build_settings_branch=($(tr ',' ' ' <<< "${CLI_TARGET[1]}"))
|
2016-04-20 19:12:46 +03:00
|
|
|
|
2016-04-18 22:10:31 +02:00
|
|
|
[[ ${build_settings_target[0]} == "%" ]] && build_settings_target[0]="${RELEASE_LIST[@]}"
|
|
|
|
[[ ${build_settings_branch[0]} == "%" ]] && build_settings_branch[0]="${BRANCH_LIST[@]}"
|
2016-04-20 19:12:46 +03:00
|
|
|
|
2016-04-18 22:10:31 +02:00
|
|
|
for release in ${build_settings_target[@]}; do
|
|
|
|
for kernel in ${build_settings_branch[@]}; do
|
2016-04-16 21:42:53 +03:00
|
|
|
buildlist+=("$BOARD $kernel $release no")
|
|
|
|
done
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
if [[ -n $DESKTOP_TARGET ]]; then
|
2016-04-20 19:12:46 +03:00
|
|
|
|
2016-04-18 22:10:31 +02:00
|
|
|
# RELEASES : BRANCHES
|
|
|
|
DESKTOP_TARGET=($(tr ':' ' ' <<< "$DESKTOP_TARGET"))
|
2016-04-20 19:12:46 +03:00
|
|
|
|
2016-04-18 22:10:31 +02:00
|
|
|
build_settings_target=($(tr ',' ' ' <<< "${DESKTOP_TARGET[0]}"))
|
|
|
|
build_settings_branch=($(tr ',' ' ' <<< "${DESKTOP_TARGET[1]}"))
|
2016-04-20 19:12:46 +03:00
|
|
|
|
2016-04-18 22:10:31 +02:00
|
|
|
[[ ${build_settings_target[0]} == "%" ]] && build_settings_target[0]="${RELEASE_LIST[@]}"
|
|
|
|
[[ ${build_settings_branch[0]} == "%" ]] && build_settings_branch[0]="${BRANCH_LIST[@]}"
|
2016-04-20 19:12:46 +03:00
|
|
|
|
2016-04-18 22:10:31 +02:00
|
|
|
for release in ${build_settings_target[@]}; do
|
|
|
|
for kernel in ${build_settings_branch[@]}; do
|
2016-04-16 21:42:53 +03:00
|
|
|
buildlist+=("$BOARD $kernel $release yes")
|
|
|
|
done
|
|
|
|
done
|
2016-04-18 22:10:31 +02:00
|
|
|
|
2016-04-16 21:42:53 +03:00
|
|
|
fi
|
2016-04-18 22:10:31 +02:00
|
|
|
unset CLI_TARGET CLI_BRANCH DESKTOP_TARGET DESKTOP_BRANCH KERNEL_TARGET
|
2016-04-16 21:42:53 +03:00
|
|
|
done
|
|
|
|
}
|
2016-02-20 16:39:04 +01:00
|
|
|
|
2016-04-16 21:42:53 +03:00
|
|
|
create_kernels_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 $KERNEL_TARGET ]]; then
|
|
|
|
for kernel in $(tr ',' ' ' <<< $KERNEL_TARGET); do
|
|
|
|
buildlist+=("$BOARD $kernel")
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
unset KERNEL_TARGET
|
|
|
|
done
|
|
|
|
}
|
2016-02-10 20:01:02 +01:00
|
|
|
|
2016-04-16 21:42:53 +03:00
|
|
|
buildlist=()
|
2016-02-10 20:01:02 +01:00
|
|
|
|
2016-04-16 21:42:53 +03:00
|
|
|
if [[ $KERNEL_ONLY == yes ]]; then
|
|
|
|
create_kernels_list
|
2016-04-30 21:25:51 +02:00
|
|
|
printf "%-3s %-20s %-10s %-10s %-10s\n" \# BOARD BRANCH
|
2016-04-16 21:42:53 +03:00
|
|
|
else
|
|
|
|
create_images_list
|
2016-04-30 21:25:51 +02:00
|
|
|
printf "%-3s %-20s %-10s %-10s %-10s\n" \# BOARD BRANCH RELEASE DESKTOP
|
2016-04-16 21:42:53 +03:00
|
|
|
fi
|
2016-02-10 15:53:40 +01:00
|
|
|
|
2016-04-30 21:25:51 +02:00
|
|
|
n=0
|
2016-04-16 21:42:53 +03:00
|
|
|
for line in "${buildlist[@]}"; do
|
2016-04-30 21:25:51 +02:00
|
|
|
n=$[$n+1]
|
|
|
|
printf "%-3s %-20s %-10s %-10s %-10s\n" $n $line
|
2016-04-16 21:42:53 +03:00
|
|
|
done
|
|
|
|
echo -e "\n${#buildlist[@]} total\n"
|
|
|
|
|
|
|
|
[[ $BUILD_ALL == demo ]] && exit 0
|
2015-12-02 20:33:32 +01:00
|
|
|
|
2016-04-16 21:42:53 +03:00
|
|
|
buildall_start=`date +%s`
|
2016-04-30 21:25:51 +02:00
|
|
|
n=0
|
2016-04-16 21:42:53 +03:00
|
|
|
for line in "${buildlist[@]}"; do
|
2016-08-11 17:52:37 +03:00
|
|
|
unset LINUXFAMILY LINUXCONFIG KERNELDIR KERNELSOURCE KERNELBRANCH BOOTDIR BOOTSOURCE BOOTBRANCH ARCH UBOOT_NEEDS_GCC KERNEL_NEEDS_GCC \
|
2016-05-03 23:28:56 +03:00
|
|
|
CPUMIN CPUMAX UBOOT_VER KERNEL_VER GOVERNOR BOOTSIZE UBOOT_TOOLCHAIN KERNEL_TOOLCHAIN PACKAGE_LIST_EXCLUDE KERNEL_IMAGE_TYPE \
|
2016-10-22 18:34:18 +03:00
|
|
|
write_uboot_platform family_tweaks setup_write_uboot_platform BOOTSCRIPT UBOOT_FILES LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER \
|
2016-11-14 22:09:17 +03:00
|
|
|
UBOOT_TARGET MODULES MODULES_NEXT MODULES_DEV INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE BOOTDELAY MODULES_BLACKLIST MODULES_BLACKLIST_NEXT \
|
|
|
|
MODULES_BLACKLIST_DEV
|
2016-05-03 23:28:56 +03:00
|
|
|
|
2016-05-01 17:49:29 +03:00
|
|
|
read BOARD BRANCH RELEASE BUILD_DESKTOP <<< $line
|
2016-04-30 21:25:51 +02:00
|
|
|
n=$[$n+1]
|
2016-09-04 08:01:57 +02:00
|
|
|
if [[ $from -le $n && ! -f "/run/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid" ]]; then
|
|
|
|
display_alert "Building $n / ${#buildlist[@]}" "Board: $BOARD Kernel:$BRANCH${RELEASE:+ Release: $RELEASE}${BUILD_DESKTOP:+ Desktop: $BUILD_DESKTOP}" "ext"
|
2016-09-18 16:34:45 +02:00
|
|
|
#touch "/run/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid"
|
2016-04-30 21:25:51 +02:00
|
|
|
source $SRC/lib/main.sh
|
2016-09-18 16:34:45 +02:00
|
|
|
#rm "/run/Armbian_${BOARD^}_${BRANCH}_${RELEASE}_$BUILD_DESKTOP.pid"
|
2016-04-30 21:25:51 +02:00
|
|
|
fi
|
2016-02-10 20:01:02 +01:00
|
|
|
done
|
2016-04-16 21:42:53 +03:00
|
|
|
|
|
|
|
buildall_end=`date +%s`
|
|
|
|
buildall_runtime=$(((buildall_end - buildall_start) / 60))
|
|
|
|
display_alert "Runtime" "$buildall_runtime min" "info"
|