Patchwork [v3] Added local directory as soure of kernel code

login
register
mail settings
Submitter Arnout Vandecappelle
Date Feb. 23, 2013, 6:03 p.m.
Message ID <1361642610-4356-1-git-send-email-arnout@mind.be>
Download mbox | patch
Permalink /patch/222743/
State Accepted
Delegated to: Peter Korsgaard
Headers show

Comments

Arnout Vandecappelle - Feb. 23, 2013, 6:03 p.m.
From: Rafal Fabich <rafal.fabich@gmail.com>

Add the option to use a local directory as the source for
building the Linux kernel, which can be useful during
kernel development.

Signed-off-by: Rafal Fabich <rafal.fabich@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
Changes v3: Refreshed against master [Arnout]

Changes v1 -> v2 after comments from Arnout Vandecappelle
  - default setting of BR2_LINUX_KERNEL_VERSION changed to "custom"
  - removed ifeq ($(LINUX_VERSION),custom) condition from linux.mk for better consistency
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 linux/Config.in |   13 +++++++++++++
 linux/linux.mk  |    5 ++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
Peter Korsgaard - Feb. 4, 2014, 10:08 a.m.
>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:

 > From: Rafal Fabich <rafal.fabich@gmail.com>
 > Add the option to use a local directory as the source for
 > building the Linux kernel, which can be useful during
 > kernel development.

 > Signed-off-by: Rafal Fabich <rafal.fabich@gmail.com>
 > Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 > Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 > ---
 > Changes v3: Refreshed against master [Arnout]

Committed, thanks.

Patch

diff --git a/linux/Config.in b/linux/Config.in
index f48e660..625cc23 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -52,6 +52,12 @@  config BR2_LINUX_KERNEL_CUSTOM_GIT
 	  This option allows Buildroot to get the Linux kernel source
 	  code from a Git repository.
 
+config BR2_LINUX_KERNEL_CUSTOM_LOCAL
+	bool "Local directory"
+	help
+	  This option allows Buildroot to get the Linux kernel source
+	  code from a local directory.
+
 endchoice
 
 config BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE
@@ -74,6 +80,12 @@  config BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION
 	  Git revision to use in the format used by git rev-parse,
 	  E.G. a sha id, a tag, branch, ..
 
+config BR2_LINUX_KERNEL_CUSTOM_LOCAL_PATH
+	string "Path to the local directory"
+	depends on BR2_LINUX_KERNEL_CUSTOM_LOCAL
+	help
+	  Path to the local directory with the Linux kernel source code.
+
 config BR2_LINUX_KERNEL_VERSION
 	string
 	default "3.7.8" if BR2_LINUX_KERNEL_3_7
@@ -81,6 +93,7 @@  config BR2_LINUX_KERNEL_VERSION
 	default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE if BR2_LINUX_KERNEL_CUSTOM_VERSION
 	default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL
 	default $BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION if BR2_LINUX_KERNEL_CUSTOM_GIT
+	default "custom" if BR2_LINUX_KERNEL_CUSTOM_LOCAL
 
 #
 # Patch selection
diff --git a/linux/linux.mk b/linux/linux.mk
index 0352acd..c1451f8 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -8,10 +8,13 @@  LINUX_LICENSE = GPLv2
 LINUX_LICENSE_FILES = COPYING
 
 # Compute LINUX_SOURCE and LINUX_SITE from the configuration
-ifeq ($(LINUX_VERSION),custom)
+ifeq ($(BR2_LINUX_KERNEL_CUSTOM_TARBALL),y)
 LINUX_TARBALL = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION))
 LINUX_SITE = $(patsubst %/,%,$(dir $(LINUX_TARBALL)))
 LINUX_SOURCE = $(notdir $(LINUX_TARBALL))
+else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_LOCAL),y)
+LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_LOCAL_PATH))
+LINUX_SITE_METHOD = local
 else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
 LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL))
 LINUX_SITE_METHOD = git