diff options
author | Scott Garman <scott.a.garman@intel.com> | 2011-07-22 18:23:27 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-07-25 12:38:42 +0100 |
commit | ab5544ac801a976b56468ade0f5d2e95c11feb87 (patch) | |
tree | 24a688a3a94092f07f7b19382bf8ddbfc6e272fe /scripts/runqemu | |
parent | b3e68f112cff5f15b5245582eee7e087acbad2fa (diff) | |
download | openembedded-core-ab5544ac801a976b56468ade0f5d2e95c11feb87.tar.gz openembedded-core-ab5544ac801a976b56468ade0f5d2e95c11feb87.tar.bz2 openembedded-core-ab5544ac801a976b56468ade0f5d2e95c11feb87.tar.xz openembedded-core-ab5544ac801a976b56468ade0f5d2e95c11feb87.zip |
runqemu: report error if TMPDIR cannot be determined
Invoking runqemu outside of the build directory for an
in-tree setup results in an empty TMPDIR because bitbake -e
cannot be run to find it.
A symptom of this problem is running runqemu and getting the
following error:
Error: Unable to find tunctl binary in <directory>
Catch this case and report the error to the user.
This fixes [YOCTO #1278]
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-x | scripts/runqemu | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 5aed25a7e..dacaf7caa 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -272,22 +272,27 @@ setup_tmpdir() { # We have bitbake in PATH, get TMPDIR from bitbake TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2` + if [ -z "$TMPDIR" ]; then + echo "Error: this script needs to be run from your build directory," + echo "or you need to explicitly set TMPDIR in your environment" + exit 1 + fi fi } setup_sysroot() { - # Toolchain installs set up $OECORE_NATIVE_SYSROOT in their - # environment script. If that variable isn't set, we're - # either in an in-tree build scenario or the environment - # script wasn't source'd. - if [ -z "$OECORE_NATIVE_SYSROOT" ]; then - setup_tmpdir - BUILD_ARCH=`uname -m` - BUILD_OS=`uname | tr '[A-Z]' '[a-z]'` - BUILD_SYS="$BUILD_ARCH-$BUILD_OS" - - OECORE_NATIVE_SYSROOT=$TMPDIR/sysroots/$BUILD_SYS - fi + # Toolchain installs set up $OECORE_NATIVE_SYSROOT in their + # environment script. If that variable isn't set, we're + # either in an in-tree build scenario or the environment + # script wasn't source'd. + if [ -z "$OECORE_NATIVE_SYSROOT" ]; then + setup_tmpdir + BUILD_ARCH=`uname -m` + BUILD_OS=`uname | tr '[A-Z]' '[a-z]'` + BUILD_SYS="$BUILD_ARCH-$BUILD_OS" + + OECORE_NATIVE_SYSROOT=$TMPDIR/sysroots/$BUILD_SYS + fi } # Locate a rootfs image based on defaults defined above |