From be0ec27dedf885ee51b28649d8bea66c15d53c8d Mon Sep 17 00:00:00 2001 From: may Date: Fri, 10 May 2019 04:32:01 +0800 Subject: [PATCH] [general] new option DOWNLOAD_MIRROR to select download mirror current DOWNLOAD_MIRROR=china is used the mirror is provided by tsinghua university --- lib/configuration.sh | 5 +++++ lib/general.sh | 3 +++ 2 files changed, 8 insertions(+) diff --git a/lib/configuration.sh b/lib/configuration.sh index efd360a388..8bf788be6a 100644 --- a/lib/configuration.sh +++ b/lib/configuration.sh @@ -244,6 +244,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 ee9f8f382e..f8e407d148 100644 --- a/lib/general.sh +++ b/lib/general.sh @@ -662,6 +662,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"