summaryrefslogtreecommitdiffstats
path: root/scripts/oe-find-native-sysroot
diff options
context:
space:
mode:
authorScott Garman <scott.a.garman@intel.com>2012-09-26 11:02:26 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-28 11:07:39 +0100
commitf31d114b48564705cbfbbcd433ccd085c82f72b5 (patch)
tree1f3d78cdf087053607eef52355d1011a1da11de2 /scripts/oe-find-native-sysroot
parent71c0ff2e1bf7b7629cddd22858ca35c057e9225b (diff)
downloadpoky-f31d114b48564705cbfbbcd433ccd085c82f72b5.tar.gz
oe-find-native-sysroot: show bitbake errors to user
Ran into another bug that was masked by hiding a bitbake error message. This catches this situation and displays the error to the user. Also includes whitespace fixes. (From OE-Core rev: 435ffeefe4a1df53335fd397ff404bed7deae2df) Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-find-native-sysroot')
-rwxr-xr-xscripts/oe-find-native-sysroot29
1 files changed, 19 insertions, 10 deletions
diff --git a/scripts/oe-find-native-sysroot b/scripts/oe-find-native-sysroot
index b2c22aaf40..9df9b44f42 100755
--- a/scripts/oe-find-native-sysroot
+++ b/scripts/oe-find-native-sysroot
@@ -30,31 +30,40 @@
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 [ -z "$OECORE_NATIVE_SYSROOT" ]; then 33if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
34 BITBAKE=`which bitbake 2> /dev/null` 34 BITBAKE=`which bitbake 2> /dev/null`
35 if [ "x$BITBAKE" != "x" ]; then 35 if [ "x$BITBAKE" != "x" ]; then
36 if [ "$UID" = "0" ]; then 36 if [ "$UID" = "0" ]; then
37 # Root cannot run bitbake unless sanity checking is disabled 37 # Root cannot run bitbake unless sanity checking is disabled
38 if [ ! -d "./conf" ]; then 38 if [ ! -d "./conf" ]; then
39 echo "Error: root cannot run bitbake by default, and I cannot find a ./conf directory to be able to disable sanity checking" 39 echo "Error: root cannot run bitbake by default, and I cannot find a ./conf directory to be able to disable sanity checking"
40 exit 1 40 exit 1
41 fi 41 fi
42 touch conf/sanity.conf 42 touch conf/sanity.conf
43 OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '=' -f2 | cut -d '"' -f2` 43 OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '=' -f2 | cut -d '"' -f2`
44 rm -f conf/sanity.conf 44 rm -f conf/sanity.conf
45 else 45 else
46 OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '=' -f2 | cut -d '"' -f2` 46 OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '=' -f2 | cut -d '"' -f2`
47 fi 47 fi
48 else 48 else
49 echo "Error: Unable to locate your native sysroot." 49 echo "Error: Unable to locate bitbake command."
50 echo "Did you forget to source the build environment setup script?" 50 echo "Did you forget to source the build environment setup script?"
51 51
52 if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then 52 if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then
53 exit 1 53 exit 1
54 fi 54 fi
55 fi 55 fi
56fi 56fi
57 57
58if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
59 # This indicates that there was an error running bitbake -e that
60 # the user needs to be informed of
61 echo "There was an error running bitbake to determine STAGING_DIR_NATIVE"
62 echo "Here is the output from bitbake -e"
63 bitbake -e
64 exit 1
65fi
66
58# Set up pseudo command 67# Set up pseudo command
59if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then 68if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then
60 echo "Error: Unable to find pseudo binary in $OECORE_NATIVE_SYSROOT/usr/bin/" 69 echo "Error: Unable to find pseudo binary in $OECORE_NATIVE_SYSROOT/usr/bin/"