Patchwork kernel-yocto: fix diffconfig/kernel_configme breakage

login
register
mail settings
Submitter Christopher Larson
Date March 6, 2014, 6:10 p.m.
Message ID <1394129443-1427-1-git-send-email-kergoth@gmail.com>
Download mbox | patch
Permalink /patch/68163/
State New
Headers show

Comments

Christopher Larson - March 6, 2014, 6:10 p.m.
The bbclass did the following:

    do_diffconfig[depends] += "virtual/kernel:do_kernel_configme"

This clearly introduces a cross-kernel task dependency if the recipe
inheriting this class isn't the preferred provider of virtual/kernel, which is
obviously wrong, but further, will break the build if a kernel-yocto based
kernel is parsed and not skipped, but virtual/kernel refers to
a non-kernel-yocto recipe, which would not have the do_kernel_configme task.

Work around this by adding the in-recipe task dep programmatically with
bb.build.addtask when do_diffconfig exists.

Signed-off-by: Christopher Larson <kergoth@gmail.com>
---
 meta/classes/kernel-yocto.bbclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Bruce Ashfield - March 6, 2014, 6:40 p.m.
On Thu, Mar 6, 2014 at 1:10 PM, Christopher Larson <kergoth@gmail.com> wrote:
> The bbclass did the following:
>
>     do_diffconfig[depends] += "virtual/kernel:do_kernel_configme"
>
> This clearly introduces a cross-kernel task dependency if the recipe
> inheriting this class isn't the preferred provider of virtual/kernel, which is
> obviously wrong, but further, will break the build if a kernel-yocto based
> kernel is parsed and not skipped, but virtual/kernel refers to
> a non-kernel-yocto recipe, which would not have the do_kernel_configme task.
>
> Work around this by adding the in-recipe task dep programmatically with
> bb.build.addtask when do_diffconfig exists.
>
> Signed-off-by: Christopher Larson <kergoth@gmail.com>
> ---
>  meta/classes/kernel-yocto.bbclass | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
> index fb8e04e..ef9b9d1 100644
> --- a/meta/classes/kernel-yocto.bbclass
> +++ b/meta/classes/kernel-yocto.bbclass
> @@ -263,6 +263,8 @@ do_kernel_configme() {
>         echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
>  }
>
> +addtask kernel_configme after do_patch
> +

linux-yocto.inc already has:

addtask kernel_configme before do_configure after do_patch

So we should be able to avoid adding the task to the class, right ? I
suppose the task could move into the class, but it was always a per
recipe include in the past, I just don't want any unintended issues to
happen from the double task add.

>  python do_kernel_configcheck() {
>      import re, string, sys
>
> @@ -407,4 +409,8 @@ OE_TERMINAL_EXPORTS += "GUILT_BASE KBUILD_OUTPUT"
>  GUILT_BASE = "meta"
>  KBUILD_OUTPUT = "${B}"
>
> -do_diffconfig[depends] += "virtual/kernel:do_kernel_configme"
> +python () {
> +    # If diffconfig is available, ensure it runs after kernel_configme
> +    if 'do_diffconfig' in d:
> +        bb.build.addtask('do_diffconfig', None, 'do_kernel_configme', d)
> +}

Thanks for the fixup!

Bruce

> --
> 1.8.3.4
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Christopher Larson - March 6, 2014, 6:45 p.m.
On Thu, Mar 6, 2014 at 11:40 AM, Bruce Ashfield <bruce.ashfield@gmail.com>wrote:

> On Thu, Mar 6, 2014 at 1:10 PM, Christopher Larson <kergoth@gmail.com>
> wrote:
> > +addtask kernel_configme after do_patch
> > +
>
> linux-yocto.inc already has:
>
> addtask kernel_configme before do_configure after do_patch
>
> So we should be able to avoid adding the task to the class, right ? I
> suppose the task could move into the class, but it was always a per
> recipe include in the past, I just don't want any unintended issues to
> happen from the double task add.
>

It depends on whether there's a need to support the use of the class
without the .inc. If not, there are probably a number of bits in the .inc
that belong in the class :) But it's never harmful to have multiple addtask
lines, it just adds the specified deps to the existing task. I just wanted
to make sure one couldn't get into a state where do_diffconfig depends on a
function which isn't a task, as I would expect (though couldn't say with
100% certainty) that bitbake would yell about that :)
Bruce Ashfield - March 6, 2014, 8:55 p.m.
On Thu, Mar 6, 2014 at 1:45 PM, Chris Larson <kergoth@gmail.com> wrote:
>
> On Thu, Mar 6, 2014 at 11:40 AM, Bruce Ashfield <bruce.ashfield@gmail.com>
> wrote:
>>
>> On Thu, Mar 6, 2014 at 1:10 PM, Christopher Larson <kergoth@gmail.com>
>> wrote:
>> > +addtask kernel_configme after do_patch
>> > +
>>
>> linux-yocto.inc already has:
>>
>> addtask kernel_configme before do_configure after do_patch
>>
>> So we should be able to avoid adding the task to the class, right ? I
>> suppose the task could move into the class, but it was always a per
>> recipe include in the past, I just don't want any unintended issues to
>> happen from the double task add.
>
>
> It depends on whether there's a need to support the use of the class without
> the .inc. If not, there are probably a number of bits in the .inc that
> belong in the class :) But it's never harmful to have multiple addtask
> lines, it just adds the specified deps to the existing task. I just wanted
> to make sure one couldn't get into a state where do_diffconfig depends on a
> function which isn't a task, as I would expect (though couldn't say with
> 100% certainty) that bitbake would yell about that :)

Works for me. Thanks for the explanation.

Bruce

> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics

Patch

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index fb8e04e..ef9b9d1 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -263,6 +263,8 @@  do_kernel_configme() {
 	echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
 }
 
+addtask kernel_configme after do_patch
+
 python do_kernel_configcheck() {
     import re, string, sys
 
@@ -407,4 +409,8 @@  OE_TERMINAL_EXPORTS += "GUILT_BASE KBUILD_OUTPUT"
 GUILT_BASE = "meta"
 KBUILD_OUTPUT = "${B}"
 
-do_diffconfig[depends] += "virtual/kernel:do_kernel_configme"
+python () {
+    # If diffconfig is available, ensure it runs after kernel_configme
+    if 'do_diffconfig' in d:
+        bb.build.addtask('do_diffconfig', None, 'do_kernel_configme', d)
+}