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.
|
|
|
|
#
|
|
|
|
# This file is a part of tool chain https://github.com/igorpecovnik/lib
|
|
|
|
#
|
|
|
|
|
|
|
|
IFS=";"
|
2016-02-20 16:39:04 +01:00
|
|
|
|
2016-03-19 08:54:07 +01:00
|
|
|
#OLDFAMILY=""
|
2015-12-27 11:57:27 +01:00
|
|
|
|
2016-03-19 08:54:07 +01:00
|
|
|
#START=9
|
|
|
|
#STOP=9
|
|
|
|
#BUILD_ALL="demo"
|
2016-02-20 16:39:04 +01:00
|
|
|
|
2016-03-19 08:54:07 +01:00
|
|
|
declare -a MYARRAY1=('wheezy' '' 'jessie' '' 'trusty' '');
|
|
|
|
#declare -a MYARRAY1=('wheezy' '' 'jessie' '' 'trusty' '' 'xenial' '');
|
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-02-10 20:01:02 +01:00
|
|
|
# Function display and runs compilation with desired parameters
|
|
|
|
#
|
2016-03-19 08:54:07 +01:00
|
|
|
# Two parameters: $1 = BOARD $2 = BRANCH $3 = $TARGET
|
2016-02-10 20:01:02 +01:00
|
|
|
#
|
2015-12-02 20:33:32 +01:00
|
|
|
distro-list ()
|
|
|
|
{
|
2016-02-20 16:39:04 +01:00
|
|
|
|
2015-12-02 20:33:32 +01:00
|
|
|
k1=0
|
|
|
|
l1=1
|
|
|
|
while [[ $k1 -lt ${#MYARRAY1[@]} ]]
|
|
|
|
do
|
|
|
|
BUILD_DESKTOP="no"
|
|
|
|
BOARD=$1
|
|
|
|
RELEASE=${MYARRAY1[$k1]}
|
|
|
|
BRANCH=$2
|
2016-02-10 20:01:02 +01:00
|
|
|
unset IFS array DESKTOP_TARGET LINUXFAMILY LINUXCONFIG LINUXKERNEL LINUXSOURCE KERNELBRANCH \
|
2016-04-08 16:56:20 +03:00
|
|
|
BOOTLOADER BOOTSOURCE BOOTBRANCH CPUMIN GOVERNOR NEEDS_UBOOT NEEDS_KERNEL BOOTSIZE UBOOT_TOOLCHAIN KERNEL_TOOLCHAIN
|
2016-02-10 20:01:02 +01:00
|
|
|
|
2015-12-02 20:33:32 +01:00
|
|
|
source $SRC/lib/configuration.sh
|
2016-02-10 20:01:02 +01:00
|
|
|
array=(${DESKTOP_TARGET//,/ })
|
2016-03-19 08:54:07 +01:00
|
|
|
arrax=(${CLI_TARGET//,/ })
|
|
|
|
|
2016-02-10 20:01:02 +01:00
|
|
|
# % means all BRANCH / DISTRIBUTION
|
|
|
|
[[ ${array[0]} == "%" ]] && array[0]=$RELEASE
|
|
|
|
[[ ${array[1]} == "%" ]] && array[1]=$2
|
2016-03-19 08:54:07 +01:00
|
|
|
[[ ${arrax[0]} == "%" ]] && arrax[0]=$RELEASE
|
|
|
|
[[ ${arrax[1]} == "%" ]] && arrax[1]=$2
|
2016-02-10 20:01:02 +01:00
|
|
|
|
|
|
|
# we define desktop building in config
|
2016-03-19 08:54:07 +01:00
|
|
|
if [[ "$RELEASE" == "${array[0]}" && $2 == "${array[1]}" && $3 == "desktop" ]]; then
|
2016-02-10 20:01:02 +01:00
|
|
|
display_alert "$BOARD desktop" "$RELEASE - $BRANCH - $LINUXFAMILY" "ext"
|
2016-03-19 08:54:07 +01:00
|
|
|
BUILD_DESKTOP="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$RELEASE" == "${arrax[0]}" && $2 == "${arrax[1]}" && $3 == "cli" ]]; then
|
|
|
|
display_alert "$BOARD CLI" "$RELEASE - $BRANCH - $LINUXFAMILY" "ext"
|
2016-02-10 20:01:02 +01:00
|
|
|
BUILD_DESKTOP="no"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# demo - for debugging purposes
|
2016-02-10 15:53:40 +01:00
|
|
|
[[ $BUILD_ALL != "demo" ]] && source $SRC/lib/main.sh
|
|
|
|
|
2015-12-27 13:49:20 +01:00
|
|
|
IFS=";"
|
2016-02-10 20:01:02 +01:00
|
|
|
k1=$[$k1+2]
|
|
|
|
l1=$[$l1+2]
|
2015-12-02 20:33:32 +01:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
IFS=";"
|
2016-03-19 08:54:07 +01:00
|
|
|
[[ -z "$START" ]] && START=0
|
2016-02-10 20:01:02 +01:00
|
|
|
MYARRAY=($(cat $SRC/lib/configuration.sh | awk '/)#enabled/ || /#des/ || /#build/' | sed -e 's/\t\t//' | sed 's/)#enabled//g' \
|
|
|
|
| sed 's/#description //g' | sed -e 's/\t//' | sed 's/#build //g' | sed ':a;N;$!ba;s/\n/;/g'))
|
|
|
|
i1=$[0+$START]
|
|
|
|
j1=$[1+$START]
|
|
|
|
o1=$[2+$START]
|
|
|
|
while [[ $i1 -lt ${#MYARRAY[@]} ]]
|
|
|
|
do
|
|
|
|
if [[ "${MYARRAY[$o1]}" == "1" || "${MYARRAY[$o1]}" == "3" || "${MYARRAY[$o1]}" == "6" ]]; then
|
2016-03-19 08:54:07 +01:00
|
|
|
distro-list "${MYARRAY[$i1]}" "default" "cli"
|
|
|
|
distro-list "${MYARRAY[$i1]}" "default" "desktop"
|
|
|
|
|
2016-02-10 20:01:02 +01:00
|
|
|
fi
|
|
|
|
if [[ "${MYARRAY[$o1]}" == "2" || "${MYARRAY[$o1]}" == "3" || "${MYARRAY[$o1]}" == "5" || "${MYARRAY[$o1]}" == "6" ]]; then
|
2016-03-19 08:54:07 +01:00
|
|
|
distro-list "${MYARRAY[$i1]}" "next" "cli"
|
|
|
|
distro-list "${MYARRAY[$i1]}" "next" "desktop"
|
2016-02-10 20:01:02 +01:00
|
|
|
fi
|
2016-03-19 08:54:07 +01:00
|
|
|
#if [[ "${MYARRAY[$o1]}" == "4" || "${MYARRAY[$o1]}" == "5" || "${MYARRAY[$o1]}" == "6" ]]; then
|
|
|
|
# distro-list "${MYARRAY[$i1]}" "dev"
|
|
|
|
#fi
|
2016-02-10 20:01:02 +01:00
|
|
|
i1=$[$i1+3];j1=$[$j1+3];o1=$[$o1+3]
|
2016-02-20 16:39:04 +01:00
|
|
|
|
2016-03-19 08:54:07 +01:00
|
|
|
#[[ $BUILD_ALL == "demo" ]] && echo $i1
|
|
|
|
if [[ -n "$STOP" && "$i1" -gt "$STOP" ]]; then exit; fi
|
2016-02-20 16:39:04 +01:00
|
|
|
|
2016-02-10 20:01:02 +01:00
|
|
|
done
|