From: Hauke Mehrtens <hauke.mehrt...@intel.com>

This combines the usage of external kernel tree with the cloning of the
kernel tree form git. The new kernel will be cloned into an external
directory and then used from there.

Signed-off-by: Hauke Mehrtens <hauke.mehrt...@intel.com>
---
 include/kernel-defaults.mk | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 10bd67a..6969c9f 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -62,13 +62,26 @@ ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
     endef
   endif
 else
-  define Kernel/Prepare/Default
+  ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
+    define Kernel/Prepare/Default
        mkdir -p $(KERNEL_BUILD_DIR)
        if [ -d $(LINUX_DIR) ]; then \
                rmdir $(LINUX_DIR); \
        fi
        ln -s $(CONFIG_EXTERNAL_KERNEL_TREE) $(LINUX_DIR)
-  endef
+    endef
+  else
+    define Kernel/Prepare/Default
+       mkdir -p $(KERNEL_BUILD_DIR)
+       if [ -d $(LINUX_DIR) ]; then \
+               rmdir $(LINUX_DIR); \
+       fi
+       ln -s $(CONFIG_EXTERNAL_KERNEL_TREE) $(LINUX_DIR)
+       if [ ! -d $(CONFIG_EXTERNAL_KERNEL_TREE) ]; then \
+               git clone $(KERNEL_GIT_OPTS) $(CONFIG_KERNEL_GIT_CLONE_URI) 
$(CONFIG_EXTERNAL_KERNEL_TREE); \
+       fi
+    endef
+  endif
 endif
 
 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
-- 
2.10.1


_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to