<?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>11266</bug_id>
          
          <creation_ts>2017-03-29 15:19:30 +0000</creation_ts>
          <short_desc>runqemu: fails when rm_work is active</short_desc>
          <delta_ts>2017-04-25 05:52:14 +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>VERIFIED</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.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Chen Qi">Qi.Chen</assigned_to>
          <cc>anibal.limon</cc>
    
    <cc>eduard.bartosh</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>ross.burton</cc>
    
    <cc>yi.zhao</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>71864</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-03-29 15:19:30 +0000</bug_when>
    <thetext>To reproduce:
* add INHERIT += &quot;rm_work&quot; to local.conf
* build an image
* &quot;runqemu&quot; for that image

It fails with:

runqemu - INFO - Assuming MACHINE = intel-corei7-64
runqemu - INFO - Running MACHINE=intel-corei7-64 bitbake -e...
runqemu - INFO - MACHINE: intel-corei7-64
runqemu - INFO - DEPLOY_DIR_IMAGE: /fast/build/refkit/intel-corei7-64/tmp-glibc/deploy/images/intel-corei7-64
runqemu - INFO - CONFFILE: /fast/build/refkit/intel-corei7-64/tmp-glibc/deploy/images/intel-corei7-64/refkit-installer-image-intel-corei7-64.qemuboot.conf
runqemu - INFO - Overriding conf file setting of STAGING_DIR_NATIVE to /fast/build/refkit/intel-corei7-64/tmp-glibc/work/corei7-64-refkit-linux/defaultpkgname/1.0-r0/recipe-sysroot-native from Bitbake environment
runqemu - INFO - Overriding conf file setting of STAGING_BINDIR_NATIVE to /fast/build/refkit/intel-corei7-64/tmp-glibc/work/corei7-64-refkit-linux/defaultpkgname/1.0-r0/recipe-sysroot-native/usr/bin from Bitbake environment
runqemu - INFO - Continuing with the following parameters:

MACHINE: [intel-corei7-64]
FSTYPE: [wic]
...
runqemu - INFO - Running /bin/ip link...
runqemu - INFO - Setting up tap interface under sudo
runqemu - INFO - Acquiring lockfile /tmp/qemu-tap-locks/Error: Unable to find tunctl binary in &apos;/fast/build/refkit/intel-corei7-64/tmp-glibc/work/corei7-64-refkit-linux/defaultpkgname/1.0-r0/recipe-sysroot-native/usr/bin&apos;, please bitbake qemu-helper-native.lock...

It fails because the sysroot dirs of the image get removed by do_rm_work, causing the fallback code to get triggered:

        # If the STAGING_*_NATIVE directories from the config file don&apos;t exist
        # and we&apos;re in a sourced OE build directory try to extract the paths
        # from `bitbake -e`
        havenative = os.path.exists(self.get(&apos;STAGING_DIR_NATIVE&apos;)) and \
            os.path.exists(self.get(&apos;STAGING_BINDIR_NATIVE&apos;))

        if not havenative:
            &lt;broken code follows&gt;

That entire code section needs to be rewritten, it can no longer work with RSS.

Probably need to do something similar to wic-tools. Instead of installing the qemu tools into the sysroot of each image, install them into the sysroot of a shared recipe (qemu-tools?) and use them from there. Perhaps unify with how the qemu binary itself is handled? Just my 2 cents.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71982</commentid>
    <comment_count>1</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2017-03-31 22:27:11 +0000</bug_when>
    <thetext>*** Bug 11273 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72237</commentid>
    <comment_count>2</comment_count>
    <who name="Aníbal Limón">anibal.limon</who>
    <bug_when>2017-04-10 19:37:28 +0000</bug_when>
    <thetext>Chen, are you working on this or i can take it?

Anibal</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72253</commentid>
    <comment_count>3</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-04-10 21:05:27 +0000</bug_when>
    <thetext>Previously proposed fix was regected http://lists.openembedded.org/pipermail/openembedded-core/2017-April/135450.html

So, I&apos;m proposing new one:
http://lists.openembedded.org/pipermail/openembedded-core/2017-April/135464.html

Probably it&apos;s not optimal though as it prevents to remove native sysroots for  any image.

Better ideas are welcome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72255</commentid>
    <comment_count>4</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-04-10 21:08:09 +0000</bug_when>
    <thetext>*** Bug 11193 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72411</commentid>
    <comment_count>5</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-04-12 20:56:24 +0000</bug_when>
    <thetext>2nd attempt to fix this bug: http://lists.openembedded.org/pipermail/openembedded-core/2017-April/135615.html

This time qemu-helper-native is used to hold qemu-system and tunctl binaries.

Please, review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72472</commentid>
    <comment_count>6</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2017-04-13 15:19:55 +0000</bug_when>
    <thetext>The fix has been merged into master</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72807</commentid>
    <comment_count>7</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2017-04-25 05:52:14 +0000</bug_when>
    <thetext>Verified with 2.3 rc2 build
Git rev: master/7a0e795373653886452a7a2992ced10080711c26</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>