summaryrefslogtreecommitdiffstats
path: root/scripts/oe-run-native
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2017-04-12 14:29:12 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-13 10:54:10 +0100
commit4a0b6af446d257098111d76123a7dd34fa92f943 (patch)
tree95daddb216344e023a13e087a139de473c898548 /scripts/oe-run-native
parent5897c5edc4549dddef7a7b2cbb8d60a9d33b4c10 (diff)
downloadpoky-4a0b6af446d257098111d76123a7dd34fa92f943.tar.gz
oe-find-native-sysroot: work with RSS
The generic STAGING_DIR_NATIVE is gone since RSS, so when find OECORE_NATIVE_SYSROOT, the user has to specify which recipe's STAGING_DIR_NATIVE will be used as OECORE_NATIVE_SYSROOT. * The usage is changed from ". oe-find-native-sysroot" to ". oe-find-native-sysroot <recipe>". * The oe-run-native's usage has changed from "oe-run-native tool" to "oe-run-native native-recipe tool". (From OE-Core rev: e2f6d937bd897083779507ecb9ecd15513b35f1f) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-run-native')
-rwxr-xr-xscripts/oe-run-native15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/oe-run-native b/scripts/oe-run-native
index f2453e705a..de3c02ed34 100755
--- a/scripts/oe-run-native
+++ b/scripts/oe-run-native
@@ -22,34 +22,39 @@
22# 22#
23 23
24if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then 24if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then
25 echo 'oe-run-native: error: the following arguments are required: <native tool>' 25 echo 'oe-run-native: error: the following arguments are required: <native recipe> <native tool>'
26 echo 'Usage: oe-run-native tool [parameters]' 26 echo 'Usage: oe-run-native native-recipe tool [parameters]'
27 echo '' 27 echo ''
28 echo 'OpenEmbedded run-native - runs native tools' 28 echo 'OpenEmbedded run-native - runs native tools'
29 echo '' 29 echo ''
30 echo 'arguments:' 30 echo 'arguments:'
31 echo ' native-recipe The recipe which provoides tool'
31 echo ' tool Native tool to run' 32 echo ' tool Native tool to run'
32 echo '' 33 echo ''
33 exit 2 34 exit 2
34fi 35fi
35 36
37native_recipe="$1"
38tool="$2"
39shift
40
36SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null` 41SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
37if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then 42if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
38 echo "Error: Unable to find oe-find-native-sysroot script" 43 echo "Error: Unable to find oe-find-native-sysroot script"
39 exit 1 44 exit 1
40fi 45fi
41. $SYSROOT_SETUP_SCRIPT 46. $SYSROOT_SETUP_SCRIPT $native_recipe
42 47
43OLD_PATH=$PATH 48OLD_PATH=$PATH
44 49
45# look for a tool only in native sysroot 50# look for a tool only in native sysroot
46PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin 51PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin
47tool=`/usr/bin/which $1 2>/dev/null` 52tool=`/usr/bin/which $tool 2>/dev/null`
48 53
49if [ -n "$tool" ] ; then 54if [ -n "$tool" ] ; then
50 # add old path to allow usage of host tools 55 # add old path to allow usage of host tools
51 PATH=$PATH:$OLD_PATH $@ 56 PATH=$PATH:$OLD_PATH $@
52else 57else
53 echo "Error: Unable to find '$1' in native sysroot" 58 echo "Error: Unable to find '$tool' in $PATH"
54 exit 1 59 exit 1
55fi 60fi