Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Bruce Ashfield <bruce.ashfield@windriver.com>
Cc: openembedded-core@lists.openembedded.org, saul.wold@intel.com
Subject: Re: [PATCH 1/1] linux-libc-headers: provide 3.0.x and 3.1 headers
Date: Wed, 26 Oct 2011 22:01:15 +0100	[thread overview]
Message-ID: <1319662875.12054.7.camel@ted> (raw)
In-Reply-To: <0ec24ded3f71c54e544d953de65d142717f48022.1319652972.git.bruce.ashfield@windriver.com>

On Wed, 2011-10-26 at 14:25 -0400, Bruce Ashfield wrote:
> This changes makes two different 3.x headers available to the
> toolchain. The latest 3.0.x and 3.1 tarballs. Compatibility is
> maintained with older 2.6 headers by creating a new variable
> that changes the SRC_URI based on the major version number of
> the kernel.
> 
> Tested with 2.6.37.2, 3.0.8 and 3.1 builds and boots.
> 
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> ---
>  meta/conf/distro/include/tcmode-default.inc        |    2 +-
>  .../linux-libc-headers/linux-libc-headers.inc      |   15 +++++-
>  .../linux-libc-headers/linux-libc-headers_3.0.8.bb |   53 ++++++++++++++++++++
>  .../linux-libc-headers/linux-libc-headers_3.1.bb   |   53 ++++++++++++++++++++
>  4 files changed, 120 insertions(+), 3 deletions(-)
>  create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers_3.0.8.bb
>  create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers_3.1.bb
> 
> diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
> index 2bf1beb..ed722be 100644
> --- a/meta/conf/distro/include/tcmode-default.inc
> +++ b/meta/conf/distro/include/tcmode-default.inc
> @@ -21,7 +21,7 @@ SDKGCCVERSION ?= "4.6%"
>  BINUVERSION ?= "2.21.1a"
>  EGLIBCVERSION ?= "2.13"
>  UCLIBCVERSION ?= "0.9.32"
> -LINUXLIBCVERSION ?= "2.6.37.2"
> +LINUXLIBCVERSION ?= "3.1"
>  
>  # Temporary preferred version overrides for PPC
>  PREFERRED_VERSION_u-boot-mkimage-native_powerpc ?= "2009.08"
> diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
> index 014024f..4e874fe 100644
> --- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
> +++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
> @@ -1,9 +1,20 @@
> -DESCRIPTION = "Sanitized set of 2.6 kernel headers for the C library's use."
> +DESCRIPTION = "Sanitized set of kernel headers for the C library's use."
>  SECTION = "devel"
>  LICENSE = "GPLv2"
>  
>  LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" 
> -SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v2.6/linux-${PV}.tar.bz2"
> +
> +python __anonymous () {
> +    import bb, re, string
> +
> +    major = bb.data.getVar("PV",d,1).split('.')[0]
> +    if major == "3":
> +        bb.data.setVar("HEADER_FETCH_VER", "3.0", d)
> +    else:
> +        bb.data.setVar("HEADER_FETCH_VER", "2.6", d)
> +}
> +

Just for reference, this kind of code whilst nice, does have a
reasonable amount of overhead. For something which is effectively legacy
setting MAJORVERSION = "3.0" in the recipe probably isn't a big deal.

Also, please do d.getVar("PV", True) instead of the above. The "1" is
bad and should be "True" and its neater to access d's getVar method
directly now. I appreciate there is a lot of older code but any new code
should use this approach.

There is also no need to import string (since its unused) and bb above
(since its already always included).

In answer to your other question, its probably safe to drop the older
versions and switch to 3.1 at this point unless there are known
compatibility issues?

My other comment about moving code to the .inc also stands and I didn't
intend to sound as grumpy as it does when I read it back!

Cheers,

Richard




  parent reply	other threads:[~2011-10-26 21:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-26 18:25 [PATCH 0/1] RFC: provide 3.0.x and 3.1 libc headers Bruce Ashfield
2011-10-26 18:25 ` [PATCH 1/1] linux-libc-headers: provide 3.0.x and 3.1 headers Bruce Ashfield
2011-10-26 20:25   ` Richard Purdie
2011-10-26 20:26     ` Bruce Ashfield
2011-10-26 21:01   ` Richard Purdie [this message]
2011-10-26 21:14     ` Anders Darander
2011-10-26 21:18       ` Anders Darander
2011-10-27  0:53     ` Bruce Ashfield

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=1319662875.12054.7.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bruce.ashfield@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=saul.wold@intel.com \
    /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