<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>4993</bug_id>
          
          <creation_ts>2013-08-07 17:37:12 +0000</creation_ts>
          <short_desc>Kernel module package naming</short_desc>
          <delta_ts>2013-09-30 18:02:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>kernel</component>
          <version>1.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.5 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yang Shi">yang.shi</reporter>
          <assigned_to name="Mark Hatle">mark.hatle</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>bruce.ashfield</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>tom.zanussi</cc>
    
    <cc>yang.shi</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>35468</commentid>
    <comment_count>0</comment_count>
    <who name="Yang Shi">yang.shi</who>
    <bug_when>2013-08-07 17:37:12 +0000</bug_when>
    <thetext>I&apos;m building hello-mod package to run my multilib test. During my test, I found module-split generates kernel-module-hello package (naming style is &quot;kernel-module-&quot; + ${moudle_name}). And, the real kernel module file is included in this package.

So, is this the right or expected behavior to have kernel module package named with module name (kernel-module-hello) rather than the package name (kernel-module-hello-mod)? Isn&apos;t the multilib name, and &apos;regular&apos; name for a kernel module package supposed to be identical?

In this case, when building hello-mod package, there will be two packages generated:

kernel-module-hello-0.1-r0.4.intel_xeon_core.rpm
hello-mod-0.1-r0.4.intel_xeon_core.rpm

The real .ko file is in the first package, the second on is actually empty.

And, when run multilib build, like lib32, multilib build will skip kernel-module-hello-0.1-r0.4.intel_xeon_core.rpm, but still need lib32-hello-mod.

The workaround is to rename hello-mod to kernel-module-hello-mod.

But, it sounds this package should be generated by default rather than kernel-module-hello.

The kernel module package naming problem is caused by commit:

commit 51928b6b5ca0a46a9dcd754483a19af58b95fa18
Author: Martin Jansa &lt;martin.jansa@gmail.com&gt;
Date:   Sat Mar 2 18:06:56 2013 +0100

    kernel: extract functions for kernel modules to separate bbclass

    * this way we can reuse the same functionality also for external modules
      including module_autoload_foo and module_conf_foo functionality
    * MODULE_PACKAGES variable was removed (splited modules are now returned
      by do_split_packages
    * KERNEL_MODULES_META_PACKAGE is used to append all splitted packages
      to RDEPENDS. In kernel.bbclass it&apos;s old &quot;kernel-modules&quot; in
      module.bbclass it defaults to ${PN} for upgrade path from
      single PN with all modules to PN depending on all new kernel-module-*

    Signed-off-by: Martin Jansa &lt;Martin.Jansa@gmail.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35498</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-08-08 15:55:39 +0000</bug_when>
    <thetext>Producing split module packages named kernel-module-* and another package which depends upon all of the split kernel modules is correct, that&apos;s what the patch you link to is intended to do. However, I do wonder which branch you are building because Mark added a workaround for the multilib package renaming recently:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=71aafc214fe407b7620e747c11dfb8326c867b1c

Ideally this is something that would be handled automatically rather than having to be done within each external module recipe though. I&apos;m also a little bit puzzled as to why there still seems to be a reference within the system to lib32-hello-mod which to my mind shouldn&apos;t really exist.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35500</commentid>
    <comment_count>2</comment_count>
    <who name="Yang Shi">yang.shi</who>
    <bug_when>2013-08-08 16:48:06 +0000</bug_when>
    <thetext>Thanks Paul. I&apos;m trying to get a common fix based on Mark&apos;s workaround. I can workaround this by moving Mark&apos;s fix to module.bbclass.

When I ran the test, I found there are two packages name start with &quot;kernel-module-&quot;, i.e.

kernel-module-hello-0.1-r0.4.intel_xeon_core.rpm
kernel-module-hello-mod-0.1-r0.4.intel_xeon_core.rpm

The first one is generated by module-split, the second one is generated by that workaround.

So, even though there is kernel-module-hello-0.1-r0.4.intel_xeon_core.rpm, but multilib build is still seeking &quot;lib32-hello-mod&quot; without that workaround.

By the implementation of multilib, kernel-module-hello-0.1-r0.4.intel_xeon_core.rpm is not enough to make multilib build happy, &quot;kernel-module-&quot; + ${PN} is still needed.

If this is not a bug, then that workaround should be considered as a fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35511</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-08-08 17:25:55 +0000</bug_when>
    <thetext>I think Mark&apos;s workaround is really just a workaround. If we want a proper fix for this then I would have thought the best option would be to have a way of excluding packages such as &quot;hello-mod&quot; explicitly from multilib processing. I&apos;m not quite sure how that will work but I&apos;m looking into it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35513</commentid>
    <comment_count>4</comment_count>
    <who name="Yang Shi">yang.shi</who>
    <bug_when>2013-08-08 17:50:53 +0000</bug_when>
    <thetext>We can move Mark&apos;s workaround to higher level bbclass, like module.bbclass since every out-of-tree module packages inherits module.bbclass. It will make the renaming (hello-mod to kernel-module-hello-mod) automatically.
Or we should create a new or look for an existing flag to make multilib build skip those packages with that flag.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35515</commentid>
    <comment_count>5</comment_count>
    <who name="Yang Shi">yang.shi</who>
    <bug_when>2013-08-08 18:04:24 +0000</bug_when>
    <thetext>Actually, in current implementation of module.bblcass and module-split, when you build hello-mod, you will get:

kernel-module-hello.rpm (includes the .ko file, generated by module-split)
hello-mod.rpm (the empty package, generated by module.bbclass)

So, if we add PKG_${PN} = &quot;kernel-module-${PN}&quot; into module.bbclass, it will rename hello-mod.rpm (or any out-of-tree module package which inherits module.bbclass) to kernel-module-hello-mod to make multilib build happy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35516</commentid>
    <comment_count>6</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-08-08 18:06:55 +0000</bug_when>
    <thetext>I think that will cause problems if ${PN} happens to collide with the name of a module that is produced (which is not unlikely).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35518</commentid>
    <comment_count>7</comment_count>
    <who name="Yang Shi">yang.shi</who>
    <bug_when>2013-08-08 18:55:08 +0000</bug_when>
    <thetext>Yes, the &quot;kernel-module-&quot; package which has the real .ko file will be overwritten by &quot;kernel-modue-&quot; + ${PN}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35520</commentid>
    <comment_count>8</comment_count>
    <who name="Yang Shi">yang.shi</who>
    <bug_when>2013-08-08 19:07:35 +0000</bug_when>
    <thetext>Or we can rename it to &quot;kernel-module-meta-&quot; + {PN}, there won&apos;t be conflict when the package has the same name with the module. And, this also can make multilib build happy.

I works, but may not be perfect. Does anyone care about the name of that rpm which is empty actually?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35546</commentid>
    <comment_count>9</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-08-09 14:16:31 +0000</bug_when>
    <thetext>Using kernel-module-meta-${PN} seems a reasonable workaround to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35561</commentid>
    <comment_count>10</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2013-08-09 22:44:50 +0000</bug_when>
    <thetext>I&apos;ve figured out what is happening.  The package remapping code between the multilib bbclass and what occurs in the image.bbclass are happening at different times (or not at all).

What is happening, when calling lib32-image (assuming &apos;c&apos; in the module)

image.bbclass: runtime_mapping PACKAGE_INSTALL = a b c
multilib.bbclass: multilib rename PACKAGE_INSTALL = lib32-a lib32-b lib32-c

What we want is:

multilib.bbclass: multilib rename PACKAGE_INSTALL = lib32-a lib32-b lib32-c
image.bbclass: runtime_mapping PACKAGE_INSTALL = lib32-a lib32-b c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36995</commentid>
    <comment_count>11</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-09-19 15:47:07 +0000</bug_when>
    <thetext>Has this issue now been addressed? The patches have been merged to master at least:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=0bc564af07c1bae8112f834a60aea3b72af7de13
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=0e78c2931397f5a6811119ad33c9f95975aef8b7
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8b075050e4889e0a06d6d7d01b28b8645d2f2af5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37369</commentid>
    <comment_count>12</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-09-30 18:02:44 +0000</bug_when>
    <thetext>Marking this one resolved as per above.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>