<div dir="ltr">Hi Robert, <div><br></div><div>I was definitely looking at only the extract-rootfs issue and didn'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+= " rm_work ". 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's getting late; but I'll look at it tomoro and see if I can'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 'bmaptool'. 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 "ubuntu-14.04" 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 '' 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: <native recipe> <native tool></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"><<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>></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'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 'bmaptool' 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's<br>
STAGING_DIR_NATIVE will be used as OECORE_NATIVE_SYSROOT.<br>
<br>
* The usage is changed from ". oe-find-native-sysroot" to<br>
". oe-find-native-sysroot <recipe>".<br>
* The oe-run-native's usage has changed from<br>
"oe-run-native tool" to "oe-run-native native-recipe tool".<br>
<br>
Signed-off-by: Robert Yang <<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>><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 <recipe><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 [ "$1" = '--help' -o "$1" = '-h' ] ; then<br>
- echo 'Usage: oe-find-native-sysroot [-h|--help]'<br>
+if [ "$1" = '--help' -o "$1" = '-h' -o $# -ne 1 ] ; then<br>
+ echo 'Usage: oe-find-native-sysroot <recipe> [-h|--help]'<br>
echo ''<br>
echo 'OpenEmbedded find-native-sysroot - helper script to set'<br>
echo 'environment variables OECORE_NATIVE_SYSROOT and PSEUDO'<br>
@@ -39,11 +39,31 @@ if [ "$1" = '--help' -o "$1" = '-h' ] ; then<br>
echo 'executable binary'<br>
echo ''<br>
echo 'options:'<br>
+ echo ' recipe its STAGING_DIR_NATIVE is used as native sysroot'<br>
echo ' -h, --help show this help message and exit'<br>
echo ''<br>
exit 2<br>
fi<br>
<br>
+# Global vars<br>
+BITBAKE_E=""<br>
+OECORE_NATIVE_SYSROOT=""<br>
+<br>
+set_oe_native_sysroot(){<br>
+ echo "Running bitbake -e $1"<br>
+ BITBAKE_E="`bitbake -e $1`"<br>
+ OECORE_NATIVE_SYSROOT=`echo "$BITBAKE_E" | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2`<br>
+<br>
+ if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then<br>
+ # This indicates that there was an error running bitbake -e that<br>
+ # the user needs to be informed of<br>
+ echo "There was an error running bitbake to determine STAGING_DIR_NATIVE"<br>
+ echo "Here is the output from bitbake -e $1"<br>
+ echo "$BITBAKE_E"<br>
+ exit 1<br>
+ fi<br>
+}<br>
+<span class=""><br>
if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then<br></span>
BITBAKE=`which bitbake 2> /dev/null`<br>
if [ "x$BITBAKE" != "x" ]; then<br>
@@ -54,10 +74,10 @@ if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; 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 '"' -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 '"' -f2`<br>
+ set_oe_native_sysroot $1<span class=""><br>
fi<br>
else<br>
echo "Error: Unable to locate bitbake command."<br></span>
@@ -69,21 +89,11 @@ if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then<br>
fi<br>
fi<br>
<br>
-if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then<br>
- # This indicates that there was an error running bitbake -e that<br>
- # the user needs to be informed of<br>
- echo "There was an error running bitbake to determine RECIPE_SYSROOT_NATIVE"<br>
- echo "Here is the output from bitbake -e"<br>
- bitbake -e<br>
- exit 1<br>
-fi<br>
-<br>
-# Set up pseudo command<br>
-if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bi<wbr>n/pseudo" ]; then<br>
- echo "Error: Unable to find pseudo binary in $OECORE_NATIVE_SYSROOT/usr/bin<wbr>/"<br>
+if [ ! -e "$OECORE_NATIVE_SYSROOT/" ]; then<br>
+ echo "Error: $OECORE_NATIVE_SYSROOT doesn't exist."<br>
<br>
if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then<br>
- echo "Have you run 'bitbake meta-ide-support'?"<br>
+ echo "Have you run 'bitbake $1 -caddto_recipe_sysroot'?"<br>
else<br>
echo "This shouldn't happen - something is wrong with your toolchain installation"<br>
fi<br>
@@ -92,4 +102,12 @@ if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bi<wbr>n/pseudo" ]; then<br>
exit 1<br>
fi<br>
fi<br>
-PSEUDO="$OECORE_NATIVE_SYSROO<wbr>T/usr/bin/pseudo"<br>
+<br>
+# Set up pseudo command<br>
+pseudo="$OECORE_NATIVE_SYSROO<wbr>T/usr/bin/pseudo"<br>
+if [ -e "$pseudo" ]; then<br>
+ echo "PSEUDO=$pseudo"<br>
+ PSEUDO="$pseudo"<br>
+else<br>
+ echo "PSEUDO $pseudo is not found."<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 "$1" = '--help' -o "$1" = '-h' ] ; then<br>
- echo 'oe-run-native: error: the following arguments are required: <native tool>'<br>
- echo 'Usage: oe-run-native tool [parameters]'<br>
+ echo 'oe-run-native: error: the following arguments are required: <native recipe> <native tool>'<br>
+ echo 'Usage: oe-run-native native-recipe tool [parameters]'<br>
echo ''<br>
echo 'OpenEmbedded run-native - runs native tools'<br>
echo ''<br>
echo 'arguments:'<br>
+ echo ' native-recipe The recipe which provoides tool'<br>
echo ' tool Native tool to run'<br>
echo ''<br>
exit 2<br>
fi<br>
<br>
+native_recipe="$1"<br>
+tool="$2"<br>
+shift<br>
+<br>
SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`<br>
if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then<br>
echo "Error: Unable to find oe-find-native-sysroot script"<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>/dev/null`<br>
+tool=`/usr/bin/which $tool 2>/dev/null`<br>
<br>
if [ -n "$tool" ] ; then<br>
# add old path to allow usage of host tools<br>
PATH=$PATH:$OLD_PATH $@<br>
else<br>
- echo "Error: Unable to find '$1' in native sysroot"<br>
+ echo "Error: Unable to find '$tool' in $PATH"<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 "$SYSROOT_SETUP_SCRIPT" ]; then<br>
echo "Did you forget to source your build environment setup script?"<br>
exit 1<br>
fi<br>
-. $SYSROOT_SETUP_SCRIPT<br>
+. $SYSROOT_SETUP_SCRIPT meta-ide-support<br>
<br>
if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bi<wbr>n/unfsd" ]; then<br>
echo "Error: Unable to find unfsd binary in $OECORE_NATIVE_SYSROOT/usr/bin<wbr>/"<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 "$SYSROOT_SETUP_SCRIPT" ]; then<br>
echo "Did you forget to source your build system environment setup script?"<br>
exit 1<br>
fi<br>
-. $SYSROOT_SETUP_SCRIPT<br>
+. $SYSROOT_SETUP_SCRIPT meta-ide-support<br>
PSEUDO_OPTS="-P $OECORE_NATIVE_SYSROOT/usr"<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 <<a href="mailto:brian.avery@intel.com" target="_blank">brian.avery@intel.com</a>><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's base directory, and sets<br>
+# $OECORE_NATIVE_SYSROOT is set to the sysroot'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'ing<br>
@@ -54,10 +54,10 @@ if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then<br>
exit 1<br>
fi<br>
touch conf/sanity.conf<br>
- OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2`<br>
+ OECORE_NATIVE_SYSROOT=`bitbake -e meta-ide-support | grep ^RECIPE_SYSROOT_NATIVE | cut -d '"' -f2`<br>
rm -f conf/sanity.conf<br>
else<br>
- OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2`<br>
+ OECORE_NATIVE_SYSROOT=`bitbake -e meta-ide-support | grep ^RECIPE_SYSROOT_NATIVE | cut -d '"' -f2`<br>
fi<br>
else<br>
echo "Error: Unable to locate bitbake command."<br>
@@ -72,7 +72,7 @@ fi<br>
if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then<br>
# This indicates that there was an error running bitbake -e that<br>
# the user needs to be informed of<br>
- echo "There was an error running bitbake to determine STAGING_DIR_NATIVE"<br>
+ echo "There was an error running bitbake to determine RECIPE_SYSROOT_NATIVE"<br>
echo "Here is the output from bitbake -e"<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>