<?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>10434</bug_id>
          
          <creation_ts>2016-10-14 05:36:59 +0000</creation_ts>
          <short_desc>runqemu can not launch qemu image in Build Appliance</short_desc>
          <delta_ts>2016-12-23 01:33:50 +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>Runtime</product>
          <component>build-appliance</component>
          <version>2.2</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>Need backport to 2.2.1</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yi Zhao">yi.zhao</reporter>
          <assigned_to name="Juro Bystricky">juro.bystricky</assigned_to>
          <cc>jose.perez.carranza</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>yi.zhao</cc>
          
          <qa_contact name="Yi Zhao">yi.zhao</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</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>67254</commentid>
    <comment_count>0</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2016-10-14 05:36:59 +0000</bug_when>
    <thetext>git rev: master/371ab635086e2878ada1f00a59c7ec826481ba0a

Steps:
1. Launch the Build Appliance with vmplayer
2. Build a minimal image for qemux86-64
3. Run &quot;runqemu qemux86-64&quot; to boot up the qemu image

The image can not boot up and the following error occurs:
 
qemux86-64:~/poky/build$ runqemu qemux86-64
runqemu - INFO - Assuming MACHINE = qemux86-64
runqemu - INFO - Running MACHINE=qemux86-64 bitbake -e...
runqemu - INFO - MACHINE: qemux86-64
runqemu - INFO - DEPLOY_DIR_IMAGE: /home/builder/poky/build/tmp/deploy/images/qemux86-64
runqemu - INFO - Running ls -t /home/builder/poky/build/tmp/deploy/images/qemux86-64/*.qemuboot.conf...
runqemu - INFO - CONFFILE: /home/builder/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64-20161013112354.qemuboot.conf
runqemu - INFO - Continuing with the following parameters:

KERNEL: [/home/builder/poky/build/tmp/deploy/images/qemux86-64/bzImage]
MACHINE: [qemux86-64]
FSTYPE: [ext4]
ROOTFS: [/home/builder/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64-20161013112354.rootfs.ext4]
CONFFILE: [/home/builder/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64-20161013112354.qemuboot.conf]

runqemu - ERROR - In order for this script to dynamically infer paths
 kernels or filesystem images, you either need bitbake in your PATH
 or to source oe-init-build-env before running this script.

 Dynamic path inference can be avoided by passing a *.qemuboot.conf to
 runqemu, i.e. `runqemu /path/to/my-image-name.qemuboot.conf`

 runqemu-ifup, runqemu-ifdown or ip not found
qemux86-64:~/poky/build$</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67386</commentid>
    <comment_count>1</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-10-19 19:55:56 +0000</bug_when>
    <thetext>The problem is /sbin is not in PATH, so &quot;ip&quot; is not found.
&quot;ip&quot; is needed by the runqemu script. You can verify this by:

$ which ip 


Hence the error message: runqemu-ifup, runqemu-ifdown or ip not found

After 

$ export PATH=$PATH:/sbin

it is possible to run qemu, for example:

$ bitbake core-image-minimal
$ runqemu qemux86</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67425</commentid>
    <comment_count>2</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-10-20 17:44:49 +0000</bug_when>
    <thetext>Patch sent to the mailing list:
http://lists.openembedded.org/pipermail/openembedded-core/2016-October/127842.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67573</commentid>
    <comment_count>3</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-10-25 20:38:28 +0000</bug_when>
    <thetext>Patch merged to master:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=74f30e91bca1f6af3bef0ff9e652c0591013b412</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67629</commentid>
    <comment_count>4</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2016-10-27 08:42:58 +0000</bug_when>
    <thetext>This issue still exists in 2.2 rc6 build ( git rev: morty/dc8508f609974cc99606b9042bfa7f870ce80228)

And I filed a new bug 10504 for other issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67665</commentid>
    <comment_count>5</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-10-27 19:58:51 +0000</bug_when>
    <thetext>I believe I found the problem.
Verifying the fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67690</commentid>
    <comment_count>6</comment_count>
      <attachid>3509</attachid>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-10-27 22:08:27 +0000</bug_when>
    <thetext>Created attachment 3509
fixed patch, PATH as intended</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67691</commentid>
    <comment_count>7</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-10-27 22:08:43 +0000</bug_when>
    <thetext>The new problem was by the previous &quot;fix&quot;: When modifying the PATH variable in .bashrc, double quote characters were used, resulting in expanding the variable $PATH with the value of PATH of the system building the Build Appliance.

The original intent was to enter an un-expanded (literal) $PATH.
In order to that, one must use single quotes instead of double quotes.

Surprisingly, this corrupted PATH still allowed to build an image and run it in qemu within BA, so the problem was not detected early enough. However, the Build Appliance built by Auto Builder had a significantly more complex path so the problem was manifested immediately. 

I attached a new patch I am presently testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67770</commentid>
    <comment_count>8</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-10-28 22:24:17 +0000</bug_when>
    <thetext>Tested was successful, tested with

local.conf:
MACHINE = &quot;qemux86-64&quot;
$ bitbake build-appliance-image

Ran the resulting image in VirtualBox.
Once in VirtualBox, both terminals were present.
Verified proper PATH was exported.

ran

$ bitbake core-image-sato
$ runqemu qemux86

Correct sato image was built and subsequently displayed in qemu.


patch sent to the mailing list:
http://lists.openembedded.org/pipermail/openembedded-core/2016-October/128140.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68112</commentid>
    <comment_count>9</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-11-08 17:26:05 +0000</bug_when>
    <thetext>Fixed in oe-core 6238faf901956e2a350315a66ca1ce557deaa513.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69361</commentid>
    <comment_count>10</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2016-12-23 01:33:50 +0000</bug_when>
    <thetext>Verified with 2.3 M1 RC1 build
git rev: master/573c646d4cc62dcd0c230381df4940bdf314d495</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3509</attachid>
            <date>2016-10-27 22:08:27 +0000</date>
            <delta_ts>2016-10-27 22:08:27 +0000</delta_ts>
            <desc>fixed patch, PATH as intended</desc>
            <filename>commit-e78c45a</filename>
            <type>application/octet-stream</type>
            <size>1484</size>
            <attacher name="Juro Bystricky">juro.bystricky</attacher>
            
              <data encoding="base64">RnJvbSBlNzhjNDVh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