From d56eb10c8d775243ec3431f9396d576a23e32e4d Mon Sep 17 00:00:00 2001 From: may Date: Mon, 6 May 2019 02:01:49 +0800 Subject: [PATCH 1/6] [general] remove duplicate download item --- lib/general.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/general.sh b/lib/general.sh index 3edc0279c8..15dbcf989f 100644 --- a/lib/general.sh +++ b/lib/general.sh @@ -671,7 +671,6 @@ prepare_host() "https://${ARMBIANSERVER}/_toolchains/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf.tar.xz" "https://${ARMBIANSERVER}/_toolchains/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz" "https://${ARMBIANSERVER}/_toolchains/gcc-linaro-6.4.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz" - "https://${ARMBIANSERVER}/_toolchains/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz" "https://${ARMBIANSERVER}/_toolchains/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz" "https://${ARMBIANSERVER}/_toolchains/gcc-linaro-7.4.1-2019.02-x86_64_arm-eabi.tar.xz" "https://${ARMBIANSERVER}/_toolchains/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi.tar.xz" From 80adf4aded6a71cc4077ccac55037a07ed37f4b5 Mon Sep 17 00:00:00 2001 From: may Date: Wed, 15 May 2019 17:14:33 +0800 Subject: [PATCH 2/6] [general] fix always downloading linux-firmware.git clone to new dir 'linux-firmware-git' instead the old '$plugin_dir/lib/firmware', and then copy files as hardlinks. --- packages/extras/firmware.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/extras/firmware.sh b/packages/extras/firmware.sh index c46a6a20a7..3f246d0a13 100644 --- a/packages/extras/firmware.sh +++ b/packages/extras/firmware.sh @@ -14,14 +14,17 @@ build_firmware() local plugin_repo="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git" local plugin_dir="armbian-firmware${FULL}" [[ -d $SRC/cache/sources/$plugin_dir ]] && rm -rf $SRC/cache/sources/$plugin_dir + mkdir -p $SRC/cache/sources/$plugin_dir/lib/firmware fetch_from_repo "https://github.com/armbian/firmware" "armbian-firmware-git" "branch:master" if [[ -n $FULL ]]; then - fetch_from_repo "$plugin_repo" "$plugin_dir/lib/firmware" "branch:master" + fetch_from_repo "$plugin_repo" "linux-firmware-git" "branch:master" + # cp : create hardlinks + cp -alf $SRC/cache/sources/linux-firmware-git/* $SRC/cache/sources/$plugin_dir/lib/firmware/ fi - mkdir -p $SRC/cache/sources/$plugin_dir/lib/firmware # overlay our firmware - cp -R $SRC/cache/sources/armbian-firmware-git/* $SRC/cache/sources/$plugin_dir/lib/firmware + # cp : create hardlinks + cp -alf $SRC/cache/sources/armbian-firmware-git/* $SRC/cache/sources/$plugin_dir/lib/firmware/ # cleanup what's not needed for sure rm -rf $SRC/cache/sources/$plugin_dir/lib/firmware/{amdgpu,amd-ucode,radeon,nvidia,matrox,.git} From 34071505653fabcc6838caba7e17e7336c3abac1 Mon Sep 17 00:00:00 2001 From: may Date: Wed, 8 May 2019 14:15:30 +0800 Subject: [PATCH 3/6] [general.sh] change ntp server to pool.ntp.org --- lib/general.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/general.sh b/lib/general.sh index 15dbcf989f..0f802c11c2 100644 --- a/lib/general.sh +++ b/lib/general.sh @@ -626,7 +626,7 @@ prepare_host() # sync clock if [[ $SYNC_CLOCK != no ]]; then display_alert "Syncing clock" "host" "info" - ntpdate -s ${NTP_SERVER:- time.ijs.si} + ntpdate -s ${NTP_SERVER:- pool.ntp.org} fi if [[ $(dpkg-query -W -f='${db:Status-Abbrev}\n' 'zlib1g:i386' 2>/dev/null) != *ii* ]]; then From 2b584bb5e09c8a38481a67c0a3636deec81d5577 Mon Sep 17 00:00:00 2001 From: may Date: Fri, 10 May 2019 04:32:01 +0800 Subject: [PATCH 4/6] [general] new option DOWNLOAD_MIRROR to select download mirror - set to `china` to use `mirrors.tuna.tsinghua.edu.cn` - leave it unset to use official source. --- lib/configuration.sh | 5 +++++ lib/general.sh | 3 +++ 2 files changed, 8 insertions(+) diff --git a/lib/configuration.sh b/lib/configuration.sh index 37a0ffbff5..e819b76aa0 100644 --- a/lib/configuration.sh +++ b/lib/configuration.sh @@ -226,6 +226,11 @@ esac DEBIAN_MIRROR='httpredir.debian.org/debian' UBUNTU_MIRROR='ports.ubuntu.com/' +if [[ $DOWNLOAD_MIRROR == china ]] ; then + DEBIAN_MIRROR='mirrors.tuna.tsinghua.edu.cn/debian' + UBUNTU_MIRROR='mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/' +fi + # For user override if [[ -f $SRC/userpatches/lib.config ]]; then display_alert "Using user configuration override" "userpatches/lib.config" "info" diff --git a/lib/general.sh b/lib/general.sh index 0f802c11c2..5fd6a3eefe 100644 --- a/lib/general.sh +++ b/lib/general.sh @@ -660,6 +660,9 @@ prepare_host() # Use backup server by default to balance the load ARMBIANSERVER=dl.armbian.com + if [[ $DOWNLOAD_MIRROR == 'china' ]]; then + ARMBIANSERVER='mirrors.tuna.tsinghua.edu.cn/armbian-releases' + fi local toolchains=( "https://${ARMBIANSERVER}/_toolchains/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz" From 04d484b6b6557286d2f647da2cdea19aba5004d2 Mon Sep 17 00:00:00 2001 From: may Date: Fri, 10 May 2019 05:11:52 +0800 Subject: [PATCH 5/6] [general] new option MAINLINE_MIRROR to select mainline kernel mirror - set to `google` to use mirror provided by Google, the same as `USE_MAINLINE_GOOGLE_MIRROR=yes`. - set to `tuna` to use mirror provided by tsinghua university. - leave it unset to use offical `git.kernel.org`. --- lib/configuration.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/configuration.sh b/lib/configuration.sh index e819b76aa0..dbd9eab913 100644 --- a/lib/configuration.sh +++ b/lib/configuration.sh @@ -43,11 +43,12 @@ fi [[ $ROOTFS_TYPE == nfs ]] && FIXED_IMAGE_SIZE=64 # used by multiple sources - reduce code duplication -if [[ $USE_MAINLINE_GOOGLE_MIRROR == yes ]]; then - MAINLINE_KERNEL_SOURCE='https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable' -else - MAINLINE_KERNEL_SOURCE='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git' -fi +[[ $USE_MAINLINE_GOOGLE_MIRROR == yes ]] && MAINLINE_MIRROR=google +case $MAINLINE_MIRROR in + google) MAINLINE_KERNEL_SOURCE='https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable' ;; + tuna) MAINLINE_KERNEL_SOURCE='https://mirrors.tuna.tsinghua.edu.cn/git/linux-stable.git' ;; + *) MAINLINE_KERNEL_SOURCE='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git' ;; +esac MAINLINE_KERNEL_DIR='linux-mainline' if [[ $USE_GITHUB_UBOOT_MIRROR == yes ]]; then From aea890200c0c2ab8156a31eb991a087ab54d8ec0 Mon Sep 17 00:00:00 2001 From: may Date: Mon, 6 May 2019 09:20:15 +0800 Subject: [PATCH 6/6] [general] replace dd with truncate, create a sparse disk image --- lib/debootstrap-ng.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/debootstrap-ng.sh b/lib/debootstrap-ng.sh index acf8e783c3..3a08808d94 100644 --- a/lib/debootstrap-ng.sh +++ b/lib/debootstrap-ng.sh @@ -375,7 +375,7 @@ prepare_partitions() # stage: create blank image display_alert "Creating blank image for rootfs" "$sdsize MiB" "info" - dd if=/dev/zero bs=1M status=none count=$sdsize | pv -p -b -r -s $(( $sdsize * 1024 * 1024 )) | dd status=none of=${SDCARD}.raw + truncate --size=${sdsize}M ${SDCARD}.raw # stage: calculate boot partition size local bootstart=$(($OFFSET * 2048))