[openwrt/openwrt] kernel-headers: adjust PKG_ variables when using git clone method

LEDE Commits lede-commits at lists.infradead.org
Sat Jan 27 14:19:43 PST 2018


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/ca7e8627dbbbcae0d1bfacea51d9b564617195de

commit ca7e8627dbbbcae0d1bfacea51d9b564617195de
Author: Alexandru Ardelean <ardeleanalex at gmail.com>
AuthorDate: Wed Jan 17 12:55:15 2018 +0200

    kernel-headers: adjust PKG_ variables when using git clone method
    
    When using an external git clone for the kernel repo,
    the build would fail because the build won't download
    [via git] the kernel tarball.
    
    This is because the `toolchain/kernel-headers` assumes
    that the kernel would get downloaded via normal HTTP.
    The reason for this is the `HostBuild` rule, which
    calls the `Download/default` rule.
    
    To use the `Download/default` we just need to conditionally
    adjust some PKG_ vars.
    
    We can safely use `LINUX_VERSION` as it was already adjusted
    in the `kernel-version.mk` to avoid collisions with other tarballs.
    
    Fixes:
     https://bugs.openwrt.org/index.php?do=details&task_id=503
    
    Signed-off-by: Alexandru Ardelean <ardeleanalex at gmail.com>
---
 toolchain/kernel-headers/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile
index e374e70..f7842cb 100644
--- a/toolchain/kernel-headers/Makefile
+++ b/toolchain/kernel-headers/Makefile
@@ -17,7 +17,13 @@ include $(INCLUDE_DIR)/kernel.mk
 PKG_NAME:=linux
 PKG_VERSION:=$(LINUX_VERSION)
 PKG_SOURCE:=$(LINUX_SOURCE)
-PKG_SOURCE_URL:=$(LINUX_SITE)
+ifneq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
+  PKG_SOURCE_PROTO:=git
+  PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI))
+  PKG_SOURCE_VERSION:=$(CONFIG_KERNEL_GIT_REF)
+else
+  PKG_SOURCE_URL:=$(LINUX_SITE)
+endif
 HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
 PKG_HASH:=$(LINUX_KERNEL_HASH)
 LINUX_DIR := $(HOST_BUILD_DIR)



More information about the lede-commits mailing list