Rework toolchain selection variables

This commit is contained in:
zador-blood-stained 2017-04-29 13:32:09 +03:00
parent 39b87ba2fb
commit 1f4f287d2b
16 changed files with 37 additions and 76 deletions

View file

@ -195,11 +195,11 @@ echo -e "\n${#buildlist[@]} total\n"
buildall_start=`date +%s`
n=0
for line in "${buildlist[@]}"; do
unset LINUXFAMILY LINUXCONFIG KERNELDIR KERNELSOURCE KERNELBRANCH BOOTDIR BOOTSOURCE BOOTBRANCH ARCH UBOOT_NEEDS_GCC KERNEL_NEEDS_GCC \
unset LINUXFAMILY LINUXCONFIG KERNELDIR KERNELSOURCE KERNELBRANCH BOOTDIR BOOTSOURCE BOOTBRANCH ARCH UBOOT_USE_GCC KERNEL_USE_GCC \
CPUMIN CPUMAX UBOOT_VER KERNEL_VER GOVERNOR BOOTSIZE BOOTFS_TYPE UBOOT_TOOLCHAIN KERNEL_TOOLCHAIN PACKAGE_LIST_EXCLUDE KERNEL_IMAGE_TYPE \
write_uboot_platform family_tweaks setup_write_uboot_platform BOOTSCRIPT UBOOT_TARGET_MAP LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER \
MODULES MODULES_NEXT MODULES_DEV INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE BOOTDELAY MODULES_BLACKLIST MODULES_BLACKLIST_NEXT \
MODULES_BLACKLIST_DEV MOUNT SDCARD BOOTPATCHDIR buildtext RELEASE UBOOT_ALT_GCC KERNEL_ALT_GCC IMAGE_TYPE OVERLAY_PREFIX
MODULES_BLACKLIST_DEV MOUNT SDCARD BOOTPATCHDIR buildtext RELEASE IMAGE_TYPE OVERLAY_PREFIX
read BOARD BRANCH RELEASE BUILD_DESKTOP <<< $line
n=$[$n+1]

View file

@ -13,7 +13,6 @@
# compile_uboot
# compile_kernel
# compile_sunxi_tools
# check_toolchain
# find_toolchain
# advanced_patch
# process_patch_file
@ -44,14 +43,9 @@ compile_uboot()
display_alert "Compiling u-boot" "$version" "info"
local toolchain=""
if [[ -n $UBOOT_ALT_GCC ]] && ! check_toolchain "$UBOOT_COMPILER" "$UBOOT_ALT_GCC"; then
# try to find alternative toolchain
toolchain=$(find_toolchain "$UBOOT_COMPILER" "$UBOOT_ALT_GCC")
fi
if [[ -z $toolchain && -n $UBOOT_NEEDS_GCC ]] && ! check_toolchain "$UBOOT_COMPILER" "$UBOOT_NEEDS_GCC"; then
# try to find required toolchain if alt was not found
toolchain=$(find_toolchain "$UBOOT_COMPILER" "$UBOOT_NEEDS_GCC")
[[ -z $toolchain ]] && exit_with_error "Could not find required toolchain" "${UBOOT_COMPILER}gcc $UBOOT_NEEDS_GCC"
if [[ -n $UBOOT_USE_GCC ]]; then
toolchain=$(find_toolchain "$UBOOT_COMPILER" "$UBOOT_USE_GCC")
[[ -z $toolchain ]] && exit_with_error "Could not find required toolchain" "${UBOOT_COMPILER}gcc $UBOOT_USE_GCC"
fi
display_alert "Compiler version" "${UBOOT_COMPILER}gcc $(eval ${toolchain:+env PATH=$toolchain:$PATH} ${UBOOT_COMPILER}gcc -dumpversion)" "info"
@ -196,14 +190,9 @@ compile_kernel()
display_alert "Compiling $BRANCH kernel" "$version" "info"
local toolchain=""
if [[ -n $KERNEL_ALT_GCC ]] && ! check_toolchain "$KERNEL_COMPILER" "$KERNEL_ALT_GCC"; then
# try to find alternative toolchain
toolchain=$(find_toolchain "$KERNEL_COMPILER" "$KERNEL_ALT_GCC")
fi
if [[ -z $toolchain && -n $KERNEL_NEEDS_GCC ]] && ! check_toolchain "$KERNEL_COMPILER" "$KERNEL_NEEDS_GCC"; then
# try to find required toolchain if alt was not found
toolchain=$(find_toolchain "$KERNEL_COMPILER" "$KERNEL_NEEDS_GCC")
[[ -z $toolchain ]] && exit_with_error "Could not find required toolchain" "${KERNEL_COMPILER}gcc $KERNEL_NEEDS_GCC"
if [[ -n $KERNEL_USE_GCC ]]; then
toolchain=$(find_toolchain "$KERNEL_COMPILER" "$KERNEL_USE_GCC")
[[ -z $toolchain ]] && exit_with_error "Could not find required toolchain" "${KERNEL_COMPILER}gcc $KERNEL_USE_GCC"
fi
display_alert "Compiler version" "${KERNEL_COMPILER}gcc $(eval ${toolchain:+env PATH=$toolchain:$PATH} ${KERNEL_COMPILER}gcc -dumpversion)" "info"
@ -283,20 +272,6 @@ compile_sunxi_tools()
fi
}
# check_toolchain <UBOOT|KERNEL> <expression>
#
# checks if system default toolchain version satisfies <expression>
# <expression>: "< x.y"; "> x.y"; "== x.y"
check_toolchain()
{
local compiler=$1
local expression=$2
# get major.minor gcc version
local gcc_ver=$(${compiler}gcc -dumpversion | grep -oE "^[[:digit:]].[[:digit:]]")
awk "BEGIN{exit ! ($gcc_ver $expression)}" && return 0
return 1
}
# find_toolchain <compiler_prefix> <expression>
#
# returns path to toolchain that satisfies <expression>

View file

@ -7,14 +7,14 @@ BOOTENV_FILE='cubox-default.txt'
UBOOT_TARGET_MAP=';;SPL u-boot.img'
UBOOT_NEEDS_GCC='< 5.0'
KERNEL_NEEDS_GCC='< 5.0'
UBOOT_USE_GCC='< 5.0'
case $BRANCH in
default)
KERNELSOURCE='https://github.com/linux4kix/linux-linaro-stable-mx6'
KERNELBRANCH='branch:linux-linaro-lsk-v3.14-mx6'
KERNELDIR='linux-cubox'
KERNEL_USE_GCC='< 5.0'
;;
next)
@ -43,9 +43,9 @@ write_uboot_platform()
dd if=$1/u-boot.img of=$2 bs=1K seek=42 status=noxfer > /dev/null 2>&1
}
if [[ $BOARD == "wandboard-quad" ]]; then
unset UBOOT_NEEDS_GCC && UBOOT_ALT_GCC='> 6.1'
unset KERNEL_NEEDS_GCC && KERNEL_ALT_GCC='> 6.1'
if [[ $BOARD == wandboard-quad ]]; then
UBOOT_USE_GCC='> 6.0'
KERNEL_USE_GCC='> 6.0'
CPUMAX=1008000
GOVERNOR=ondemand
HAS_UUID_SUPPORT=yes

View file

@ -2,14 +2,13 @@ BOOTSOURCE='https://github.com/hardkernel/u-boot.git'
BOOTBRANCH='branch:odroidc-v2011.03'
BOOTDIR='u-boot-odroidc1'
BOOTPATCHDIR='u-boot-odroidc1'
UBOOT_NEEDS_GCC='< 4.9'
BOOTSCRIPT="boot-odroid-c1.ini:boot.ini"
UBOOT_USE_GCC='< 4.9'
BOOTSCRIPT='boot-odroid-c1.ini:boot.ini'
UBOOT_TARGET_MAP=';;sd_fuse/bl1.bin.hardkernel sd_fuse/u-boot.bin'
HAS_UUID_SUPPORT=yes
KERNEL_NEEDS_GCC='< 4.9'
KERNEL_IMAGE_TYPE=uImage
case $BRANCH in
@ -17,6 +16,7 @@ case $BRANCH in
KERNELSOURCE='https://github.com/hardkernel/linux'
KERNELBRANCH='branch:odroidc-3.10.y'
KERNELDIR='linux-odroidc1'
KERNEL_USE_GCC='< 4.9'
;;
next)

View file

@ -2,8 +2,8 @@ BOOTSOURCE='https://github.com/hardkernel/u-boot.git'
BOOTBRANCH='branch:odroidc2-v2015.01'
BOOTDIR='u-boot-odroidc2'
BOOTPATCHDIR='u-boot-odroidc2'
UBOOT_NEEDS_GCC='< 5.0'
BOOTSCRIPT="boot-odroid-c2.ini:boot.ini"
UBOOT_USE_GCC='< 5.0'
BOOTSCRIPT='boot-odroid-c2.ini:boot.ini'
UBOOT_TARGET_MAP='ARCH=arm;;sd_fuse/bl1.bin.hardkernel sd_fuse/u-boot.bin'

View file

@ -2,14 +2,14 @@ BOOTSOURCE='https://github.com/SolidRun/u-boot-armada38x'
BOOTBRANCH='branch:u-boot-2013.01-15t1-clearfog'
BOOTDIR='u-boot-armada'
BOOTPATCHDIR='u-boot-armada'
BOOTSCRIPT="boot-marvell.cmd:boot.cmd"
BOOTSCRIPT='boot-marvell.cmd:boot.cmd'
UBOOT_TARGET_MAP="u-boot.mmc;;u-boot.mmc u-boot-uart.mmc
u-boot.sata;sata;u-boot.sata u-boot-uart.sata
u-boot.flash;spi;u-boot.flash u-boot-uart.flash"
UBOOT_NEEDS_GCC='< 5.0'
UBOOT_COMPILER="arm-linux-gnueabi-"
UBOOT_USE_GCC='< 5.0'
UBOOT_COMPILER='arm-linux-gnueabi-'
BOOTENV_FILE='clearfog-default.txt'
HAS_UUID_SUPPORT=yes
@ -26,7 +26,7 @@ case $BRANCH in
KERNELBRANCH=$MAINLINE_KERNEL_BRANCH
KERNELDIR=$MAINLINE_KERNEL_DIR
KERNEL_ALT_GCC='> 6.1'
KERNEL_USE_GCC='> 6.0'
;;
esac

View file

@ -27,7 +27,7 @@ case $BRANCH in
KERNELBRANCH=$MAINLINE_KERNEL_BRANCH
KERNELDIR=$MAINLINE_KERNEL_DIR
KERNEL_ALT_GCC='> 6.1'
KERNEL_USE_GCC='> 6.1'
;;
esac

View file

@ -2,14 +2,13 @@ BOOTSOURCE='https://github.com/hardkernel/u-boot.git'
BOOTBRANCH='branch:odroidc-v2011.03'
BOOTDIR='u-boot-odroidc1'
BOOTPATCHDIR='u-boot-odroidc1'
UBOOT_NEEDS_GCC='< 4.9'
UBOOT_USE_GCC='< 4.9'
BOOTSCRIPT="boot-odroid-c1.ini:boot.ini"
UBOOT_TARGET_MAP=';;sd_fuse/bl1.bin.hardkernel sd_fuse/u-boot.bin'
HAS_UUID_SUPPORT=yes
KERNEL_NEEDS_GCC='< 4.9'
KERNEL_IMAGE_TYPE=uImage
case $BRANCH in
@ -17,6 +16,7 @@ case $BRANCH in
KERNELSOURCE='https://github.com/hardkernel/linux'
KERNELBRANCH='branch:odroidc-3.10.y'
KERNELDIR='linux-odroidc1'
KERNEL_USE_GCC='< 4.9'
;;
next)

View file

@ -2,7 +2,7 @@ BOOTSOURCE='https://github.com/hardkernel/u-boot.git'
BOOTBRANCH='branch:odroidc2-v2015.01'
BOOTDIR='u-boot-odroidc2'
BOOTPATCHDIR='u-boot-odroidc2'
UBOOT_NEEDS_GCC='< 5.0'
UBOOT_USE_GCC='< 5.0'
BOOTSCRIPT="boot-odroid-c2.ini:boot.ini"
UBOOT_TARGET_MAP='ARCH=arm;;sd_fuse/bl1.bin.hardkernel sd_fuse/u-boot.bin'

View file

@ -12,7 +12,7 @@ case $BRANCH in
KERNELSOURCE='https://github.com/hardkernel/linux'
KERNELBRANCH='branch:odroidxu3-3.10.y'
KERNELDIR='linux-odroidxu4'
UBOOT_NEEDS_GCC='< 4.9'
UBOOT_USE_GCC='< 4.9'
;;
next)
@ -25,8 +25,8 @@ case $BRANCH in
BOOTPATCHDIR='u-boot-odroidxu4-next'
BOOTENV_FILE='odroidxu4-next.txt'
UBOOT_ALT_GCC='> 6.1'
KERNEL_ALT_GCC='> 6.1'
UBOOT_USE_GCC='> 6.0'
KERNEL_USE_GCC='> 6.0'
HAS_UUID_SUPPORT=yes

View file

@ -10,14 +10,14 @@ OFFSET=2
UBOOT_TARGET_MAP=';;u-boot.rda'
UBOOT_NEEDS_GCC='< 5.0'
UBOOT_USE_GCC='< 5.0'
UBOOT_COMPILER='arm-linux-gnueabi-'
KERNELSOURCE='https://github.com/RDA8810/linux-RDA8810'
KERNELBRANCH='branch:rdadroid-3.10.62-rel5.0.2'
KERNELDIR='linux-rda8810'
KERNEL_NEEDS_GCC='< 5.0'
KERNEL_USE_GCC='< 5.0'
HAS_UUID_SUPPORT=yes

View file

@ -2,7 +2,7 @@ BOOTSCRIPT="boot-rockchip.cmd:boot.cmd"
BOOTENV_FILE='rockchip-default.txt'
UBOOT_TARGET_MAP=";;$SRC/lib/bin/rk3288_boot.bin u-boot-dtb.bin spl/u-boot-spl-dtb.bin"
UBOOT_ALT_GCC='> 6.1'
UBOOT_USE_GCC='> 6.0'
HAS_UUID_SUPPORT=yes
BOOTDELAY=0

View file

@ -6,7 +6,7 @@ case $BRANCH in
KERNELSOURCE='https://github.com/linux-sunxi/linux-sunxi'
KERNELBRANCH='branch:sunxi-3.4'
KERNELDIR='linux-sunxi'
KERNEL_NEEDS_GCC='< 5.0'
KERNEL_USE_GCC='< 5.0'
;;
dev)

View file

@ -15,7 +15,7 @@ case $BRANCH in
KERNELSOURCE='https://github.com/Icenowy/linux/'
KERNELBRANCH='branch:sunxi64-next-20170216'
KERNELDIR='linux-sun50i-dev'
KERNEL_ALT_GCC='> 6.1'
KERNEL_USE_GCC='> 6.1'
LINUXCONFIG='linux-sun50i-dev'
;;
esac

View file

@ -7,7 +7,7 @@ BOOTPATCHDIR="u-boot-sunxi"
UBOOT_TARGET_MAP=';;u-boot-sunxi-with-spl.bin'
UBOOT_ALT_GCC='> 6.1'
UBOOT_USE_GCC='> 6.0'
UBOOT_FW_ENV='0x88000,0x20000' # /etc/fw_env.config offset and env size
HAS_UUID_SUPPORT=yes
@ -25,13 +25,13 @@ case $BRANCH in
GOVERNOR=ondemand
KERNEL_ALT_GCC='> 6.1'
KERNEL_USE_GCC='> 6.0'
;;
dev)
GOVERNOR=ondemand
KERNEL_ALT_GCC='> 6.1'
KERNEL_USE_GCC='> 6.0'
;;
esac

View file

@ -102,20 +102,6 @@ esac
if [[ $RELEASE == xenial ]]; then DISTRIBUTION="Ubuntu"; else DISTRIBUTION="Debian"; fi
# temporary hacks/overrides
case $LINUXFAMILY in
sun*i)
# 2016.07+ compilation fails due to GCC bug
# works on Linaro 5.3.1, fails on Ubuntu 5.3.1
UBOOT_NEEDS_GCC='< 5.3'
;;
# also affects XU4 next branch
odroidxu4)
[[ $BRANCH == next ]] && UBOOT_NEEDS_GCC='< 5.3'
;;
esac
# Essential packages
PACKAGE_LIST="bc bridge-utils build-essential cpufrequtils device-tree-compiler figlet fbset fping \
iw fake-hwclock wpasupplicant psmisc ntp parted rsync sudo curl linux-base dialog crda \