<?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>12855</bug_id>
          
          <creation_ts>2018-07-16 21:57:35 +0000</creation_ts>
          <short_desc>devtool modify fails on kernel recipes when using a recipe space kernel-meta</short_desc>
          <delta_ts>2018-08-16 18:32:32 +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>Scripts and Tools</component>
          <version>unspecified</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>2.6 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jaewon Lee">jaewon</reporter>
          <assigned_to name="Jaewon Lee">jaewon</assigned_to>
          <cc>alejandr</cc>
    
    <cc>bluelightning</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</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>81116</commentid>
    <comment_count>0</comment_count>
    <who name="Jaewon Lee">jaewon</who>
    <bug_when>2018-07-16 21:57:35 +0000</bug_when>
    <thetext>Using recipe space kernel-meta for our kernel, for example:
  
meta-my_bsp_layer/
     `-- recipes-kernel
         `-- linux
             `-- linux-yocto
                 |-- bsp-standard.scc
                 |-- bsp.cfg
                 `-- standard.cfg

If you run devtool modify virtual/kernel, we are running into an error:

ERROR: Could not generate configuration queue

and in the logs we see that it&apos;s because it couldn&apos;t find the source kmeta files which are used as inputs to generate the kernel config.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81117</commentid>
    <comment_count>1</comment_count>
    <who name="Jaewon Lee">jaewon</who>
    <bug_when>2018-07-16 22:00:00 +0000</bug_when>
    <thetext>After some debugging, we found that devtool-source.bbclass is moving local files to &quot;oe-local-files&quot; directory. The problem comes because in kernel-yocto.bbclass it&apos;s looking for the kmeta files in &quot;${WORKDIR}/$f&quot; when in this case it&apos;s actually in &quot;${WORKDIR}/../oe-local-files/$f&quot; (because devtool-source.bbclass moved it there)
If I change the code to look in that oe-local-files directory, or change devtool-source.bbclass to not move the kmeta files from workdir, the issue goes away. 

There seems to be a patch that solves a very similar issue: 
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=6e182aaa760c3be689e694e06d9ed0f4b66b1497


The problem remains after applying the patch however because the fix comes in after the 
if not res:
    raise DevtoolError(&apos;Extracting source for %s failed&apos; % pn)
line that is raising the error. 

res = tinfoil.build_targets(pn,
                            task,
                            handle_events=True)

and before this, the task is set to do_configure task if building kernel to make sure we are done with the source code and we can safely move everything to oe-local-files.
Usually this is okay on a normal kernel build because when we run do_configure we are not using any local files, but when we&apos;re using recipe space kernel-meta, do_kernel_configme is expecting the kernel to be in the recipe space.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81118</commentid>
    <comment_count>2</comment_count>
    <who name="Jaewon Lee">jaewon</who>
    <bug_when>2018-07-17 01:22:50 +0000</bug_when>
    <thetext>We see two possible solutions:

1. create softlinks from oe-local-files to workdir before we call do_configure task. This would require calling tinfoil twice, once for do_validate_branches, (just to unpack the sources) create the symlinks, and once to call do_configure to create the .config for that kernel

the other way is we avoid moving local files to oe-local-files only for the kernel (in devtool-source.bbclass). If required we can even populate the oe-local-files directory later after devtool extracts the source.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81128</commentid>
    <comment_count>3</comment_count>
    <who name="Jaewon Lee">jaewon</who>
    <bug_when>2018-07-17 21:40:17 +0000</bug_when>
    <thetext>Another option (maybe the simplest) is to add another check in kernel-yocto.bbclass  when adding to includes:

elif [ -d &quot;${WORKDIR}/../oe-local-files/$f&quot; ]; then
          includes=&quot;$includes -I${WORKDIR}/../oe-local-files/$f&quot;

which will add it from where devtool-source.bbclass moved it to in oe-local-files</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81129</commentid>
    <comment_count>4</comment_count>
    <who name="Alejandro Hernandez">alejandr</who>
    <bug_when>2018-07-17 21:43:27 +0000</bug_when>
    <thetext>Hello Jaewon,

(In reply to comment #3)
&gt; Another option (maybe the simplest) is to add another check in
&gt; kernel-yocto.bbclass  when adding to includes:
&gt; 
&gt; elif [ -d &quot;${WORKDIR}/../oe-local-files/$f&quot; ]; then
&gt;           includes=&quot;$includes -I${WORKDIR}/../oe-local-files/$f&quot;
&gt; 
&gt; which will add it from where devtool-source.bbclass moved it to in
&gt; oe-local-files

Does this affect any other workflow?, will this not cause any problems for people NOT using a recipe space kernel-meta?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81134</commentid>
    <comment_count>5</comment_count>
    <who name="Jaewon Lee">jaewon</who>
    <bug_when>2018-07-18 22:17:11 +0000</bug_when>
    <thetext>Hi Alejandro, (In reply to comment #4)
&gt; Hello Jaewon,
&gt; 
&gt; (In reply to comment #3)
&gt; &gt; Another option (maybe the simplest) is to add another check in
&gt; &gt; kernel-yocto.bbclass  when adding to includes:
&gt; &gt; 
&gt; &gt; elif [ -d &quot;${WORKDIR}/../oe-local-files/$f&quot; ]; then
&gt; &gt;           includes=&quot;$includes -I${WORKDIR}/../oe-local-files/$f&quot;
&gt; &gt; 
&gt; &gt; which will add it from where devtool-source.bbclass moved it to in
&gt; &gt; oe-local-files
&gt; 
&gt; Does this affect any other workflow?, will this not cause any problems for
&gt; people NOT using a recipe space kernel-meta?

doesn&apos;t seem like it will because it&apos;s an elif at the end of the block</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81397</commentid>
    <comment_count>6</comment_count>
    <who name="Jaewon Lee">jaewon</who>
    <bug_when>2018-08-16 18:32:32 +0000</bug_when>
    <thetext>patch merged
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=c0f9caeda5480968c5d05fdacde8f10676db5c51</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>