<div dir="ltr">Hi Robert, <div><br></div><div>I was definitely looking at only the extract-rootfs issue and didn&#39;t remember seeing your above patch.  I agree that we need a broader solution than the one I did. I tried applying yours but had some issues. Your patch did fix the runqemu-extract-rootfs, but not when I had INHERIT+= &quot; rm_work &quot;.  Also, I had trouble running the oe-run-native script. It seems like the help is reversed from what order it is expecting?  I may be missing something, it&#39;s getting late; but I&#39;ll look at it tomoro and see if I can&#39;t expand on your patch for a more generic solution. Issues from the run below.</div><div>ty,</div><div>b</div><div>an intel employee  </div><div><br></div><div><br></div><div>







<p class="gmail-p1"><span class="gmail-s1">$ bitbake bmap-tools-native -caddto_recipe_sysroot </span></p><p class="gmail-p1"><span class="gmail-s1">$ oe-run-native bmap-tools-native bmaptool                      </span></p><p class="gmail-p1"><span class="gmail-s1">Running bitbake -e bmaptool</span></p><p class="gmail-p1"><span class="gmail-s1">ERROR: Nothing PROVIDES &#39;bmaptool&#39;. Close matches:</span></p><p class="gmail-p1"><span class="gmail-s1">  bmap-tools</span></p><p class="gmail-p1"><span class="gmail-s1">  mtools</span></p><p class="gmail-p1"><span class="gmail-s1">There was an error running bitbake to determine STAGING_DIR_NATIVE</span></p><p class="gmail-p1"><span class="gmail-s1">Here is the output from bitbake -e bmaptool</span></p><p class="gmail-p1"><span class="gmail-s1">WARNING: Host distribution &quot;ubuntu-14.04&quot; has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution. Loading cache...done. Loaded 1299 entries from dependency cache. Summary: There was 1 WARNING message shown. Summary: There was 1 ERROR message shown, returning a non-zero exit code.</span></p><p class="gmail-p1"><span class="gmail-s1">$ oe-run-native bmaptool bmap-tools-native </span></p><p class="gmail-p1"><span class="gmail-s1">Running bitbake -e bmap-tools-native</span></p><p class="gmail-p1"><span class="gmail-s1">PSEUDO …/tmp/work/x86_64-linux/bmap-tools-native/3.2-r0/recipe-sysroot-native/usr/bin/pseudo is not found.</span></p><p class="gmail-p1"><span class="gmail-s1">Error: Unable to find &#39;&#39; in .../tmp/work/x86_64-linux/bmap-tools-native/3.2-r0/recipe-sysroot-native/usr/bin:.../tmp/work/x86_64-linux/bmap-tools-native/3.2-r0/recipe-sysroot-native/bin:.../tmp/work/x86_64-linux/bmap-tools-native/3.2-r0/recipe-sysroot-native/usr/sbin:.../tmp/work/x86_64-linux/bmap-tools-native/3.2-r0/recipe-sysroot-native/sbin</span></p><p class="gmail-p1"><span class="gmail-s1">bavery@bavery-WS-DESK:...$ oe-run-native </span></p><p class="gmail-p1"><span class="gmail-s1">oe-run-native: error: the following arguments are required: &lt;native recipe&gt; &lt;native tool&gt;</span></p><p class="gmail-p1"><span class="gmail-s1">Usage: oe-run-native native-recipe tool [parameters]</span></p><p class="gmail-p2"><span class="gmail-s1"></span><br></p><p class="gmail-p1"><span class="gmail-s1">OpenEmbedded run-native - runs native tools</span></p><p class="gmail-p2"><span class="gmail-s1"></span><br></p><p class="gmail-p1"><span class="gmail-s1">arguments:</span></p><p class="gmail-p1"><span class="gmail-s1">  native-recipe       The recipe which provoides tool</span></p><p class="gmail-p1"><span class="gmail-s1">  tool                Native tool to run</span></p><p class="gmail-p2"><span class="gmail-s1"></span><br></p><p class="gmail-p1"><span class="gmail-s1">





























</span></p><p class="gmail-p2"><span class="gmail-s1"></span><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 6, 2017 at 3:26 AM, Robert Yang <span dir="ltr">&lt;<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Brian and RP,<br>
<br>
This patch can&#39;t fix the problem of scripts/oe-run-native, it only can<br>
run the native tools which is depended by meta-ide-support, for example:<br>
<br>
$ bitbake bmap-tools-native meta-ide-support<br>
$ oe-run-native bmaptool --help # exmaple from dev-manual-start.xml<br>
<br>
Error: Unable to find &#39;bmaptool&#39; in native sysroot<br>
<br>
I think that we need consider the patch that I had sent before:<br>
<br>
  git://<a href="http://git.openembedded.org/openembedded-core-contrib" rel="noreferrer" target="_blank">git.openembedded.org/ope<wbr>nembedded-core-contrib</a> rbt/rssfix<br>
  <a href="http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/rssfix" rel="noreferrer" target="_blank">http://cgit.openembedded.org/o<wbr>penembedded-core-contrib/log/?<wbr>h=rbt/rssfix</a><br>
<br>
Robert Yang (1):<br>
  oe-find-native-sysroot: work with RSS<br>
<br>
<br>
Subject: [PATCH 1/1] oe-find-native-sysroot: work with RSS<br>
<br>
The generic STAGING_DIR_NATIVE is gone since RSS, so when find<br>
OECORE_NATIVE_SYSROOT, the user has to specify which recipe&#39;s<br>
STAGING_DIR_NATIVE will be used as OECORE_NATIVE_SYSROOT.<br>
<br>
* The usage is changed from &quot;. oe-find-native-sysroot&quot; to<br>
  &quot;. oe-find-native-sysroot &lt;recipe&gt;&quot;.<br>
* The oe-run-native&#39;s usage has changed from<br>
  &quot;oe-run-native tool&quot; to &quot;oe-run-native native-recipe tool&quot;.<br>
<br>
Signed-off-by: Robert Yang &lt;<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>&gt;<br>
---<br>
 scripts/oe-find-native-<wbr>sysroot | 56 ++++++++++++++++++++++++++++--<wbr>------------<br>
 scripts/oe-run-native          | 15 +++++++----<br>
 scripts/runqemu-export-<wbr>rootfs  |  2 +-<br>
 scripts/runqemu-extract-sdk    |  2 +-<br>
 4 files changed, 49 insertions(+), 26 deletions(-)<br>
<br>
diff --git a/scripts/oe-find-native-sysro<wbr>ot b/scripts/oe-find-native-sysro<wbr>ot<br>
index 3f4c29da8a..59fe3f3118 100755<br>
--- a/scripts/oe-find-native-sysro<wbr>ot<br>
+++ b/scripts/oe-find-native-sysro<wbr>ot<br>
@@ -9,7 +9,7 @@<br>
 # it, e.g:<br>
 #<br>
 # SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot`<br>
-# . $SYSROOT_SETUP_SCRIPT<br>
+# . $SYSROOT_SETUP_SCRIPT &lt;recipe&gt;<br>
 #<br>
 # This script will terminate execution of your calling program unless<br>
 # you set a variable $SKIP_STRICT_SYSROOT_CHECK to a non-empty string<br>
@@ -30,8 +30,8 @@<br>
 # with this program; if not, write to the Free Software Foundation, Inc.,<br>
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.<br>
<br>
-if [ &quot;$1&quot; = &#39;--help&#39; -o &quot;$1&quot; = &#39;-h&#39; ] ; then<br>
-    echo &#39;Usage: oe-find-native-sysroot [-h|--help]&#39;<br>
+if [ &quot;$1&quot; = &#39;--help&#39; -o &quot;$1&quot; = &#39;-h&#39; -o $# -ne 1 ] ; then<br>
+    echo &#39;Usage: oe-find-native-sysroot &lt;recipe&gt; [-h|--help]&#39;<br>
     echo &#39;&#39;<br>
     echo &#39;OpenEmbedded find-native-sysroot - helper script to set&#39;<br>
     echo &#39;environment variables OECORE_NATIVE_SYSROOT and PSEUDO&#39;<br>
@@ -39,11 +39,31 @@ if [ &quot;$1&quot; = &#39;--help&#39; -o &quot;$1&quot; = &#39;-h&#39; ] ; then<br>
     echo &#39;executable binary&#39;<br>
     echo &#39;&#39;<br>
     echo &#39;options:&#39;<br>
+    echo &#39;  recipe              its STAGING_DIR_NATIVE is used as native sysroot&#39;<br>
     echo &#39;  -h, --help          show this help message and exit&#39;<br>
     echo &#39;&#39;<br>
     exit 2<br>
 fi<br>
<br>
+# Global vars<br>
+BITBAKE_E=&quot;&quot;<br>
+OECORE_NATIVE_SYSROOT=&quot;&quot;<br>
+<br>
+set_oe_native_sysroot(){<br>
+    echo &quot;Running bitbake -e $1&quot;<br>
+    BITBAKE_E=&quot;`bitbake -e $1`&quot;<br>
+    OECORE_NATIVE_SYSROOT=`echo &quot;$BITBAKE_E&quot; | grep ^STAGING_DIR_NATIVE | cut -d &#39;&quot;&#39; -f2`<br>
+<br>
+    if [ &quot;x$OECORE_NATIVE_SYSROOT&quot; = &quot;x&quot; ]; then<br>
+        # This indicates that there was an error running bitbake -e that<br>
+        # the user needs to be informed of<br>
+        echo &quot;There was an error running bitbake to determine STAGING_DIR_NATIVE&quot;<br>
+        echo &quot;Here is the output from bitbake -e $1&quot;<br>
+        echo &quot;$BITBAKE_E&quot;<br>
+        exit 1<br>
+    fi<br>
+}<br>
+<span class=""><br>
 if [ &quot;x$OECORE_NATIVE_SYSROOT&quot; = &quot;x&quot; ]; then<br></span>
     BITBAKE=`which bitbake 2&gt; /dev/null`<br>
     if [ &quot;x$BITBAKE&quot; != &quot;x&quot; ]; then<br>
@@ -54,10 +74,10 @@ if [ &quot;x$OECORE_NATIVE_SYSROOT&quot; = &quot;x&quot; ]; then<span class=""><br>
                 exit 1<br>
             fi<br>
             touch conf/sanity.conf<br></span>
-            OECORE_NATIVE_SYSROOT=`bitbake -e meta-ide-support | grep ^RECIPE_SYSROOT_NATIVE | cut -d &#39;&quot;&#39; -f2`<br>
+            set_oe_native_sysroot $1<br>
             rm -f conf/sanity.conf<br>
         else<br>
-            OECORE_NATIVE_SYSROOT=`bitbake -e meta-ide-support | grep ^RECIPE_SYSROOT_NATIVE | cut -d &#39;&quot;&#39; -f2`<br>
+            set_oe_native_sysroot $1<span class=""><br>
         fi<br>
     else<br>
         echo &quot;Error: Unable to locate bitbake command.&quot;<br></span>
@@ -69,21 +89,11 @@ if [ &quot;x$OECORE_NATIVE_SYSROOT&quot; = &quot;x&quot; ]; then<br>
     fi<br>
 fi<br>
<br>
-if [ &quot;x$OECORE_NATIVE_SYSROOT&quot; = &quot;x&quot; ]; then<br>
-    # This indicates that there was an error running bitbake -e that<br>
-    # the user needs to be informed of<br>
-    echo &quot;There was an error running bitbake to determine RECIPE_SYSROOT_NATIVE&quot;<br>
-    echo &quot;Here is the output from bitbake -e&quot;<br>
-    bitbake -e<br>
-    exit 1<br>
-fi<br>
-<br>
-# Set up pseudo command<br>
-if [ ! -e &quot;$OECORE_NATIVE_SYSROOT/usr/bi<wbr>n/pseudo&quot; ]; then<br>
-    echo &quot;Error: Unable to find pseudo binary in $OECORE_NATIVE_SYSROOT/usr/bin<wbr>/&quot;<br>
+if [ ! -e &quot;$OECORE_NATIVE_SYSROOT/&quot; ]; then<br>
+    echo &quot;Error: $OECORE_NATIVE_SYSROOT doesn&#39;t exist.&quot;<br>
<br>
     if [ &quot;x$OECORE_DISTRO_VERSION&quot; = &quot;x&quot; ]; then<br>
-        echo &quot;Have you run &#39;bitbake meta-ide-support&#39;?&quot;<br>
+        echo &quot;Have you run &#39;bitbake $1 -caddto_recipe_sysroot&#39;?&quot;<br>
     else<br>
         echo &quot;This shouldn&#39;t happen - something is wrong with your toolchain installation&quot;<br>
     fi<br>
@@ -92,4 +102,12 @@ if [ ! -e &quot;$OECORE_NATIVE_SYSROOT/usr/bi<wbr>n/pseudo&quot; ]; then<br>
         exit 1<br>
     fi<br>
 fi<br>
-PSEUDO=&quot;$OECORE_NATIVE_SYSROO<wbr>T/usr/bin/pseudo&quot;<br>
+<br>
+# Set up pseudo command<br>
+pseudo=&quot;$OECORE_NATIVE_SYSROO<wbr>T/usr/bin/pseudo&quot;<br>
+if [ -e &quot;$pseudo&quot; ]; then<br>
+    echo &quot;PSEUDO=$pseudo&quot;<br>
+    PSEUDO=&quot;$pseudo&quot;<br>
+else<br>
+    echo &quot;PSEUDO $pseudo is not found.&quot;<br>
+fi<br>
diff --git a/scripts/oe-run-native b/scripts/oe-run-native<br>
index f2453e705a..de3c02ed34 100755<br>
--- a/scripts/oe-run-native<br>
+++ b/scripts/oe-run-native<br>
@@ -22,34 +22,39 @@<br>
 #<br>
<br>
 if [ $# -lt 1 -o &quot;$1&quot; = &#39;--help&#39; -o &quot;$1&quot; = &#39;-h&#39; ] ; then<br>
-    echo &#39;oe-run-native: error: the following arguments are required: &lt;native tool&gt;&#39;<br>
-    echo &#39;Usage: oe-run-native tool [parameters]&#39;<br>
+    echo &#39;oe-run-native: error: the following arguments are required: &lt;native recipe&gt; &lt;native tool&gt;&#39;<br>
+    echo &#39;Usage: oe-run-native native-recipe tool [parameters]&#39;<br>
     echo &#39;&#39;<br>
     echo &#39;OpenEmbedded run-native - runs native tools&#39;<br>
     echo &#39;&#39;<br>
     echo &#39;arguments:&#39;<br>
+    echo &#39;  native-recipe       The recipe which provoides tool&#39;<br>
     echo &#39;  tool                Native tool to run&#39;<br>
     echo &#39;&#39;<br>
     exit 2<br>
 fi<br>
<br>
+native_recipe=&quot;$1&quot;<br>
+tool=&quot;$2&quot;<br>
+shift<br>
+<br>
 SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2&gt; /dev/null`<br>
 if [ -z &quot;$SYSROOT_SETUP_SCRIPT&quot; ]; then<br>
         echo &quot;Error: Unable to find oe-find-native-sysroot script&quot;<br>
         exit 1<br>
 fi<br>
-. $SYSROOT_SETUP_SCRIPT<br>
+. $SYSROOT_SETUP_SCRIPT $native_recipe<br>
<br>
 OLD_PATH=$PATH<br>
<br>
 # look for a tool only in native sysroot<br>
<br>
PATH=$OECORE_NATIVE_SYSROOT/us<wbr>r/bin:$OECORE_NATIVE_SYSROOT/<wbr>bin:$OECORE_NATIVE_SYSROOT/<wbr>usr/sbin:$OECORE_NATIVE_<wbr>SYSROOT/sbin<br>
-tool=`/usr/bin/which $1 2&gt;/dev/null`<br>
+tool=`/usr/bin/which $tool 2&gt;/dev/null`<br>
<br>
 if [ -n &quot;$tool&quot; ] ; then<br>
     # add old path to allow usage of host tools<br>
     PATH=$PATH:$OLD_PATH $@<br>
 else<br>
-    echo &quot;Error: Unable to find &#39;$1&#39; in native sysroot&quot;<br>
+    echo &quot;Error: Unable to find &#39;$tool&#39; in $PATH&quot;<br>
     exit 1<br>
 fi<br>
diff --git a/scripts/runqemu-export-rootf<wbr>s b/scripts/runqemu-export-rootf<wbr>s<br>
index 7ebc07194d..c7992d8223 100755<br>
--- a/scripts/runqemu-export-rootf<wbr>s<br>
+++ b/scripts/runqemu-export-rootf<wbr>s<br>
@@ -44,7 +44,7 @@ if [ -z &quot;$SYSROOT_SETUP_SCRIPT&quot; ]; then<br>
        echo &quot;Did you forget to source your build environment setup script?&quot;<br>
        exit 1<br>
 fi<br>
-. $SYSROOT_SETUP_SCRIPT<br>
+. $SYSROOT_SETUP_SCRIPT meta-ide-support<br>
<br>
 if [ ! -e &quot;$OECORE_NATIVE_SYSROOT/usr/bi<wbr>n/unfsd&quot; ]; then<br>
        echo &quot;Error: Unable to find unfsd binary in $OECORE_NATIVE_SYSROOT/usr/bin<wbr>/&quot;<br>
diff --git a/scripts/runqemu-extract-sdk b/scripts/runqemu-extract-sdk<br>
index 32ddd485b6..2a0dd50e0e 100755<br>
--- a/scripts/runqemu-extract-sdk<br>
+++ b/scripts/runqemu-extract-sdk<br>
@@ -35,7 +35,7 @@ if [ -z &quot;$SYSROOT_SETUP_SCRIPT&quot; ]; then<br>
     echo &quot;Did you forget to source your build system environment setup script?&quot;<br>
     exit 1<br>
 fi<br>
-. $SYSROOT_SETUP_SCRIPT<br>
+. $SYSROOT_SETUP_SCRIPT meta-ide-support<br>
 PSEUDO_OPTS=&quot;-P $OECORE_NATIVE_SYSROOT/usr&quot;<br>
<br>
 ROOTFS_TARBALL=$1<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
// Robert</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On 04/05/2017 06:22 AM, brian avery wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
oe-find-native-sysroot: Recipe Specific Sysroots have eliminated the<br>
large STAGING_DIR_NATIVE. Now, we will rely on the meta-ide-support<br>
sysroot that is what was populating the large STAGING_DIR_NATIVE in<br>
previous versions anyway. We now look for RECIPE_SYSROOT_NATIVE.<br>
<br>
[YOCTO #11119]<br>
<br>
Signed-off-by: brian avery &lt;<a href="mailto:brian.avery@intel.com" target="_blank">brian.avery@intel.com</a>&gt;<br>
---<br>
 scripts/oe-find-native-<wbr>sysroot | 8 ++++----<br>
 1 file changed, 4 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/scripts/oe-find-native-sysro<wbr>ot b/scripts/oe-find-native-sysro<wbr>ot<br>
index 13a5c46..3f4c29d 100755<br>
--- a/scripts/oe-find-native-sysro<wbr>ot<br>
+++ b/scripts/oe-find-native-sysro<wbr>ot<br>
@@ -2,7 +2,7 @@<br>
 #<br>
 # Find a native sysroot to use - either from an in-tree OE build or<br>
 # from a toolchain installation. It then ensures the variable<br>
-# $OECORE_NATIVE_SYSROOT is set to the sysroot&#39;s base directory, and sets<br>
+# $OECORE_NATIVE_SYSROOT is set to the sysroot&#39;s base directory, and sets<br>
 # $PSEUDO to the path of the pseudo binary.<br>
 #<br>
 # This script is intended to be run within other scripts by source&#39;ing<br>
@@ -54,10 +54,10 @@ if [ &quot;x$OECORE_NATIVE_SYSROOT&quot; = &quot;x&quot; ]; then<br>
                 exit 1<br>
             fi<br>
             touch conf/sanity.conf<br>
-            OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d &#39;&quot;&#39; -f2`<br>
+            OECORE_NATIVE_SYSROOT=`bitbake -e meta-ide-support | grep ^RECIPE_SYSROOT_NATIVE | cut -d &#39;&quot;&#39; -f2`<br>
             rm -f conf/sanity.conf<br>
         else<br>
-            OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d &#39;&quot;&#39; -f2`<br>
+            OECORE_NATIVE_SYSROOT=`bitbake -e meta-ide-support | grep ^RECIPE_SYSROOT_NATIVE | cut -d &#39;&quot;&#39; -f2`<br>
         fi<br>
     else<br>
         echo &quot;Error: Unable to locate bitbake command.&quot;<br>
@@ -72,7 +72,7 @@ fi<br>
 if [ &quot;x$OECORE_NATIVE_SYSROOT&quot; = &quot;x&quot; ]; then<br>
     # This indicates that there was an error running bitbake -e that<br>
     # the user needs to be informed of<br>
-    echo &quot;There was an error running bitbake to determine STAGING_DIR_NATIVE&quot;<br>
+    echo &quot;There was an error running bitbake to determine RECIPE_SYSROOT_NATIVE&quot;<br>
     echo &quot;Here is the output from bitbake -e&quot;<br>
     bitbake -e<br>
     exit 1<br>
<br>
</blockquote>
-- <br></div></div><div class="HOEnZb"><div class="h5">
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openem<wbr>bedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</div></div></blockquote></div><br></div>