The runqemu script needs to determine TMPDIR in order to find the native sysroot to run qemu, tunctl, etc. It executes bitbake -e | grep ^TMPDIR in order to do this. However, in certain edge cases this command can fail to run, and when this happens you get the following error message: Error: this script needs to be run from your build directory, or you need to explicitly set OE_TMPDIR in your environment Which is misleading, when, for example, bitbake is failing because LCONF_VERSION in bblayers.conf needs to be upgraded. In order to show this error message from bitbake, an additional check is needed to collect the error output of bitbake and show it to the user.
Fixed in oe-core and poky master as of: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=32fdbd879c83dae7c23ee0f17d0035bbae832495
Verified in 27af23e65f63b41962a7cfddba9e9372d5212396