diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2017-04-12 14:29:12 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-04-13 10:54:10 +0100 |
commit | 4a0b6af446d257098111d76123a7dd34fa92f943 (patch) | |
tree | 95daddb216344e023a13e087a139de473c898548 /scripts/oe-run-native | |
parent | 5897c5edc4549dddef7a7b2cbb8d60a9d33b4c10 (diff) | |
download | poky-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-x | scripts/oe-run-native | 15 |
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 | ||
24 | if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then | 24 | if [ $# -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 |
34 | fi | 35 | fi |
35 | 36 | ||
37 | native_recipe="$1" | ||
38 | tool="$2" | ||
39 | shift | ||
40 | |||
36 | SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null` | 41 | SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null` |
37 | if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then | 42 | if [ -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 |
40 | fi | 45 | fi |
41 | . $SYSROOT_SETUP_SCRIPT | 46 | . $SYSROOT_SETUP_SCRIPT $native_recipe |
42 | 47 | ||
43 | OLD_PATH=$PATH | 48 | OLD_PATH=$PATH |
44 | 49 | ||
45 | # look for a tool only in native sysroot | 50 | # look for a tool only in native sysroot |
46 | PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin | 51 | PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin |
47 | tool=`/usr/bin/which $1 2>/dev/null` | 52 | tool=`/usr/bin/which $tool 2>/dev/null` |
48 | 53 | ||
49 | if [ -n "$tool" ] ; then | 54 | if [ -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 $@ |
52 | else | 57 | else |
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 |
55 | fi | 60 | fi |