From 04d484b6b6557286d2f647da2cdea19aba5004d2 Mon Sep 17 00:00:00 2001 From: may Date: Fri, 10 May 2019 05:11:52 +0800 Subject: [PATCH] [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 e819b76aa..dbd9eab91 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