Skip to contentSkip to conversation

runqemu bugfix [v2]

PATCH Applied Scott Garman 2 participants 3 messages Sep 19, 2012 – Sep 21, 2012

lore
Share & tools
lore
#0 lore raw

cover runqemu bugfix [v2]

Hello,

This is a fix for Yocto bug #3112, where there are certain edge cases where the bitbake command is avalable to fails to run. Previously we mistakenly treated that as the same case as if bitbake didn't exist in the user's $PATH, and this fix causes us to show the user the output of bitbake so they can view the error message.

v2 includes rework based on feedback from Mark Hatle (thanks!).

Scott

The following changes since commit 7887b99646d8e1e736ad6e4a306e47df9955221e:

local.conf.sample: change valgrind support architecture comment (2012-09-14 17:05:59 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib sgarman/runqemu-bitbake-fix-oe
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=sgarman/runqemu-bitbake-fix-oe

Scott Garman (1):
runqemu: show bitbake errors to user

 scripts/runqemu |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 runqemu: show bitbake errors to user

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]

---
 scripts/runqemu |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
scripts/runqemu +10 -2
index e843946..a9f513c 100755
@@ -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
Signature · 1 line
1.7.9.5
Applied
#2 lore raw
In reply to Scott Garman
Quoted 18 lines · Scott Garman

Hello,

This is a fix for Yocto bug #3112, where there are certain edge cases where the bitbake command is avalable to fails to run. Previously we mistakenly treated that as the same case as if bitbake didn't exist in the user's $PATH, and this fix causes us to show the user the output of bitbake so they can view the error message.

v2 includes rework based on feedback from Mark Hatle (thanks!).

Scott

The following changes since commit 7887b99646d8e1e736ad6e4a306e47df9955221e:

   local.conf.sample: change valgrind support architecture comment (2012-09-14 17:05:59 +0100)

are available in the git repository at:

Quoted 9 lines

git://git.yoctoproject.org/poky-contrib sgarman/runqemu-bitbake-fix-oe
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=sgarman/runqemu-bitbake-fix-oe

Scott Garman (1):
runqemu: show bitbake errors to user

  scripts/runqemu |   12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)

Merged into OE-Core

Thanks
Sau!