mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
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] (From OE-Core rev: ab5544ac801a976b56468ade0f5d2e95c11feb87) Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
e9e77799a1
commit
3fddac4ee9
+16
-11
@@ -272,22 +272,27 @@ setup_tmpdir() {
|
|||||||
|
|
||||||
# We have bitbake in PATH, get TMPDIR from bitbake
|
# We have bitbake in PATH, get TMPDIR from bitbake
|
||||||
TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_sysroot() {
|
setup_sysroot() {
|
||||||
# Toolchain installs set up $OECORE_NATIVE_SYSROOT in their
|
# Toolchain installs set up $OECORE_NATIVE_SYSROOT in their
|
||||||
# environment script. If that variable isn't set, we're
|
# environment script. If that variable isn't set, we're
|
||||||
# either in an in-tree build scenario or the environment
|
# either in an in-tree build scenario or the environment
|
||||||
# script wasn't source'd.
|
# script wasn't source'd.
|
||||||
if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
|
if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
|
||||||
setup_tmpdir
|
setup_tmpdir
|
||||||
BUILD_ARCH=`uname -m`
|
BUILD_ARCH=`uname -m`
|
||||||
BUILD_OS=`uname | tr '[A-Z]' '[a-z]'`
|
BUILD_OS=`uname | tr '[A-Z]' '[a-z]'`
|
||||||
BUILD_SYS="$BUILD_ARCH-$BUILD_OS"
|
BUILD_SYS="$BUILD_ARCH-$BUILD_OS"
|
||||||
|
|
||||||
OECORE_NATIVE_SYSROOT=$TMPDIR/sysroots/$BUILD_SYS
|
OECORE_NATIVE_SYSROOT=$TMPDIR/sysroots/$BUILD_SYS
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Locate a rootfs image based on defaults defined above
|
# Locate a rootfs image based on defaults defined above
|
||||||
|
|||||||
Reference in New Issue
Block a user