From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] linux: don't add to toolchain dependency
Date: Tue, 01 Mar 2016 09:47:19 +0100 [thread overview]
Message-ID: <87mvqimvoo.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20160224150409.0113e34c@free-electrons.com> (Thomas Petazzoni's message of "Wed, 24 Feb 2016 15:04:09 +0100")
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
Hi,
>> So it's not as innocent as you think.
> I agree. In the end, I believe the mistake is to have linux-headers
> depends on linux.
> I continue to believe that it's much easier to duplicate in
> linux-headers the 10-20 lines of linux.mk logic that infer the
> _SOURCE/_SITE/_VERSION from the BR2_LINUX_KERNEL_* variables.
> Yes, it means we will extract the kernel sources twice, but when you're
> building an internal toolchain, this is really negligible.
> And this way, we break the dependency from linux-headers on linux, and
> the problem is solved.
> Something along the lines of (quickly tested) of the following patch.
> Yes, we duplicate logic, but we don't change this logic every day, so
> maybe it's acceptable.
Yes, I think this is the safest solution for 2016.02.
> diff --git a/package/linux-headers/linux-headers.mk b/package/linux-headers/linux-headers.mk
> index 6339280..ad31e55 100644
> --- a/package/linux-headers/linux-headers.mk
> +++ b/package/linux-headers/linux-headers.mk
> @@ -9,14 +9,63 @@
> ifeq ($(BR2_KERNEL_HEADERS_AS_KERNEL),y)
> -LINUX_HEADERS_VERSION = none
> -LINUX_HEADERS_SOURCE =
> +LINUX_HEADERS_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
> +
> +# Compute LINUX_SOURCE and LINUX_SITE from the configuration
This should be LINUX_HEADERS_SOURCE/SITE ;)
> +ifeq ($(BR2_LINUX_KERNEL_CUSTOM_TARBALL),y)
> +LINUX_HEADERS_TARBALL = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION))
> +LINUX_HEADERS_SITE = $(patsubst %/,%,$(dir $(LINUX_HEADERS_TARBALL)))
> +LINUX_HEADERS_SOURCE = $(notdir $(LINUX_HEADERS_TARBALL))
> +BR_NO_CHECK_HASH_FOR += $(LINUX_HEADERS_SOURCE)
> +else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_LOCAL),y)
> +LINUX_HEADERS_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_LOCAL_PATH))
> +LINUX_HEADERS_SITE_METHOD = local
> +else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
> +LINUX_HEADERS_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
> +LINUX_HEADERS_SITE_METHOD = git
> +else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_HG),y)
> +LINUX_HEADERS_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
> +LINUX_HEADERS_SITE_METHOD = hg
It's a bit painful to git/hg clone a kernel tree twice, so I've added
LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.gz
To both of these so the download infrastructure knows it is the same
data and doesn't try to do it twice.
> +else
> +LINUX_HEADERS_SOURCE = linux-$(LINUX_VERSION).tar.xz
This should really be LINUX_HEADERS_VERSION to not rely on the internal
linux.mk symbols.
Other than that I have verified that this logic is identical with the
code in linux.mk after s/LINUX_HEADERS_/LINUX_.
Committed, thanks.
--
Bye, Peter Korsgaard
prev parent reply other threads:[~2016-03-01 8:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 11:40 [Buildroot] [PATCH] linux: don't add to toolchain dependency Gustavo Zacarias
2016-02-22 12:19 ` Thomas Petazzoni
2016-02-23 23:55 ` Arnout Vandecappelle
2016-02-24 13:02 ` Gustavo Zacarias
2016-02-24 14:04 ` Thomas Petazzoni
2016-03-01 8:47 ` Peter Korsgaard [this message]
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=87mvqimvoo.fsf@dell.be.48ers.dk \
--to=peter@korsgaard.com \
--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