Skip to contentSkip to conversation

linux: add option to get sources from custom directory

PATCH New Richard Braun 3 participants 7 messages Dec 7, 2012 – Feb 14, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: add option to get sources from custom directory

---
 linux/Config.in |   15 +++++++++++++--
 linux/linux.mk  |    3 +++
 2 files changed, 16 insertions(+), 2 deletions(-)
linux/Config.in +13 -2
index ef3b2a1..cafbe59 100644
@@ -46,6 +46,12 @@ config BR2_LINUX_KERNEL_CUSTOM_TARBALL
 	  This option allows to specify the http or ftp location of a
 	  specific kernel source tarball
 
+config BR2_LINUX_KERNEL_CUSTOM_DIRECTORY
+	bool "Custom directory"
+	help
+	  This option allows to specify the path of a specific kernel
+	  source directory.
+
 config BR2_LINUX_KERNEL_CUSTOM_GIT
 	bool "Custom Git tree"
 	help
@@ -56,12 +62,16 @@ endchoice
 
 config BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE
 	string "Kernel version"
-	depends on BR2_LINUX_KERNEL_CUSTOM_VERSION
+	depends on BR2_LINUX_KERNEL_CUSTOM_VERSION || BR2_LINUX_KERNEL_CUSTOM_DIRECTORY
 
 config BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION
 	string "URL of custom kernel tarball"
 	depends on BR2_LINUX_KERNEL_CUSTOM_TARBALL
 
+config BR2_LINUX_KERNEL_CUSTOM_DIRECTORY_PATH
+	string "Path of custom kernel sources"
+	depends on BR2_LINUX_KERNEL_CUSTOM_DIRECTORY
+
 config BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL
 	string "URL of custom Git repository"
 	depends on BR2_LINUX_KERNEL_CUSTOM_GIT
@@ -78,7 +88,8 @@ config BR2_LINUX_KERNEL_VERSION
 	string
 	default "3.6.9" if BR2_LINUX_KERNEL_3_6
 	default BR2_DEFAULT_KERNEL_HEADERS if BR2_LINUX_KERNEL_SAME_AS_HEADERS
-	default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE if BR2_LINUX_KERNEL_CUSTOM_VERSION
+	default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE if BR2_LINUX_KERNEL_CUSTOM_VERSION || \
+		BR2_LINUX_KERNEL_CUSTOM_DIRECTORY
 	default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL
 	default $BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION if BR2_LINUX_KERNEL_CUSTOM_GIT
 
linux/linux.mk +3 -0
index c4bdf90..1898408 100644
@@ -15,6 +15,9 @@ LINUX_SOURCE = $(notdir $(LINUX_TARBALL))
 else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
 LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL))
 LINUX_SITE_METHOD = git
+else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_DIRECTORY),y)
+LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DIRECTORY_PATH))
+LINUX_SITE_METHOD = local
 else
 LINUX_SOURCE = linux-$(LINUX_VERSION).tar.bz2
 # In X.Y.Z, get X and Y. We replace dots and dashes by spaces in order
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 1/1 linux: add option to get sources from custom directory

Ping.

Signature · 1 line
Richard Braun
#2 lore raw

PATCH 1/1 linux: add option to get sources from custom directory

In reply to Richard Braun

Dear Richard Braun,

Quoted 5 lines · Richard Braun
linux/Config.in +0 -0
index ef3b2a1..cafbe59 100644

linux/Config.in config BR2_LINUX_KERNEL_CUSTOM_TARBALL · line 54

Quoted 9 lines
linux/Config.in +6 -0
@@ -46,6 +46,12 @@ config BR2_LINUX_KERNEL_CUSTOM_TARBALL
 	  This option allows to specify the http or ftp location of a
 	  specific kernel source tarball
 
+config BR2_LINUX_KERNEL_CUSTOM_DIRECTORY
+	bool "Custom directory"
+	help
+	  This option allows to specify the path of a specific kernel
+	  source directory.
+

This duplicates what the "source override" mechanism allows to do in a generic way for all packages. So on one side, I'm tempted to say "no" because I don't think it's worth having two mechanisms to achieve the same thing, especially when the new mechanism is package-specific (what if someone wants a custom source directory for Qt, for zlib, for libpng, etc.).

On the other side, Linux, and bootloaders, are kind of special packages in that very often people will have to work on them, and making this easier might be useful.

Generally speaking, I'd like us to have an overall "vision" of how to do development with Buildroot, rather than doing local hacks/fixes per package to adjust one particular development workflow, which would end up with many different hacks in various places with absolutely no coherency.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH 1/1 linux: add option to get sources from custom directory

Quoted 3 lines · Thomas Petazzoni

On the other side, Linux, and bootloaders, are kind of special packages in that very often people will have to work on them, and making this easier might be useful.

The fact that the kernel is clearly separate from the other packages in menuconfig, and that it already provides several ways of fetching the source makes it hard for most people to think of the override mechanism. On the other hand, the fact that it's handled almost like any other package makes this hack extremely easy and safe to implement. I don't see a reason not to provide this fetching method if the others aren't also reconsidered (otherwise I wouldn't have bothered sending it anyway).

Signature · 1 line
Richard Braun
#4 lore raw

PATCH 1/1 linux: add option to get sources from custom directory

Quoted 5 lines · Richard Braun
Quoted 3 lines · Thomas Petazzoni

On the other side, Linux, and bootloaders, are kind of special packages in that very often people will have to work on them, and making this easier might be useful.

Quoted 8 lines

The fact that the kernel is clearly separate from the other packages in menuconfig, and that it already provides several ways of fetching the source makes it hard for most people to think of the override mechanism. On the other hand, the fact that it's handled almost like any other package makes this hack extremely easy and safe to implement. I don't see a reason not to provide this fetching method if the others aren't also reconsidered (otherwise I wouldn't have bothered sending it anyway).

I agree. I think that if we provide several methods of downloading in
the menuconfig, then all SITE_METHODs should ideally be supported. In particular svn is probably also of interest to some people.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#5 lore raw

PATCH 1/1 linux: add option to get sources from custom directory

Quoted 15 lines · Arnout Vandecappelle
Quoted 5 lines · Richard Braun
Quoted 3 lines · Thomas Petazzoni

On the other side, Linux, and bootloaders, are kind of special packages in that very often people will have to work on them, and making this easier might be useful.

Quoted 8 lines

The fact that the kernel is clearly separate from the other packages in menuconfig, and that it already provides several ways of fetching the source makes it hard for most people to think of the override mechanism. On the other hand, the fact that it's handled almost like any other package makes this hack extremely easy and safe to implement. I don't see a reason not to provide this fetching method if the others aren't also reconsidered (otherwise I wouldn't have bothered sending it anyway).

Quoted 4 lines

I agree. I think that if we provide several methods of downloading
in the menuconfig, then all SITE_METHODs should ideally be supported. In particular svn is probably also of interest to some people.

Ping.

Signature · 1 line
Richard Braun
#6 lore raw

PATCH 1/1 linux: add option to get sources from custom directory

Dear Richard Braun,

Quoted 6 lines · Richard Braun
Quoted 4 lines

I agree. I think that if we provide several methods of downloading
in the menuconfig, then all SITE_METHODs should ideally be supported. In particular svn is probably also of interest to some people.

Ping.

Rafal Fabich has submitted "[PATCH v2] Added local directory as soure of kernel code" today, which seems to implement what you want. If you could test it and add your Tested-by on the patch, it would be great.

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com