]> code.ossystems Code Review - openembedded-core.git/commitdiff
runqemu: show bitbake errors to user
authorScott Garman <scott.a.garman@intel.com>
Wed, 19 Sep 2012 05:50:50 +0000 (22:50 -0700)
committerSaul Wold <sgw@linux.intel.com>
Fri, 21 Sep 2012 05:21:14 +0000 (22:21 -0700)
In certain edge cases, bitbake may fail to run and cause setup_tmpdir()
within runqemu to fail, and not give the user a helpful error message.
Catch this case and show the user the output of bitbake -e.

This fixes [YOCTO #3112]

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
scripts/runqemu

index e843946e32a3c3b30ad68dad41d00ef56a4c07e9..a9f513c7a91b112cb12577ca7ddcafed33b64730 100755 (executable)
@@ -283,8 +283,16 @@ setup_tmpdir() {
         # We have bitbake in PATH, get OE_TMPDIR from bitbake
         OE_TMPDIR=`MACHINE=$MACHINE bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
         if [ -z "$OE_TMPDIR" ]; then
-            echo "Error: this script needs to be run from your build directory,"
-            echo "or you need to explicitly set OE_TMPDIR in your environment"
+            # Check for errors from bitbake that the user needs to know about
+            BITBAKE_OUTPUT=`bitbake -e | wc -l`
+            if [ "$BITBAKE_OUTPUT" -eq "0" ]; then
+                echo "Error: this script needs to be run from your build directory,"
+                echo "or you need to explicitly set OE_TMPDIR in your environment"
+            else
+                echo "There was an error running bitbake to determine TMPDIR"
+                echo "Here is the output from 'bitbake -e':"
+                bitbake -e
+            fi
             exit 1
         fi
     fi