Re: [LEDE-DEV] [PATCH 2/2] include/kernel: Switch to git download method
On 12/01/2016 02:41 AM, Felix Fietkau wrote: > On 2016-11-09 18:34, Florian Fainelli wrote: >> 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>> --- >> include/kernel-build.mk| 19 +++ >> include/kernel-defaults.mk | 11 +-- >> 2 files changed, 20 insertions(+), 10 deletions(-) >> >> diff --git a/include/kernel-build.mk b/include/kernel-build.mk >> index 04878f8250a9..04c6fc1e1986 100644 >> --- a/include/kernel-build.mk >> +++ b/include/kernel-build.mk >> @@ -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:=$(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 $(CONFIG_KERNEL_GIT_CLONE_URI),$(call Download,git-kernel)) > This caused a build error when not using external git trees because you > forgot to strip quotes. I've fixed it up in my staging tree, please > check the result. Thanks for fixing this up, the result looks good and works for me. Thanks! -- Florian ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH 2/2] include/kernel: Switch to git download method
On 2016-11-09 18:34, Florian Fainelli wrote: > 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> --- > include/kernel-build.mk| 19 +++ > include/kernel-defaults.mk | 11 +-- > 2 files changed, 20 insertions(+), 10 deletions(-) > > diff --git a/include/kernel-build.mk b/include/kernel-build.mk > index 04878f8250a9..04c6fc1e1986 100644 > --- a/include/kernel-build.mk > +++ b/include/kernel-build.mk > @@ -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:=$(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 $(CONFIG_KERNEL_GIT_CLONE_URI),$(call Download,git-kernel)) This caused a build error when not using external git trees because you forgot to strip quotes. I've fixed it up in my staging tree, please check the result. - Felix ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 2/2] 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--- include/kernel-build.mk| 19 +++ include/kernel-defaults.mk | 11 +-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/kernel-build.mk b/include/kernel-build.mk index 04878f8250a9..04c6fc1e1986 100644 --- a/include/kernel-build.mk +++ b/include/kernel-build.mk @@ -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:=$(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 $(CONFIG_KERNEL_GIT_CLONE_URI),$(call Download,git-kernel)) .NOTPARALLEL: diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index eff4700fcaa1..a17b489c9822 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -49,15 +49,6 @@ export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include # defined in quilt.mk Kernel/Patch:=$(Kernel/Patch/Default) -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 - ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"") ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"") define Kernel/Prepare/Default @@ -67,7 +58,7 @@ ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"") endef else define Kernel/Prepare/Default - git clone $(KERNEL_GIT_OPTS) $(CONFIG_KERNEL_GIT_CLONE_URI) $(LINUX_DIR) + xzcat $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS) endef endif else -- 2.10.1 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev