Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Andreas Oberritter <obi@opendreambox.org>
To: openembedded-devel@lists.openembedded.org
Subject: Re: [PATCHv2] kernel/module-base: Append PR to	MACHINE_KERNEL_PR
Date: Mon, 04 Apr 2011 17:14:38 +0200	[thread overview]
Message-ID: <4D99E05E.9020100@opendreambox.org> (raw)
In-Reply-To: <inciqg$3vi$2@dough.gmane.org>

On 04/04/2011 03:58 PM, Koen Kooi wrote:
> On 04-04-11 15:00, Andreas Oberritter wrote:
>> Ping. Any votes for or against this patch with either appended or
>> prepended PR?
> 
> I don't like this patch *at all*. Recipes can already do
> MACHINE_KERNEL_PR_append = "something" if they need to.

The use of MACHINE_KERNEL_PR is optional, so it feels really wrong to
append something to it in a recipe.

> Can you should me a specific example on how this would be an improvement?

With the version below. a distro can start to use MACHINE_KERNEL_PR any
time without breaking updates.

The vast majority of modules do not use MACHINE_KERNEL_PR, as the
following numbers can tell (from 2011.03-maintenance):

$ git grep 'inherit.*module' | grep -v ^linux/ | wc -l
111
$ git grep 'MACHINE_KERNEL_PR' | grep -v ^linux/ | wc -l
33
$ git grep 'MACHINE_KERNEL_PR_' | grep -v ^linux/ | wc -l
10

Of the 33 recipes, 32 are directly related to TI, AFAICT. So, besides
TI, nobody is using MACHINE_KERNEL_PR in recipes at all, with
open-iscsi-kernel being the only exception.

Only 10 of the 33 recipes use MACHINE_KERNEL_PR_append. The other 23
users use the variable to set PR inside the recipe, which indicates that
they don't inherit module-base.bbclass.

In other words, 101 of 111 or about 91% of all recipes inheriting
module-base.bbclass currently won't rebuild automatically when their PR
gets incremented and the distro uses MACHINE_KERNEL_PR.

Regards,
Andreas

>> On 03/24/2011 05:14 PM, Andreas Oberritter wrote:
>>> Based on http://comments.gmane.org/gmane.comp.handhelds.openembedded/42905
>>>
>>> Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
>>> CC: Denis Dydychkin <nyrl@mail.ru>
>>> CC: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
>>> ---
>>> v2: Move code to machine-kernel-pr.bbclass, to avoid duplication and to
>>>     allow other recipes to inherit it. This is useful for tasks which
>>>     depend on different kernel modules for different kernel versions,
>>>     e.g. madwifi-ng for old kernels, but ath5k for new kernels.
>>>
>>>  classes/kernel.bbclass            |    7 ++-----
>>>  classes/machine-kernel-pr.bbclass |   15 +++++++++++++++
>>>  classes/module-base.bbclass       |   11 ++---------
>>>  3 files changed, 19 insertions(+), 14 deletions(-)
>>>  create mode 100644 classes/machine-kernel-pr.bbclass
>>>
>>> diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
>>> index 0109ce6..0187fb3 100644
>>> --- a/classes/kernel.bbclass
>>> +++ b/classes/kernel.bbclass
>>> @@ -20,13 +20,10 @@ python __anonymous () {
>>>      image = bb.data.getVar('INITRAMFS_IMAGE', d, True)
>>>      if image:
>>>          bb.data.setVar('INITRAMFS_TASK', '${INITRAMFS_IMAGE}:do_rootfs', d)
>>> -
>>> -    machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True)
>>> -
>>> -    if machine_kernel_pr:
>>> -       bb.data.setVar('PR', machine_kernel_pr, d)
>>>  }
>>>  
>>> +inherit machine-kernel-pr
>>> +
>>>  INITRAMFS_IMAGE ?= ""
>>>  INITRAMFS_TASK ?= ""
>>>  
>>> diff --git a/classes/machine-kernel-pr.bbclass b/classes/machine-kernel-pr.bbclass
>>> new file mode 100644
>>> index 0000000..a72a0c0
>>> --- /dev/null
>>> +++ b/classes/machine-kernel-pr.bbclass
>>> @@ -0,0 +1,15 @@
>>> +# A machine.conf or local.conf can increase MACHINE_KERNEL_PR to force
>>> +# rebuilds for kernel and external modules
>>> +python __anonymous () {
>>> +    machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True)
>>> +    if machine_kernel_pr:
>>> +       # Append
>>> +       # a) .X, if the recipe's PR is rX, or
>>> +       # b) +${PR}, if the recipe's PR doesn't begin with r
>>> +       pr = bb.data.getVar('PR', d, True)
>>> +       if pr.startswith('r'):
>>> +               suffix = '.' + pr[1:]
>>> +       else:
>>> +               suffix = '+' + pr
>>> +       bb.data.setVar('PR', machine_kernel_pr + suffix, d)
>>> +}
>>> diff --git a/classes/module-base.bbclass b/classes/module-base.bbclass
>>> index 9aaaa4e..1a97955 100644
>>> --- a/classes/module-base.bbclass
>>> +++ b/classes/module-base.bbclass
>>> @@ -2,18 +2,11 @@ inherit module_strip
>>>  
>>>  inherit kernel-arch
>>>  
>>> +inherit machine-kernel-pr
>>> +
>>>  export OS = "${TARGET_OS}"
>>>  export CROSS_COMPILE = "${TARGET_PREFIX}"
>>>  
>>> -# A machine.conf or local.conf can increase MACHINE_KERNEL_PR to force
>>> -# rebuilds for kernel and external modules
>>> -python __anonymous () {
>>> -    machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True)
>>> -
>>> -    if machine_kernel_pr:
>>> -       bb.data.setVar('PR', machine_kernel_pr, d)
>>> -}
>>> -
>>>  export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}"
>>>  export KERNEL_SOURCE = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-source')}"
>>>  KERNEL_OBJECT_SUFFIX = "${@[".o", ".ko"][base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion') > "2.6.0"]}"
> 

_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel




  reply	other threads:[~2011-04-04 15:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-20  9:59 MACHINE_KERNEL_PR overrides PR for modules Denis Dydychkin
2011-02-20 10:40 ` Graeme Gregory
2011-02-20 11:26 ` Frans Meulenbroeks
2011-03-24 15:37   ` Andreas Oberritter
2011-03-24 16:00     ` Michael Smith
2011-03-24 16:22       ` Andreas Oberritter
2011-03-24 15:37   ` [PATCH] kernel/module-base: Append PR to MACHINE_KERNEL_PR Andreas Oberritter
2011-03-24 16:14     ` [PATCHv2] " Andreas Oberritter
2011-04-04 13:00       ` Andreas Oberritter
2011-04-04 13:58         ` Koen Kooi
2011-04-04 15:14           ` Andreas Oberritter [this message]
2011-04-04 17:54             ` Koen Kooi
2011-04-04 18:12               ` Tom Rini
2011-04-04 18:12               ` Andreas Oberritter
2011-04-05  6:22                 ` Koen Kooi
2011-04-05  9:08                   ` Andreas Oberritter
2011-04-05  9:23                     ` Koen Kooi
2011-04-05  9:32                       ` Phil Blundell
2011-04-05 10:39                         ` Koen Kooi
2011-04-05 10:58                           ` Phil Blundell
2011-04-05 11:31                           ` Frans Meulenbroeks
2011-04-05 22:33                         ` Mike Westerhof

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=4D99E05E.9020100@opendreambox.org \
    --to=obi@opendreambox.org \
    --cc=openembedded-devel@lists.openembedded.org \
    /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