summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorScott Garman <scott.a.garman@intel.com>2012-09-26 11:02:26 -0700
committerSaul Wold <sgw@linux.intel.com>2012-09-28 01:14:01 -0700
commit435ffeefe4a1df53335fd397ff404bed7deae2df (patch)
tree531f25126471f9ae63908c66f8faac8f0825a196 /scripts
parent3d28d16042373e699fabd8576458f65d63463bb9 (diff)
downloadopenembedded-core-435ffeefe4a1df53335fd397ff404bed7deae2df.tar.gz
openembedded-core-435ffeefe4a1df53335fd397ff404bed7deae2df.tar.bz2
openembedded-core-435ffeefe4a1df53335fd397ff404bed7deae2df.zip
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. Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'scripts')
-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 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
+if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
BITBAKE=`which bitbake 2> /dev/null`
if [ "x$BITBAKE" != "x" ]; then
- if [ "$UID" = "0" ]; then
+ if [ "$UID" = "0" ]; then
# Root cannot run bitbake unless sanity checking is disabled
if [ ! -d "./conf" ]; then
- echo "Error: root cannot run bitbake by default, and I cannot find a ./conf directory to be able to disable sanity checking"
- exit 1
+ echo "Error: root cannot run bitbake by default, and I cannot find a ./conf directory to be able to disable sanity checking"
+ exit 1
fi
touch conf/sanity.conf
OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '=' -f2 | cut -d '"' -f2`
rm -f conf/sanity.conf
- else
+ else
OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '=' -f2 | cut -d '"' -f2`
- fi
+ fi
else
- echo "Error: Unable to locate your native sysroot."
- echo "Did you forget to source the build environment setup script?"
+ echo "Error: Unable to locate bitbake command."
+ echo "Did you forget to source the build environment setup script?"
- if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then
+ if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then
exit 1
- fi
+ fi
fi
fi
+if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
+ # This indicates that there was an error running bitbake -e that
+ # the user needs to be informed of
+ echo "There was an error running bitbake to determine STAGING_DIR_NATIVE"
+ echo "Here is the output from bitbake -e"
+ bitbake -e
+ exit 1
+fi
+
# Set up pseudo command
if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then
echo "Error: Unable to find pseudo binary in $OECORE_NATIVE_SYSROOT/usr/bin/"