summaryrefslogtreecommitdiffstats
path: root/scripts
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
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')
-rwxr-xr-xscripts/oe-find-native-sysroot56
-rwxr-xr-xscripts/oe-run-native15
-rwxr-xr-xscripts/runqemu-export-rootfs2
-rwxr-xr-xscripts/runqemu-extract-sdk2
4 files changed, 49 insertions, 26 deletions
diff --git a/scripts/oe-find-native-sysroot b/scripts/oe-find-native-sysroot
index 13a5c46039..ad7b2d1fe8 100755
--- a/scripts/oe-find-native-sysroot
+++ b/scripts/oe-find-native-sysroot
@@ -9,7 +9,7 @@
9# it, e.g: 9# it, e.g:
10# 10#
11# SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot` 11# SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot`
12# . $SYSROOT_SETUP_SCRIPT 12# . $SYSROOT_SETUP_SCRIPT <recipe>
13# 13#
14# This script will terminate execution of your calling program unless 14# This script will terminate execution of your calling program unless
15# you set a variable $SKIP_STRICT_SYSROOT_CHECK to a non-empty string 15# you set a variable $SKIP_STRICT_SYSROOT_CHECK to a non-empty string
@@ -30,8 +30,8 @@
30# with this program; if not, write to the Free Software Foundation, Inc., 30# with this program; if not, write to the Free Software Foundation, Inc.,
31# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 31# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 32
33if [ "$1" = '--help' -o "$1" = '-h' ] ; then 33if [ "$1" = '--help' -o "$1" = '-h' -o $# -ne 1 ] ; then
34 echo 'Usage: oe-find-native-sysroot [-h|--help]' 34 echo 'Usage: oe-find-native-sysroot <recipe> [-h|--help]'
35 echo '' 35 echo ''
36 echo 'OpenEmbedded find-native-sysroot - helper script to set' 36 echo 'OpenEmbedded find-native-sysroot - helper script to set'
37 echo 'environment variables OECORE_NATIVE_SYSROOT and PSEUDO' 37 echo 'environment variables OECORE_NATIVE_SYSROOT and PSEUDO'
@@ -39,11 +39,31 @@ if [ "$1" = '--help' -o "$1" = '-h' ] ; then
39 echo 'executable binary' 39 echo 'executable binary'
40 echo '' 40 echo ''
41 echo 'options:' 41 echo 'options:'
42 echo ' recipe its STAGING_DIR_NATIVE is used as native sysroot'
42 echo ' -h, --help show this help message and exit' 43 echo ' -h, --help show this help message and exit'
43 echo '' 44 echo ''
44 exit 2 45 exit 2
45fi 46fi
46 47
48# Global vars
49BITBAKE_E=""
50OECORE_NATIVE_SYSROOT=""
51
52set_oe_native_sysroot(){
53 echo "Running bitbake -e $1"
54 BITBAKE_E="`bitbake -e $1`"
55 OECORE_NATIVE_SYSROOT=`echo "$BITBAKE_E" | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2`
56
57 if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
58 # This indicates that there was an error running bitbake -e that
59 # the user needs to be informed of
60 echo "There was an error running bitbake to determine STAGING_DIR_NATIVE"
61 echo "Here is the output from bitbake -e $1"
62 echo $BITBAKE_E
63 exit 1
64 fi
65}
66
47if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then 67if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
48 BITBAKE=`which bitbake 2> /dev/null` 68 BITBAKE=`which bitbake 2> /dev/null`
49 if [ "x$BITBAKE" != "x" ]; then 69 if [ "x$BITBAKE" != "x" ]; then
@@ -54,10 +74,10 @@ if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
54 exit 1 74 exit 1
55 fi 75 fi
56 touch conf/sanity.conf 76 touch conf/sanity.conf
57 OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2` 77 set_oe_native_sysroot $1
58 rm -f conf/sanity.conf 78 rm -f conf/sanity.conf
59 else 79 else
60 OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '"' -f2` 80 set_oe_native_sysroot $1
61 fi 81 fi
62 else 82 else
63 echo "Error: Unable to locate bitbake command." 83 echo "Error: Unable to locate bitbake command."
@@ -69,21 +89,11 @@ if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
69 fi 89 fi
70fi 90fi
71 91
72if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then 92if [ ! -e "$OECORE_NATIVE_SYSROOT/" ]; then
73 # This indicates that there was an error running bitbake -e that 93 echo "Error: $OECORE_NATIVE_SYSROOT doesn't exist."
74 # the user needs to be informed of
75 echo "There was an error running bitbake to determine STAGING_DIR_NATIVE"
76 echo "Here is the output from bitbake -e"
77 bitbake -e
78 exit 1
79fi
80
81# Set up pseudo command
82if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then
83 echo "Error: Unable to find pseudo binary in $OECORE_NATIVE_SYSROOT/usr/bin/"
84 94
85 if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then 95 if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then
86 echo "Have you run 'bitbake meta-ide-support'?" 96 echo "Have you run 'bitbake $1 -caddto_recipe_sysroot'?"
87 else 97 else
88 echo "This shouldn't happen - something is wrong with your toolchain installation" 98 echo "This shouldn't happen - something is wrong with your toolchain installation"
89 fi 99 fi
@@ -92,4 +102,12 @@ if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then
92 exit 1 102 exit 1
93 fi 103 fi
94fi 104fi
95PSEUDO="$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" 105
106# Set up pseudo command
107pseudo="$OECORE_NATIVE_SYSROOT/usr/bin/pseudo"
108if [ -e "$pseudo" ]; then
109 echo "PSEUDO=$pseudo"
110 PSEUDO="$pseudo"
111else
112 echo "PSEUDO $pseudo is not found."
113fi
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
diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs
index 7ebc07194d..c7992d8223 100755
--- a/scripts/runqemu-export-rootfs
+++ b/scripts/runqemu-export-rootfs
@@ -44,7 +44,7 @@ if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
44 echo "Did you forget to source your build environment setup script?" 44 echo "Did you forget to source your build environment setup script?"
45 exit 1 45 exit 1
46fi 46fi
47. $SYSROOT_SETUP_SCRIPT 47. $SYSROOT_SETUP_SCRIPT meta-ide-support
48 48
49if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/unfsd" ]; then 49if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/unfsd" ]; then
50 echo "Error: Unable to find unfsd binary in $OECORE_NATIVE_SYSROOT/usr/bin/" 50 echo "Error: Unable to find unfsd binary in $OECORE_NATIVE_SYSROOT/usr/bin/"
diff --git a/scripts/runqemu-extract-sdk b/scripts/runqemu-extract-sdk
index 32ddd485b6..2a0dd50e0e 100755
--- a/scripts/runqemu-extract-sdk
+++ b/scripts/runqemu-extract-sdk
@@ -35,7 +35,7 @@ if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
35 echo "Did you forget to source your build system environment setup script?" 35 echo "Did you forget to source your build system environment setup script?"
36 exit 1 36 exit 1
37fi 37fi
38. $SYSROOT_SETUP_SCRIPT 38. $SYSROOT_SETUP_SCRIPT meta-ide-support
39PSEUDO_OPTS="-P $OECORE_NATIVE_SYSROOT/usr" 39PSEUDO_OPTS="-P $OECORE_NATIVE_SYSROOT/usr"
40 40
41ROOTFS_TARBALL=$1 41ROOTFS_TARBALL=$1