<?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>12695</bug_id>
          
          <creation_ts>2018-04-18 20:15:04 +0000</creation_ts>
          <short_desc>runqemu doesn&apos;t work with builddir env setup script as host paths are filtered</short_desc>
          <delta_ts>2018-11-05 23:40:46 +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>oe-core other</component>
          <version>2.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>CLOSED</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.4.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chin Huat Ang">chin.huat.ang</reporter>
          <assigned_to name="Armin Kuster">akuster</assigned_to>
          <cc>akuster</cc>
    
    <cc>jkrishnanjanappa</cc>
    
    <cc>pravin.shankarx.patil</cc>
    
    <cc>ross.burton</cc>
    
    <cc>stephano</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>80310</commentid>
    <comment_count>0</comment_count>
    <who name="Chin Huat Ang">chin.huat.ang</who>
    <bug_when>2018-04-18 20:15:04 +0000</bug_when>
    <thetext>When eclipse-yocto plugin is configured to use toolchain from build dir, firing up QEMU using External Tool Configuration no longer works. It appears that runqemu won&apos;t work with env setup script in build dir as it does not preserve $PATH like it&apos;s SDK counterpart.

This can be reproduce easily by running runqemu after sourcing the build dir env setup script:


  cd $BUILDDIR &amp;&amp; sh -c &quot;. tmp/environment-setup-i586-poky-linux; runqemu&quot;


The error message looks like:


runqemu - INFO - Running bitbake -e...
runqemu - INFO - Continuing with the following parameters:

KERNEL: [/home/parallels/git/poky/build/tmp/deploy/images/qemux86/bzImage--4.14.30+git0+f8232ce8e9_1d50ce210b-r0-qemux86-20180413010012.bin]
MACHINE: [qemux86]
FSTYPE: [ext4]
ROOTFS: [/home/parallels/git/poky/build/tmp/deploy/images/qemux86/core-image-sato-qemux86-20180413124506.rootfs.ext4]
CONFFILE: [/home/parallels/git/poky/build/tmp/deploy/images/qemux86/core-image-sato-qemux86-20180413124506.qemuboot.conf]

/bin/sh: 1: stty: not found
Traceback (most recent call last):
  File &quot;/home/parallels/git/poky/scripts/runqemu&quot;, line 1291, in main
    config.setup_network()
  File &quot;/home/parallels/git/poky/scripts/runqemu&quot;, line 1014, in setup_network
    self.saved_stty = subprocess.check_output(&quot;stty -g&quot;, shell=True).decode(&apos;utf-8&apos;)
  File &quot;/usr/lib/python3.5/subprocess.py&quot;, line 626, in check_output
    **kwargs).stdout
  File &quot;/usr/lib/python3.5/subprocess.py&quot;, line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command &apos;stty -g&apos; returned non-zero exit status 127
Cleanup</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80312</commentid>
    <comment_count>1</comment_count>
    <who name="Chin Huat Ang">chin.huat.ang</who>
    <bug_when>2018-04-18 22:49:12 +0000</bug_when>
    <thetext>http://lists.openembedded.org/pipermail/openembedded-core/2018-April/150028.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80382</commentid>
    <comment_count>2</comment_count>
    <who name="Chin Huat Ang">chin.huat.ang</who>
    <bug_when>2018-04-23 16:24:29 +0000</bug_when>
    <thetext>http://lists.openembedded.org/pipermail/openembedded-core/2018-April/150111.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80393</commentid>
    <comment_count>3</comment_count>
    <who name="Chin Huat Ang">chin.huat.ang</who>
    <bug_when>2018-04-25 01:05:55 +0000</bug_when>
    <thetext>v2 patch in comment 2 is still incomplete as the PATH variable is missing path to build directory toolchain (STAGING_BINDIR_TOOLCHAIN).

v3 patch submitted: http://lists.openembedded.org/pipermail/openembedded-core/2018-April/150141.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80497</commentid>
    <comment_count>4</comment_count>
    <who name="Chin Huat Ang">chin.huat.ang</who>
    <bug_when>2018-05-06 20:08:59 +0000</bug_when>
    <thetext>Merged in master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=00302da3991ea7dea298f475091b35b6d73cefe1

Merged in sumo: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=sumo&amp;id=d7d6ef7df7e14872dd98883ba3a75c28a1c69947</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80764</commentid>
    <comment_count>5</comment_count>
      <attachid>4325</attachid>
    <who name="pravin">pravin.shankarx.patil</who>
    <bug_when>2018-06-12 09:08:59 +0000</bug_when>
    <thetext>Created attachment 4325
qemu launch log file</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80765</commentid>
    <comment_count>6</comment_count>
    <who name="pravin">pravin.shankarx.patil</who>
    <bug_when>2018-06-12 09:26:33 +0000</bug_when>
    <thetext>I am trying to launch qemu using  bitbake meta-ide-support built script.

Release- Yocto 2.4.3.rc2
commit id - 7e7ee662f5dea4d090293045f7498093322802cc 

following are the steps to reproduce the issue

1)take poky clone
2)cd poky and checkout with commit id
3)source oe-init-build-env
4)bitbake meta-ide-support( build for any architecture )
5)download the kernel and rootfs from following link
  https://autobuilder.yocto.io/pub/releases/yocto-2.4.3.rc2/machines/qemu/
 
7)runqemu-extract-sdk image.tar.bz2 rootfs/
8)runqemu vmlinux-qemuppc.bin rootfs core-image-sato-sdk-qemuppc.qemuboot.conf

after this command following logs are comming

runqemu vmlinux-qemuppc.bin rootfs core-image-sato-sdk-qemuppc.qemuboot.conf
runqemu - INFO - Running MACHINE=qemuppc bitbake -e...
runqemu - INFO - Overriding conf file setting of STAGING_DIR_NATIVE to /data/pravinsx/bsp/poky/adt/tmp/work/core2-64-poky-linux/defaultpkgname/1.0-r0/recipe-sysroot-native from Bitbake environment
runqemu - INFO - Continuing with the following parameters:

KERNEL: [/data/pravinsx/bsp/poky/adt/ppc/vmlinux-qemuppc.bin]
MACHINE: [qemuppc]
FSTYPE: [nfs]
NFS_DIR: [/data/pravinsx/bsp/poky/adt/ppc/rootfs]
CONFFILE: [/data/pravinsx/bsp/poky/adt/ppc/core-image-sato-sdk-qemuppc.qemuboot.conf]

/bin/sh: 1: stty: not found
Traceback (most recent call last):
  File &quot;/data/pravinsx/bsp/poky/scripts/runqemu&quot;, line 1270, in main
    config.setup_network()
  File &quot;/data/pravinsx/bsp/poky/scripts/runqemu&quot;, line 997, in setup_network
    self.saved_stty = subprocess.check_output(&quot;stty -g&quot;, shell=True).decode(&apos;utf-8&apos;)
  File &quot;/usr/lib/python3.5/subprocess.py&quot;, line 626, in check_output
    **kwargs).stdout
  File &quot;/usr/lib/python3.5/subprocess.py&quot;, line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command &apos;stty -g&apos; returned non-zero exit status 127
Cleanup</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80766</commentid>
    <comment_count>7</comment_count>
    <who name="pravin">pravin.shankarx.patil</who>
    <bug_when>2018-06-12 09:27:06 +0000</bug_when>
    <thetext>I have attached logs also</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80778</commentid>
    <comment_count>8</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-06-13 16:00:30 +0000</bug_when>
    <thetext>Following the steps in comment 6 I can&apos;t replicate this.

&quot;/bin/sh: 1: stty: not found&quot;

Do you just have a system without coreutils present?  That should be in /bin/stty.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80792</commentid>
    <comment_count>9</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-06-14 15:02:30 +0000</bug_when>
    <thetext>*** Bug 12784 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80793</commentid>
    <comment_count>10</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2018-06-14 15:10:41 +0000</bug_when>
    <thetext>Please review the question in comment 8</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80798</commentid>
    <comment_count>11</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-06-15 11:11:31 +0000</bug_when>
    <thetext>There&apos;s a lot of confusion in this and related bugs.

The original bug is due to the toolchain environment script blasting $PATH and this does appear to be still broken in 2.4.x.

However comment 6 isn&apos;t related to the toolchain and this works for me.  pravin, please verify your report and check that you have stty on your machine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80824</commentid>
    <comment_count>12</comment_count>
    <who name="pravin">pravin.shankarx.patil</who>
    <bug_when>2018-06-20 02:37:23 +0000</bug_when>
    <thetext>I have checked on my machine.
there is already present stty.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80921</commentid>
    <comment_count>13</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-06-25 15:49:47 +0000</bug_when>
    <thetext>Can you replicate the bug using the *exact* steps that are in comment 6?  Because I certainly can&apos;t.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80923</commentid>
    <comment_count>14</comment_count>
    <who name="Chin Huat Ang">chin.huat.ang</who>
    <bug_when>2018-06-25 22:46:03 +0000</bug_when>
    <thetext>Pravin, can you confirm that the missing Step 6 in comment 6 is sourcing tmp/environment-setup-* for 2.4.x earlier? The issue should be reproducible then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80926</commentid>
    <comment_count>15</comment_count>
    <who name="pravin">pravin.shankarx.patil</who>
    <bug_when>2018-06-26 02:09:40 +0000</bug_when>
    <thetext>Yes confirmed, I missed to write step 6. step 6 is source tmp/environment-setup-* for 2.4.x.
After that also issue is reproducible.
 
(In reply to comment #14)
&gt; Pravin, can you confirm that the missing Step 6 in comment 6 is sourcing
&gt; tmp/environment-setup-* for 2.4.x earlier? The issue should be reproducible
&gt; then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80981</commentid>
    <comment_count>16</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2018-06-29 15:05:31 +0000</bug_when>
    <thetext>The question appears to have been answered, if not please restate the question.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81403</commentid>
    <comment_count>17</comment_count>
    <who name="Jagadeesh Krishnanjanappa">jkrishnanjanappa</who>
    <bug_when>2018-08-17 11:00:50 +0000</bug_when>
    <thetext>Update:

I believe the issue observed by Pravin in comment 6, is same as the issue observed in the beginning of this bug.

Basically, the step 6 which is &quot;source tmp/environment-setup-*&quot; does not export the default binary directories of host machine. Due which &quot;stty&quot; was not found and returned with 127. The fix (http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=sumo&amp;id=d7d6ef7df7e14872dd98883ba3a75c28a1c69947) done for sumo should solve for rocko also, if back ported.

For quick verify:
After step 6, 

export PATH=$PATH:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/local/ferret/bin:/usr/bin:/usr/sbin:/usr/local/bin:/sbin

solve help us to confirm it.


Regards,
Jagadeesh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81416</commentid>
    <comment_count>18</comment_count>
    <who name="pravin">pravin.shankarx.patil</who>
    <bug_when>2018-08-23 10:03:36 +0000</bug_when>
    <thetext>I have verified on yocto-2.4.3.rc2 rocko branch.

I have applied following patch.
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=sumo&amp;id=d7d6ef7df7e14872dd98883ba3a75c28a1c69947)

now I am able to launch qemu.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81426</commentid>
    <comment_count>19</comment_count>
    <who name="Jagadeesh Krishnanjanappa">jkrishnanjanappa</who>
    <bug_when>2018-08-24 01:56:20 +0000</bug_when>
    <thetext>(In reply to comment #18)
&gt; I have verified on yocto-2.4.3.rc2 rocko branch.
&gt; 
&gt; I have applied following patch.
&gt; http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/
&gt; ?h=sumo&amp;id=d7d6ef7df7e14872dd98883ba3a75c28a1c69947)
&gt; 
&gt; now I am able to launch qemu.

Thanks for the confirmation.

Submitted the fix done for sumo to rocko also, at http://lists.openembedded.org/pipermail/openembedded-core/2018-August/154751.html

Regards,
Jagadeesh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81997</commentid>
    <comment_count>20</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2018-11-01 15:24:13 +0000</bug_when>
    <thetext>backported to rocko</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82018</commentid>
    <comment_count>21</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2018-11-05 23:40:36 +0000</bug_when>
    <thetext>in rocko proper

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=rocko&amp;id=16c0989eec80d8661e2fc9a1011c4ae1f154ffbc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82019</commentid>
    <comment_count>22</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2018-11-05 23:40:46 +0000</bug_when>
    <thetext>closing</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>4325</attachid>
            <date>2018-06-12 09:08:59 +0000</date>
            <delta_ts>2018-06-12 09:08:59 +0000</delta_ts>
            <desc>qemu launch log file</desc>
            <filename>ppc_qemu.txt</filename>
            <type>text/plain</type>
            <size>1240</size>
            <attacher name="pravin">pravin.shankarx.patil</attacher>
            
              <data encoding="base64">cnVucWVtd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