Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC 2/2] linux: Add support for specifying a custom directory
Date: Sun, 29 Oct 2017 08:26:49 +0100	[thread overview]
Message-ID: <20171029072649.GA2899@scaer> (raw)
In-Reply-To: <1509242782-14524-3-git-send-email-f.fainelli@gmail.com>

Florian, All,

On 2017-10-28 19:06 -0700, Florian Fainelli spake thusly:
> Add the ability to specify a path to a custom directory where kernel sources
> may be contained. This is useful when doing kernel development in an existing
> git tree.

This case is covered by the override-sourcedir mechanism.

Create a file (by default, local.mk) in your config directory (the one
with the Buildroot .config file), and edit this file with:

    LINUX_OVERRIDE_SRCDIR = /path/to/your/linux

and Buildroot will use that as a rsync source, instead of downloading
the kernel sources.

See also e782cd5b1bc (Revert "Added local directory as source of kernel
code") for more in-depth explanations. ;-)

Regards,
Yann E. MORIN.

> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  linux/Config.in                        | 10 ++++++++++
>  linux/linux.mk                         |  3 +++
>  package/linux-headers/linux-headers.mk |  5 +++++
>  3 files changed, 18 insertions(+)
> 
> diff --git a/linux/Config.in b/linux/Config.in
> index 33ae944557b6..7d4dcddc7ea7 100644
> --- a/linux/Config.in
> +++ b/linux/Config.in
> @@ -87,6 +87,12 @@ config BR2_LINUX_KERNEL_CUSTOM_SVN
>  	  This option allows Buildroot to get the Linux kernel source
>  	  code from a Subversion repository.
>  
> +config BR2_LINUX_KERNEL_CUSTOM_DIRECTORY
> +	bool "Custom directory"
> +	help
> +	  This option allows Buildroot to use the Linux kernel source
> +	  code from an existing directory.
> +
>  endchoice
>  
>  config BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE
> @@ -97,6 +103,10 @@ 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_LOCATION
> +	string "Path of the custom kernel source"
> +	depends on BR2_LINUX_KERNEL_CUSTOM_DIRECTORY
> +
>  if BR2_LINUX_KERNEL_CUSTOM_GIT || BR2_LINUX_KERNEL_CUSTOM_HG || BR2_LINUX_KERNEL_CUSTOM_SVN
>  
>  config BR2_LINUX_KERNEL_CUSTOM_REPO_URL
> diff --git a/linux/linux.mk b/linux/linux.mk
> index bd5589bae02d..192fd0d3ffb3 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -29,6 +29,9 @@ LINUX_SITE_METHOD = hg
>  else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_SVN),y)
>  LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
>  LINUX_SITE_METHOD = svn
> +else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_DIRECTORY),y)
> +LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DIRECTORY_LOCATION))
> +LINUX_SITE_METHOD = local
>  else ifeq ($(BR2_LINUX_KERNEL_LATEST_CIP_VERSION),y)
>  LINUX_SITE = git://git.kernel.org/pub/scm/linux/kernel/git/bwh/linux-cip.git
>  else ifneq ($(findstring -rc,$(LINUX_VERSION)),)
> diff --git a/package/linux-headers/linux-headers.mk b/package/linux-headers/linux-headers.mk
> index f1e379060834..e42af8a4d672 100644
> --- a/package/linux-headers/linux-headers.mk
> +++ b/package/linux-headers/linux-headers.mk
> @@ -26,6 +26,9 @@ LINUX_HEADERS_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
>  LINUX_HEADERS_SITE_METHOD = hg
>  # use same hg tarball as linux kernel
>  LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.gz
> +else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_DIRECTORY),y)
> +LINUX_HEADERS_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DIRECTORY_LOCATION))
> +LINUX_HEADERS_SITE_METHOD = local
>  else
>  LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.xz
>  # In X.Y.Z, get X and Y. We replace dots and dashes by spaces in order
> @@ -122,6 +125,7 @@ define LINUX_HEADERS_INSTALL_STAGING_CMDS
>  			headers_install)
>  endef
>  
> +ifneq ($(BR2_LINUX_KERNEL_CUSTOM_DIRECTORY),y)
>  ifeq ($(BR2_KERNEL_HEADERS_VERSION)$(BR2_KERNEL_HEADERS_AS_KERNEL),y)
>  define LINUX_HEADERS_CHECK_VERSION
>  	$(call check_kernel_headers_version,\
> @@ -130,5 +134,6 @@ define LINUX_HEADERS_CHECK_VERSION
>  endef
>  LINUX_HEADERS_POST_INSTALL_STAGING_HOOKS += LINUX_HEADERS_CHECK_VERSION
>  endif
> +endif
>  
>  $(eval $(generic-package))
> -- 
> 2.7.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2017-10-29  7:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-29  2:06 [Buildroot] [RFC 0/2] Add support for specifying a custom kernel directory Florian Fainelli
2017-10-29  2:06 ` [Buildroot] [RFC 1/2] pkg-generic: Don't check for trailing slashes for local method Florian Fainelli
2017-10-29  2:06 ` [Buildroot] [RFC 2/2] linux: Add support for specifying a custom directory Florian Fainelli
2017-10-29  7:26   ` Yann E. MORIN [this message]
2017-10-29  9:12     ` Thomas Petazzoni
2017-10-29 17:26       ` Florian Fainelli
2017-10-29 18:12         ` Yann E. MORIN
2017-10-30  3:27           ` Florian Fainelli
2017-10-30 22:32             ` Yann E. MORIN
2017-11-03  5:03               ` Florian Fainelli
2017-11-03  7:04                 ` Yann E. MORIN
2017-11-03  9:23                 ` Thomas Petazzoni
2017-10-29  7:33 ` [Buildroot] [RFC 0/2] Add support for specifying a custom kernel directory Yann E. MORIN
2017-10-29 17:10   ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171029072649.GA2899@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox