From 3d332a9c1c893ceab9c81a4258131fc996ad9f64 Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Thu, 11 Aug 2016 17:52:37 +0300 Subject: [PATCH] Rename some variables for better readability --- build-all.sh | 2 +- chroot-buildpackages.sh | 96 ---------------------------- config/sources/cubox.conf | 16 ++--- config/sources/marvell.conf | 16 ++--- config/sources/neo.conf | 10 +-- config/sources/odroidc1.conf | 12 ++-- config/sources/odroidc2.conf | 8 +-- config/sources/odroidxu4.conf | 12 ++-- config/sources/pine64.conf | 12 ++-- config/sources/s500.conf | 12 ++-- config/sources/sun4i.conf | 12 ++-- config/sources/sun5i.conf | 12 ++-- config/sources/sun6i.conf | 12 ++-- config/sources/sun7i.conf | 12 ++-- config/sources/sun8i.conf | 8 +-- config/sources/sun9i.conf | 12 ++-- config/sources/sunxi_common.inc | 2 +- config/sources/toradex.conf.disabled | 8 +-- config/sources/udoo.conf | 12 ++-- configuration.sh | 29 +++++---- general.sh | 95 +++++++++++++++++++++++++++ main.sh | 10 +-- 22 files changed, 211 insertions(+), 209 deletions(-) diff --git a/build-all.sh b/build-all.sh index f059bb9af..b47bf6c50 100644 --- a/build-all.sh +++ b/build-all.sh @@ -105,7 +105,7 @@ echo -e "\n${#buildlist[@]} total\n" buildall_start=`date +%s` n=0 for line in "${buildlist[@]}"; do - unset LINUXFAMILY LINUXCONFIG LINUXKERNEL LINUXSOURCE KERNELBRANCH BOOTLOADER BOOTSOURCE BOOTBRANCH ARCH UBOOT_NEEDS_GCC KERNEL_NEEDS_GCC \ + unset LINUXFAMILY LINUXCONFIG KERNELDIR KERNELSOURCE KERNELBRANCH BOOTDIR BOOTSOURCE BOOTBRANCH ARCH UBOOT_NEEDS_GCC KERNEL_NEEDS_GCC \ CPUMIN CPUMAX UBOOT_VER KERNEL_VER GOVERNOR BOOTSIZE UBOOT_TOOLCHAIN KERNEL_TOOLCHAIN PACKAGE_LIST_EXCLUDE KERNEL_IMAGE_TYPE \ write_uboot_platform family_tweaks install_boot_script UBOOT_FILES LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER UBOOT_TARGET \ MODULES MODULES_NEXT diff --git a/chroot-buildpackages.sh b/chroot-buildpackages.sh index f0e3a374c..5162c38d4 100644 --- a/chroot-buildpackages.sh +++ b/chroot-buildpackages.sh @@ -12,7 +12,6 @@ # create_chroot # update_chroot # chroot_build_packages -# fetch_from_repo # chroot_installpackages # create_chroot @@ -193,101 +192,6 @@ chroot_build_packages() done } ############################################################################# -# fetch_rom_repo -# : remote repository URL -# : local directory; subdir for branch/tag will be created -# : -# branch:name -# tag:name -# HEAD* -# commit:hash@depth* -# -# *: Work in progress -# : "yes" to create subdirectory for tag or branch name -# -fetch_from_repo() -{ - local url=$1 - local dir=$2 - local ref=$3 - local ref_subdir=$4 - - [[ -z $ref || ( $ref != tag:* && $ref != branch:* ) ]] && exit_with_error "Error in configuration" - local ref_type=${ref%%:*} - local ref_name=${ref##*:} - - display_alert "Checking git sources" "$dir $ref_name" "info" - - # get default remote branch name without cloning - # doesn't work with git:// remote URLs - # local ref_name=$(git ls-remote --symref $url HEAD | grep -o 'refs/heads/\S*' | sed 's%refs/heads/%%') - - if [[ $ref_subdir == yes ]]; then - mkdir -p $SOURCES/$dir/$ref_name - cd $SOURCES/$dir/$ref_name - else - mkdir -p $SOURCES/$dir/ - cd $SOURCES/$dir/ - fi - - # this may not work if $SRC is a part of git repository - if [[ $(git rev-parse --is-inside-work-tree 2>/dev/null) != true ]]; then - display_alert "Creating local copy" - git init -q . - git remote add origin $url - fi - - local local_hash=$(git rev-parse @ 2>/dev/null) - - local changed=false - case $ref_type in - branch) - local remote_hash=$(git ls-remote -h origin "$ref_name" | cut -f1) - [[ $local_hash != $remote_hash ]] && changed=true - ;; - - tag) - local remote_hash=$(git ls-remote -t origin "$ref_name" | cut -f1) - if [[ $local_hash != $remote_hash ]]; then - remote_hash=$(git ls-remote -t origin "$ref_name^{}" | cut -f1) - [[ -z $remote_hash || $local_hash != $remote_hash ]] && changed=true - fi - ;; - - head) - local remote_hash=$(git ls-remote origin HEAD | cut -f1) - [[ $local_hash != $remote_hash ]] && changed=true - ;; - esac - - if [[ $changed == true ]]; then - # remote was updated, fetch and check out updates - display_alert "Fetching updates" - case $ref_type in - branch) git fetch --depth 1 origin $ref_name ;; - tag) git fetch --depth 1 origin tags/$ref_name ;; - head) git fetch --depth 1 origin HEAD ;; - esac - display_alert "Checking out" - git checkout -f -q FETCH_HEAD - elif [[ -n $(git status -uno --porcelain) ]]; then - # working directory is not clean - if [[ $FORCE_CHECKOUT == yes ]]; then - display_alert "Checking out" - git checkout -f -q HEAD - else - display_alert "Skipping checkout" - fi - else - # working directory is clean, nothing to do - display_alert "Up to date" - fi - if [[ -f .gitmodules ]]; then - display_alert "Updating submodules" - git submodule update --init --depth 1 - fi -} ############################################################################# - # chroot_installpackages # chroot_installpackages() diff --git a/config/sources/cubox.conf b/config/sources/cubox.conf index 86c99c46e..683ad4c58 100644 --- a/config/sources/cubox.conf +++ b/config/sources/cubox.conf @@ -1,28 +1,28 @@ -BOOTLOADER='https://github.com/SolidRun/u-boot-imx6' +BOOTSOURCE='https://github.com/SolidRun/u-boot-imx6' BOOTBRANCH='imx6' -BOOTSOURCE='u-boot-cubox' +BOOTDIR='u-boot-cubox' UBOOT_NEEDS_GCC='< 5.0' KERNEL_NEEDS_GCC='< 5.0' case $BRANCH in default) - LINUXKERNEL='https://github.com/linux4kix/linux-linaro-stable-mx6' + KERNELSOURCE='https://github.com/linux4kix/linux-linaro-stable-mx6' KERNELBRANCH='linux-linaro-lsk-v3.14-mx6' - LINUXSOURCE='linux-cubox' + KERNELDIR='linux-cubox' ;; next) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH=$MAINLINE_KERNEL_BRANCH - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR ;; dev) - LINUXKERNEL='https://github.com/SolidRun/linux-fslc' + KERNELSOURCE='https://github.com/SolidRun/linux-fslc' KERNELBRANCH='3.14-1.0.x-mx6-sr' - LINUXSOURCE='linux-cubox' + KERNELDIR='linux-cubox' ;; esac diff --git a/config/sources/marvell.conf b/config/sources/marvell.conf index a37b0948a..a2420d51e 100644 --- a/config/sources/marvell.conf +++ b/config/sources/marvell.conf @@ -1,6 +1,6 @@ -BOOTLOADER='https://github.com/SolidRun/u-boot-armada38x' +BOOTSOURCE='https://github.com/SolidRun/u-boot-armada38x' BOOTBRANCH='u-boot-2013.01-15t1-clearfog' -BOOTSOURCE='u-boot-armada' +BOOTDIR='u-boot-armada' UBOOT_NEEDS_GCC='< 5.0' @@ -8,21 +8,21 @@ UBOOT_TARGET="u-boot.mmc" case $BRANCH in default) - LINUXKERNEL='https://github.com/SolidRun/linux-armada38x' + KERNELSOURCE='https://github.com/SolidRun/linux-armada38x' KERNELBRANCH='linux-3.10.70-15t1-clearfog' - LINUXSOURCE='linux-armada' + KERNELDIR='linux-armada' ;; next) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH=$MAINLINE_KERNEL_BRANCH - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR ;; dev) - LINUXKERNEL='https://github.com/SolidRun/linux-stable' + KERNELSOURCE='https://github.com/SolidRun/linux-stable' KERNELBRANCH='linux-4.4.y-clearfog' - LINUXSOURCE='linux-armada-modern' + KERNELDIR='linux-armada-modern' ;; esac diff --git a/config/sources/neo.conf b/config/sources/neo.conf index 2b8d9b1be..781cabb1f 100644 --- a/config/sources/neo.conf +++ b/config/sources/neo.conf @@ -1,13 +1,13 @@ -BOOTLOADER="https://github.com/UDOOboard/uboot-imx" +BOOTSOURCE="https://github.com/UDOOboard/uboot-imx" BOOTBRANCH="2015.04.imx-neo" -BOOTSOURCE="u-boot-neo" +BOOTDIR="u-boot-neo" -LINUXKERNEL='https://github.com/UDOOboard/linux_kernel' +KERNELSOURCE='https://github.com/UDOOboard/linux_kernel' #KERNELBRANCH="imx_3.14.28_1.0.0_ga_neo" KERNELBRANCH="3.14-1.0.x-udoo" -#LINUXSOURCE="linux-udoo-neo" -LINUXSOURCE="linux-udoo" +#KERNELDIR="linux-udoo-neo" +KERNELDIR="linux-udoo" CPUMIN=392000 CPUMAX=996000 diff --git a/config/sources/odroidc1.conf b/config/sources/odroidc1.conf index 82faf4f03..1e43daaa8 100644 --- a/config/sources/odroidc1.conf +++ b/config/sources/odroidc1.conf @@ -1,7 +1,7 @@ -BOOTLOADER='https://github.com/hardkernel/u-boot.git' +BOOTSOURCE='https://github.com/hardkernel/u-boot.git' BOOTBRANCH='odroidc-v2011.03' -BOOTSOURCE='u-boot-odroidc1' +BOOTDIR='u-boot-odroidc1' UBOOT_NEEDS_GCC='< 4.9' BOOTSIZE=32 @@ -9,15 +9,15 @@ KERNEL_NEEDS_GCC='< 4.9' case $BRANCH in default) - LINUXKERNEL='https://github.com/hardkernel/linux' + KERNELSOURCE='https://github.com/hardkernel/linux' KERNELBRANCH='odroidc-3.10.y' - LINUXSOURCE='linux-odroidc1' + KERNELDIR='linux-odroidc1' ;; next) - LINUXKERNEL='https://github.com/tobetter/linux' + KERNELSOURCE='https://github.com/tobetter/linux' KERNELBRANCH='odroidxu4-v4.2' - LINUXSOURCE='linux-odroidxu-next' + KERNELDIR='linux-odroidxu-next' ;; esac diff --git a/config/sources/odroidc2.conf b/config/sources/odroidc2.conf index d72ad9a33..ae7137723 100644 --- a/config/sources/odroidc2.conf +++ b/config/sources/odroidc2.conf @@ -1,13 +1,13 @@ -BOOTLOADER='https://github.com/hardkernel/u-boot.git' +BOOTSOURCE='https://github.com/hardkernel/u-boot.git' BOOTBRANCH='odroidc2-v2015.01' -BOOTSOURCE='u-boot-odroidc2' +BOOTDIR='u-boot-odroidc2' BOOTSIZE=64 UBOOT_NEEDS_GCC='< 5.0' UBOOT_TARGET="ARCH=arm" -LINUXKERNEL='https://github.com/hardkernel/linux' +KERNELSOURCE='https://github.com/hardkernel/linux' KERNELBRANCH='odroidc2-3.14.y' -LINUXSOURCE='linux-odroidc2' +KERNELDIR='linux-odroidc2' ARCH=arm64 diff --git a/config/sources/odroidxu4.conf b/config/sources/odroidxu4.conf index 7a8e263f5..1bc717390 100644 --- a/config/sources/odroidxu4.conf +++ b/config/sources/odroidxu4.conf @@ -1,22 +1,22 @@ -BOOTLOADER='https://github.com/hardkernel/u-boot.git' +BOOTSOURCE='https://github.com/hardkernel/u-boot.git' BOOTBRANCH='odroidxu3-v2012.07' -BOOTSOURCE='u-boot-odroidxu' +BOOTDIR='u-boot-odroidxu' BOOTSIZE=64 OFFSET=2 UBOOT_NEEDS_GCC='< 4.9' case $BRANCH in default) - LINUXKERNEL='https://github.com/hardkernel/linux' + KERNELSOURCE='https://github.com/hardkernel/linux' KERNELBRANCH='odroidxu3-3.10.y' - LINUXSOURCE='linux-odroidxu4' + KERNELDIR='linux-odroidxu4' ;; next) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH=$MAINLINE_KERNEL_BRANCH - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR ;; esac diff --git a/config/sources/pine64.conf b/config/sources/pine64.conf index 53b2f404a..e21a66389 100644 --- a/config/sources/pine64.conf +++ b/config/sources/pine64.conf @@ -1,7 +1,7 @@ -BOOTLOADER='https://github.com/zador-blood-stained/u-boot-pine64-armbian.git' +BOOTSOURCE='https://github.com/zador-blood-stained/u-boot-pine64-armbian.git' BOOTBRANCH='' -BOOTSOURCE='u-boot-pine64-armbian' +BOOTDIR='u-boot-pine64-armbian' UBOOT_NEEDS_GCC='<4.9' OFFSET=20 @@ -9,16 +9,16 @@ BOOTSIZE=64 case $BRANCH in default) - LINUXKERNEL='https://github.com/longsleep/linux-pine64.git' + KERNELSOURCE='https://github.com/longsleep/linux-pine64.git' KERNELBRANCH='pine64-hacks-1.2' - LINUXSOURCE='linux-pine64' + KERNELDIR='linux-pine64' GOVERNOR=interactive ;; dev) - LINUXKERNEL='https://github.com/apritzel/linux.git' + KERNELSOURCE='https://github.com/apritzel/linux.git' KERNELBRANCH='a64-wip' - LINUXSOURCE='linux-pine64-dev' + KERNELDIR='linux-pine64-dev' GOVERNOR=ondemand ;; esac diff --git a/config/sources/s500.conf b/config/sources/s500.conf index a7335291b..ed7a23225 100644 --- a/config/sources/s500.conf +++ b/config/sources/s500.conf @@ -1,16 +1,16 @@ -BOOTLOADER='https://github.com/LeMaker/u-boot-actions' +BOOTSOURCE='https://github.com/LeMaker/u-boot-actions' BOOTBRANCH='s500-master' -BOOTSOURCE='u-boot-s500' +BOOTDIR='u-boot-s500' UBOOT_TARGET="u-boot-dtb.img" BOOTSIZE=32 OFFSET=16 -LINUXKERNEL='https://github.com/LeMaker/linux-actions' +KERNELSOURCE='https://github.com/LeMaker/linux-actions' KERNELBRANCH='linux-3.10.y' -LINUXSOURCE='linux-s500' +KERNELDIR='linux-s500' CPUMIN=408000 CPUMAX=1104000 @@ -25,9 +25,9 @@ case $BOARD in roseapple) UBOOT_FILES="$SRC/lib/bin/s500-bootloader-roseapple.bin u-boot-dtb.img" - BOOTLOADER='https://github.com/xapp-le/u-boot' + BOOTSOURCE='https://github.com/xapp-le/u-boot' BOOTBRANCH='merge-20160113' - BOOTSOURCE='u-boot-roseapple' + BOOTDIR='u-boot-roseapple' ;; esac diff --git a/config/sources/sun4i.conf b/config/sources/sun4i.conf index 1c3af31c2..343a4ac50 100644 --- a/config/sources/sun4i.conf +++ b/config/sources/sun4i.conf @@ -3,21 +3,21 @@ source "${BASH_SOURCE%/*}/sunxi_common.inc" case $BRANCH in default) - LINUXKERNEL='https://github.com/linux-sunxi/linux-sunxi' + KERNELSOURCE='https://github.com/linux-sunxi/linux-sunxi' KERNELBRANCH='sunxi-3.4' - LINUXSOURCE='linux-sunxi' + KERNELDIR='linux-sunxi' ;; next) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH=$MAINLINE_KERNEL_BRANCH - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR ;; dev) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH='' - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR ;; esac diff --git a/config/sources/sun5i.conf b/config/sources/sun5i.conf index 4e67acc37..cf134509a 100644 --- a/config/sources/sun5i.conf +++ b/config/sources/sun5i.conf @@ -3,22 +3,22 @@ source "${BASH_SOURCE%/*}/sunxi_common.inc" case $BRANCH in default) - LINUXKERNEL='https://github.com/linux-sunxi/linux-sunxi' + KERNELSOURCE='https://github.com/linux-sunxi/linux-sunxi' KERNELBRANCH='sunxi-3.4' - LINUXSOURCE='linux-sunxi' + KERNELDIR='linux-sunxi' KERNEL_NEEDS_GCC='< 5.0' ;; next) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH=$MAINLINE_KERNEL_BRANCH - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR ;; dev) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH='' - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR ;; esac diff --git a/config/sources/sun6i.conf b/config/sources/sun6i.conf index ce7048c7b..5ef3bf1f0 100644 --- a/config/sources/sun6i.conf +++ b/config/sources/sun6i.conf @@ -3,21 +3,21 @@ source "${BASH_SOURCE%/*}/sunxi_common.inc" case $BRANCH in default) - LINUXKERNEL='https://github.com/linux-sunxi/linux-sunxi' + KERNELSOURCE='https://github.com/linux-sunxi/linux-sunxi' KERNELBRANCH='sunxi-3.4' - LINUXSOURCE='linux-sunxi' + KERNELDIR='linux-sunxi' ;; next) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH=$MAINLINE_KERNEL_BRANCH - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR ;; dev) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH='' - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR ;; esac diff --git a/config/sources/sun7i.conf b/config/sources/sun7i.conf index 754b66803..3264ab6df 100644 --- a/config/sources/sun7i.conf +++ b/config/sources/sun7i.conf @@ -3,25 +3,25 @@ source "${BASH_SOURCE%/*}/sunxi_common.inc" case $BRANCH in default) - LINUXKERNEL='https://github.com/linux-sunxi/linux-sunxi' + KERNELSOURCE='https://github.com/linux-sunxi/linux-sunxi' KERNELBRANCH='sunxi-3.4' - LINUXSOURCE='linux-sunxi' + KERNELDIR='linux-sunxi' CPUMAX=1010000 ;; next) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH=$MAINLINE_KERNEL_BRANCH - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR CPUMAX=960000 ;; dev) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH='' - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR CPUMAX=960000 ;; diff --git a/config/sources/sun8i.conf b/config/sources/sun8i.conf index 0475d41ba..0fce91b06 100644 --- a/config/sources/sun8i.conf +++ b/config/sources/sun8i.conf @@ -3,15 +3,15 @@ source "${BASH_SOURCE%/*}/sunxi_common.inc" case $BRANCH in default) - LINUXKERNEL='https://github.com/igorpecovnik/linux' + KERNELSOURCE='https://github.com/igorpecovnik/linux' KERNELBRANCH='sun8i' - LINUXSOURCE='linux-sun8i' + KERNELDIR='linux-sun8i' ;; dev) - LINUXKERNEL='https://github.com/megous/linux' + KERNELSOURCE='https://github.com/megous/linux' KERNELBRANCH='orange-pi-4.6' - LINUXSOURCE='linux-sun8i-mainline' + KERNELDIR='linux-sun8i-mainline' ;; esac diff --git a/config/sources/sun9i.conf b/config/sources/sun9i.conf index 3d783d595..a6f68871a 100644 --- a/config/sources/sun9i.conf +++ b/config/sources/sun9i.conf @@ -3,21 +3,21 @@ source "${BASH_SOURCE%/*}/sunxi_common.inc" case $BRANCH in default) - LINUXKERNEL='https://github.com/linux-sunxi/linux-sunxi' + KERNELSOURCE='https://github.com/linux-sunxi/linux-sunxi' KERNELBRANCH='sunxi-3.4' - LINUXSOURCE='linux-sunxi' + KERNELDIR='linux-sunxi' ;; next) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH=$MAINLINE_KERNEL_BRANCH - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR ;; dev) - LINUXKERNEL=$MAINLINE_KERNEL + KERNELSOURCE=$MAINLINE_KERNEL_SOURCE KERNELBRANCH='' - LINUXSOURCE=$MAINLINE_KERNEL_SOURCE + KERNELDIR=$MAINLINE_KERNEL_DIR ;; esac diff --git a/config/sources/sunxi_common.inc b/config/sources/sunxi_common.inc index 4fc726d11..bd1fdce66 100644 --- a/config/sources/sunxi_common.inc +++ b/config/sources/sunxi_common.inc @@ -1,6 +1,6 @@ -BOOTLOADER=$MAINLINE_UBOOT BOOTSOURCE=$MAINLINE_UBOOT_SOURCE +BOOTDIR=$MAINLINE_UBOOT_DIR BOOTBRANCH=$MAINLINE_UBOOT_BRANCH case $BRANCH in diff --git a/config/sources/toradex.conf.disabled b/config/sources/toradex.conf.disabled index 592400ce2..76b66bbaa 100644 --- a/config/sources/toradex.conf.disabled +++ b/config/sources/toradex.conf.disabled @@ -1,11 +1,11 @@ -BOOTLOADER='git://git.toradex.com/u-boot-toradex.git' +BOOTSOURCE='git://git.toradex.com/u-boot-toradex.git' BOOTBRANCH='2015.04-toradex' -BOOTSOURCE='u-boot-toradex' +BOOTDIR='u-boot-toradex' -LINUXKERNEL='git://git.toradex.com/linux-toradex.git' +KERNELSOURCE='git://git.toradex.com/linux-toradex.git' KERNELBRANCH='toradex_imx_3.14.28_1.0.0_ga' -LINUXSOURCE='linux-toradex' +KERNELDIR='linux-toradex' # CPUMIN= # CPUMAX= diff --git a/config/sources/udoo.conf b/config/sources/udoo.conf index ce6838a80..3e4070cd0 100644 --- a/config/sources/udoo.conf +++ b/config/sources/udoo.conf @@ -1,19 +1,19 @@ -BOOTLOADER='https://github.com/UDOOboard/uboot-imx' +BOOTSOURCE='https://github.com/UDOOboard/uboot-imx' BOOTBRANCH='2015.10.fslc-qdl' -BOOTSOURCE='u-boot-udoo' +BOOTDIR='u-boot-udoo' case $BRANCH in default) - LINUXKERNEL='https://github.com/UDOOboard/linux_kernel' + KERNELSOURCE='https://github.com/UDOOboard/linux_kernel' KERNELBRANCH='3.14-1.0.x-udoo' - LINUXSOURCE='linux-udoo' + KERNELDIR='linux-udoo' ;; next) - LINUXKERNEL='https://github.com/patrykk/linux-udoo' + KERNELSOURCE='https://github.com/patrykk/linux-udoo' KERNELBRANCH='v4.4.0-6-vivante-5.0.11.p7.3' - LINUXSOURCE='linux-udoo-next' + KERNELDIR='linux-udoo-next' ;; esac diff --git a/configuration.sh b/configuration.sh index 30ed13a1e..8594901b8 100644 --- a/configuration.sh +++ b/configuration.sh @@ -28,20 +28,20 @@ CACHEDIR=$DEST/cache # used by multiple sources - reduce code duplication if [[ $USE_MAINLINE_GOOGLE_MIRROR == yes ]]; then - MAINLINE_KERNEL='https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable' + MAINLINE_KERNEL_SOURCE='https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable' else - MAINLINE_KERNEL='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git' + MAINLINE_KERNEL_SOURCE='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git' fi # allow upgrades for same major.minor versions ARMBIAN_MAINLINE_KERNEL_VERSION="4.6" MAINLINE_KERNEL_BRANCH=v$(wget -qO- https://www.kernel.org/finger_banner | awk '{print $NF}' | grep -oE "^${ARMBIAN_MAINLINE_KERNEL_VERSION//./\\.}\.?[[:digit:]]*") #MAINLINE_KERNEL_BRANCH="v$(wget -qO- https://www.kernel.org/finger_banner | grep "The latest st" | awk '{print $NF}' | head -1)" -MAINLINE_KERNEL_SOURCE="linux-vanilla" +MAINLINE_KERNEL_DIR="linux-vanilla" -MAINLINE_UBOOT='git://git.denx.de/u-boot.git' +MAINLINE_UBOOT_SOURCE='git://git.denx.de/u-boot.git' #MAINLINE_UBOOT_BRANCH="v$(git ls-remote git://git.denx.de/u-boot.git | grep -v rc | grep -v '\^' | tail -1 | cut -d'v' -f 2)" MAINLINE_UBOOT_BRANCH="v2016.07" -MAINLINE_UBOOT_SOURCE='u-boot' +MAINLINE_UBOOT_DIR='u-boot' if [[ -f $SRC/lib/config/sources/$LINUXFAMILY.conf ]]; then source $SRC/lib/config/sources/$LINUXFAMILY.conf @@ -168,14 +168,17 @@ PACKAGE_LIST="$PACKAGE_LIST $PACKAGE_LIST_RELEASE $PACKAGE_LIST_ADDITIONAL" # debug cat <<-EOF >> $DEST/debug/output.log ## BUILD CONFIGURATION -Config: $LINUXCONFIG -Kernel source: $LINUXKERNEL +Kernel configuration: +Repository: $KERNELSOURCE Branch: $KERNELBRANCH -linuxsource: $LINUXSOURCE +Config file: $LINUXCONFIG + +U-boot configuration: +Repository: $BOOTSOURCE +Branch: $BOOTBRANCH Offset: $OFFSET -bootsize: $BOOTSIZE -bootloader: $BOOTLOADER -bootsource: $BOOTSOURCE -bootbranch: $BOOTBRANCH -CPU $CPUMIN / $CPUMAX with $GOVERNOR +Size: $BOOTSIZE + +CPU configuration: +$CPUMIN - $CPUMAX with $GOVERNOR EOF diff --git a/general.sh b/general.sh index 5ed86118d..e18ad5717 100644 --- a/general.sh +++ b/general.sh @@ -14,6 +14,7 @@ # exit_with_error # get_package_list_hash # fetch_from_github +# fetch_from_repo # display_alert # grab_version # fingerprint_image @@ -177,6 +178,100 @@ if [ $? -ne 0 ]; then fi } +# fetch_rom_repo +# : remote repository URL +# : local directory; subdir for branch/tag will be created +# : +# branch:name +# tag:name +# HEAD* +# commit:hash@depth* +# +# *: Work in progress +# : "yes" to create subdirectory for tag or branch name +# +fetch_from_repo() +{ + local url=$1 + local dir=$2 + local ref=$3 + local ref_subdir=$4 + + [[ -z $ref || ( $ref != tag:* && $ref != branch:* ) ]] && exit_with_error "Error in configuration" + local ref_type=${ref%%:*} + local ref_name=${ref##*:} + + display_alert "Checking git sources" "$dir $ref_name" "info" + + # get default remote branch name without cloning + # doesn't work with git:// remote URLs + # local ref_name=$(git ls-remote --symref $url HEAD | grep -o 'refs/heads/\S*' | sed 's%refs/heads/%%') + + if [[ $ref_subdir == yes ]]; then + mkdir -p $SOURCES/$dir/$ref_name + cd $SOURCES/$dir/$ref_name + else + mkdir -p $SOURCES/$dir/ + cd $SOURCES/$dir/ + fi + + # this may not work if $SRC is a part of git repository + if [[ $(git rev-parse --is-inside-work-tree 2>/dev/null) != true ]]; then + display_alert "Creating local copy" + git init -q . + git remote add origin $url + fi + + local local_hash=$(git rev-parse @ 2>/dev/null) + + local changed=false + case $ref_type in + branch) + local remote_hash=$(git ls-remote -h origin "$ref_name" | cut -f1) + [[ $local_hash != $remote_hash ]] && changed=true + ;; + + tag) + local remote_hash=$(git ls-remote -t origin "$ref_name" | cut -f1) + if [[ $local_hash != $remote_hash ]]; then + remote_hash=$(git ls-remote -t origin "$ref_name^{}" | cut -f1) + [[ -z $remote_hash || $local_hash != $remote_hash ]] && changed=true + fi + ;; + + head) + local remote_hash=$(git ls-remote origin HEAD | cut -f1) + [[ $local_hash != $remote_hash ]] && changed=true + ;; + esac + + if [[ $changed == true ]]; then + # remote was updated, fetch and check out updates + display_alert "Fetching updates" + case $ref_type in + branch) git fetch --depth 1 origin $ref_name ;; + tag) git fetch --depth 1 origin tags/$ref_name ;; + head) git fetch --depth 1 origin HEAD ;; + esac + display_alert "Checking out" + git checkout -f -q FETCH_HEAD + elif [[ -n $(git status -uno --porcelain) ]]; then + # working directory is not clean + if [[ $FORCE_CHECKOUT == yes ]]; then + display_alert "Checking out" + git checkout -f -q HEAD + else + display_alert "Skipping checkout" + fi + else + # working directory is clean, nothing to do + display_alert "Up to date" + fi + if [[ -f .gitmodules ]]; then + display_alert "Updating submodules" + git submodule update --init --depth 1 + fi +} ############################################################################# display_alert() #-------------------------------------------------------------------------------------------------------------------------------- diff --git a/main.sh b/main.sh index 0a0767567..f66b86490 100644 --- a/main.sh +++ b/main.sh @@ -177,10 +177,10 @@ start=`date +%s` [[ $CLEAN_LEVEL == *sources* ]] && cleaning "sources" display_alert "source downloading" "@host" "info" -fetch_from_github "$BOOTLOADER" "$BOOTSOURCE" "$BOOTBRANCH" "yes" -BOOTSOURCEDIR=$BOOTSOURCE/$GITHUBSUBDIR -fetch_from_github "$LINUXKERNEL" "$LINUXSOURCE" "$KERNELBRANCH" "yes" -LINUXSOURCEDIR=$LINUXSOURCE/$GITHUBSUBDIR +fetch_from_github "$BOOTSOURCE" "$BOOTDIR" "$BOOTBRANCH" "yes" +BOOTSOURCEDIR=$BOOTDIR/$GITHUBSUBDIR +fetch_from_github "$KERNELSOURCE" "$KERNELDIR" "$KERNELBRANCH" "yes" +LINUXSOURCEDIR=$KERNELDIR/$GITHUBSUBDIR if [[ -n $MISC1 ]]; then fetch_from_github "$MISC1" "$MISC1_DIR"; fi if [[ -n $MISC5 ]]; then fetch_from_github "$MISC5" "$MISC5_DIR"; fi @@ -213,7 +213,7 @@ if [[ ! -f $DEST/debs/${CHOSEN_UBOOT}_${REVISION}_${ARCH}.deb ]]; then fi cd $SOURCES/$BOOTSOURCEDIR grab_version "$SOURCES/$BOOTSOURCEDIR" "UBOOT_VER" - [[ $FORCE_CHECKOUT == yes ]] && advanced_patch "u-boot" "$BOOTSOURCE-$BRANCH" "$BOARD" "$BOOTSOURCE-$BRANCH $UBOOT_VER" + [[ $FORCE_CHECKOUT == yes ]] && advanced_patch "u-boot" "$BOOTDIR-$BRANCH" "$BOARD" "$BOOTDIR-$BRANCH $UBOOT_VER" compile_uboot fi