include/kernel: Switch to git download method

Utilize the existing git download logic from include/download.mk and migrate
the kernel download over to it. This avoids repeatedly cloning kernel sources
after a make target/linux/clean for instance.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [fix build error]
This commit is contained in:
Florian Fainelli
2016-11-09 09:34:18 -08:00
committed by Felix Fietkau
parent b9aab34eb4
commit 9a08c0ba80
2 changed files with 20 additions and 10 deletions

View File

@@ -46,6 +46,24 @@ define Download/kernel
MD5SUM:=$(LINUX_KERNEL_MD5SUM)
endef
KERNEL_GIT_OPTS:=
ifneq ($(strip $(CONFIG_KERNEL_GIT_LOCAL_REPOSITORY)),"")
KERNEL_GIT_OPTS+=--reference $(CONFIG_KERNEL_GIT_LOCAL_REPOSITORY)
endif
ifneq ($(strip $(CONFIG_KERNEL_GIT_BRANCH)),"")
KERNEL_GIT_OPTS+=--branch $(CONFIG_KERNEL_GIT_BRANCH)
endif
define Download/git-kernel
URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI))
PROTO:=git
VERSION:=$(CONFIG_KERNEL_GIT_BRANCH)
FILE:=$(LINUX_SOURCE)
SUBDIR:=linux-$(KERNEL_PATCHVER)
OPTS:=$(KERNEL_GIT_OPTS)
endef
ifdef CONFIG_COLLECT_KERNEL_DEBUG
define Kernel/CollectDebug
rm -rf $(KERNEL_BUILD_DIR)/debug
@@ -73,6 +91,7 @@ endif
define BuildKernel
$(if $(QUILT),$(Build/Quilt))
$(if $(LINUX_SITE),$(call Download,kernel))
$(if $(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),$(call Download,git-kernel))
.NOTPARALLEL: