From patchwork Fri Sep 14 23:15:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/1] runqemu: show bitbake errors to user Date: Fri, 14 Sep 2012 23:15:59 -0000 From: Scott Garman X-Patchwork-Id: 36561 Message-Id: <674d84a9020d9fc0abfe8a45e6476ef63987d3a6.1347664421.git.scott.a.garman@intel.com> To: openembedded-core@lists.openembedded.org 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 --- scripts/runqemu | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/runqemu b/scripts/runqemu index e843946..8bb77ff 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -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` + if [ -z "$BITBAKE_OUTPUT" ]; 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