<?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>9805</bug_id>
          
          <creation_ts>2016-06-21 09:49:45 +0000</creation_ts>
          <short_desc>Signing keys not available when signing out-of-tree kernel modules</short_desc>
          <delta_ts>2016-09-05 10:05:40 +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>2.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</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>2.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mattias Waldo">mattias.waldo</reporter>
          <assigned_to name="Jianxun Zhang">jianxun.zhang</assigned_to>
          <cc>sgw</cc>
    
    <cc>tom.zanussi</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>63173</commentid>
    <comment_count>0</comment_count>
    <who name="Mattias Waldo">mattias.waldo</who>
    <bug_when>2016-06-21 09:49:45 +0000</bug_when>
    <thetext>When a kernel module built out-of-tree is installed, the module signing fails silently because the signing keys are not available in $kerneldir at install time. The key files need to be explicitly copied in a linux-yocto_4.4.bbappend file for the signing to work (see below).

To reproduce:

* Add meta-skeleton layer to bblayers.conf.
* Add &apos;IMAGE_INSTALL += &quot; hello-mod&quot;&apos; to local.conf.
* In any layer (e.g. meta-skeleton):
- Add a hello-mod_0.1.bbappend file containing &apos;INHIBIT_PACKAGE_STRIP = &quot;1&quot;&apos;.
- Add a linux-yocto_4.4.bbappend file that includes a .cfg file with the following kernel configuration modifications:
&apos;CONFIG_MODULE_SIG = &quot;y&quot;&apos;
&apos;CONFIG_MODULE_SIG_ALL = &quot;y&quot;&apos;
* Run &quot;bitbake hello-mod&quot;.
* Run &quot;hexdump -C &quot; on the newly created hello.ko file - there is no signing information at the end.
* Check the log.do_install log file for hello-mod: it states &quot;certs/signing_key.pem: No such file or directory&quot;.
* Add the following lines to the linux-yocto_4.4.bbappend file:
- do_shared_workdir_append() {
    cd ${B}
    mkdir $kerneldir/certs
    cp certs/signing_key.* $kerneldir/certs/
}
* Rebuild hello-mod
* Running hexdump again reveals the text &quot;Module signature appended&quot; at the end.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64934</commentid>
    <comment_count>1</comment_count>
    <who name="Jianxun Zhang">jianxun.zhang</who>
    <bug_when>2016-08-05 18:21:41 +0000</bug_when>
    <thetext>Hi Mattias,
I have&apos;t started troubleshooting this issue, just feel you are actually close to a final solution based on the workaround you provided.

Do you think you can have a patch to OE mailing list?
openembedded-core@lists.openembedded.org

Let me know if it is not the case and we will work on it from here.

Thanks lot!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65180</commentid>
    <comment_count>2</comment_count>
    <who name="Mattias Waldo">mattias.waldo</who>
    <bug_when>2016-08-15 06:24:43 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Hi Mattias,
&gt; I have&apos;t started troubleshooting this issue, just feel you are actually
&gt; close to a final solution based on the workaround you provided.
&gt; 
&gt; Do you think you can have a patch to OE mailing list?
&gt; openembedded-core@lists.openembedded.org
&gt; 
&gt; Let me know if it is not the case and we will work on it from here.
&gt; 
&gt; Thanks lot!
Hi!

I&apos;ve submitted a patch to the mailing list: https://patchwork.openembedded.org/patch/129137/

Regards,

Mattias</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65469</commentid>
    <comment_count>3</comment_count>
    <who name="Jianxun Zhang">jianxun.zhang</who>
    <bug_when>2016-08-24 00:42:36 +0000</bug_when>
    <thetext>I haven&apos;t seen feedbacks in OE mailing list, so I pinged Bruce in mail for the status of your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65797</commentid>
    <comment_count>4</comment_count>
    <who name="Mattias Waldo">mattias.waldo</who>
    <bug_when>2016-09-05 10:05:40 +0000</bug_when>
    <thetext>The patch was accepted and is now in the openembedded-core master branch.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>