This allows the selection of a specific branch in the menuconfig
when using a kernel downloaded from GIT.

Signed-off-by: Mathieu Olivari <math...@qca.qualcomm.com>
---
 config/Config-devel.in     |    9 +++++++++
 include/kernel-defaults.mk |    4 ++++
 2 files changed, 13 insertions(+)

diff --git a/config/Config-devel.in b/config/Config-devel.in
index 9fd5c48..0931175 100644
--- a/config/Config-devel.in
+++ b/config/Config-devel.in
@@ -71,6 +71,15 @@ menuconfig DEVEL
                  In this instance, the --refererence option of git clone will
                  be used thus creating a quick local clone of your repo.
 
+       config KERNEL_GIT_BRANCH
+               string "Enter git branch to clone" if DEVEL
+               depends on (KERNEL_GIT_CLONE_URI != "")
+               default ""
+               help
+                 Enter the branch name to checkout after cloning the git 
repository.
+                 In this instance, the --branch option of git clone will be 
used.
+                 If unused, the clone's repository HEAD will be checked-out.
+
        config BUILD_LOG
                bool "Enable log files during build process" if DEVEL
                help
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index fd75a3f..f1f5a81 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -38,6 +38,10 @@ 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
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to