Patchwork [1/1] QA_check: special case kernel modules for x32 targets

login
register
mail settings
Submitter Nitin A Kamble
Date March 4, 2014, 6:28 p.m.
Message ID <a63693d8974ab55ba1031cf36302f28c4cc86c22.1393957379.git.nitin.a.kamble@intel.com>
Download mbox | patch
Permalink /patch/67973/
State New
Headers show

Comments

Nitin A Kamble - March 4, 2014, 6:28 p.m.
From: Nitin A Kamble <nitin.a.kamble@intel.com>

The Kernel module packages for x32 target have 64 bit binaries, which
breaks the QA_check expecting all the packages to be 32bit.

Make a special case for kernel module packages for x32 targets, to avoid
this false error.

Fixes Bug:
[YOCTO #5903]

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
---
 meta/classes/insane.bbclass | 4 ++--
 meta/classes/module.bbclass | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
Phil Blundell - March 4, 2014, 9:38 p.m.
On Tue, 2014-03-04 at 10:28 -0800, nitin.a.kamble@intel.com wrote:
> -        ("virtual/kernel" in provides) and (target_os == "linux-gnux32")):
> +        (("virtual/kernel" in provides) or (KERNEL_MODULE_RECIPE == "1")) and (target_os == "linux-gnux32")):

Can you not use bb.data.inherits_class("module") rather than adding this
extra variable?

Also, out of curiosity, I don't entirely understand how the code above
can possibly work.  KERNEL_MODULE_RECIPE is a bitbake variable that's
either defined to 1 or not defined at all, right?  Is there some special
magic nowadays that allows you to refer to it transparently from python
code without using d.getVar()?

p.
Nitin A Kamble - March 4, 2014, 10:26 p.m.
On 3/4/2014 1:38 PM, Phil Blundell wrote:
> On Tue, 2014-03-04 at 10:28 -0800, nitin.a.kamble@intel.com wrote:
>> -        ("virtual/kernel" in provides) and (target_os == "linux-gnux32")):
>> +        (("virtual/kernel" in provides) or (KERNEL_MODULE_RECIPE == "1")) and (target_os == "linux-gnux32")):
> Can you not use bb.data.inherits_class("module") rather than adding this
> extra variable?
This would simplify the code.
> Also, out of curiosity, I don't entirely understand how the code above
> can possibly work.  KERNEL_MODULE_RECIPE is a bitbake variable that's
> either defined to 1 or not defined at all, right?  Is there some special
> magic nowadays that allows you to refer to it transparently from python
> code without using d.getVar()?
There is no such special magic. This fix need to be fixed.

Thanks,
Nitin

> p.
>
>

Patch

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index cf00e12..4d3916d 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -443,11 +443,11 @@  def package_qa_check_arch(path,name,d, elf, messages):
 
     # Check the architecture and endiannes of the binary
     if not ((machine == elf.machine()) or \
-        ("virtual/kernel" in provides) and (target_os == "linux-gnux32")):
+        (("virtual/kernel" in provides) or (KERNEL_MODULE_RECIPE == "1")) and (target_os == "linux-gnux32")):
         messages.append("Architecture did not match (%d to %d) on %s" % \
                  (machine, elf.machine(), package_qa_clean_path(path,d)))
     elif not ((bits == elf.abiSize()) or  \
-        ("virtual/kernel" in provides) and (target_os == "linux-gnux32")):
+        (("virtual/kernel" in provides) or (KERNEL_MODULE_RECIPE == "1")) and (target_os == "linux-gnux32")):
         messages.append("Bit size did not match (%d to %d) %s on %s" % \
                  (bits, elf.abiSize(), bpn, package_qa_clean_path(path,d)))
     elif not littleendian == elf.isLittleEndian():
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
index ad6f7af..de1d97b 100644
--- a/meta/classes/module.bbclass
+++ b/meta/classes/module.bbclass
@@ -1,4 +1,5 @@ 
 DEPENDS += "virtual/kernel"
+KERNEL_MODULE_RECIPE = "1"
 
 inherit module-base kernel-module-split