diff options
| -rwxr-xr-x | scripts/runqemu | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 5aed25a7e5..dacaf7caac 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
| @@ -272,22 +272,27 @@ setup_tmpdir() { | |||
| 272 | 272 | ||
| 273 | # We have bitbake in PATH, get TMPDIR from bitbake | 273 | # We have bitbake in PATH, get TMPDIR from bitbake |
| 274 | TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2` | 274 | TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2` |
| 275 | if [ -z "$TMPDIR" ]; then | ||
| 276 | echo "Error: this script needs to be run from your build directory," | ||
| 277 | echo "or you need to explicitly set TMPDIR in your environment" | ||
| 278 | exit 1 | ||
| 279 | fi | ||
| 275 | fi | 280 | fi |
| 276 | } | 281 | } |
| 277 | 282 | ||
| 278 | setup_sysroot() { | 283 | setup_sysroot() { |
| 279 | # Toolchain installs set up $OECORE_NATIVE_SYSROOT in their | 284 | # Toolchain installs set up $OECORE_NATIVE_SYSROOT in their |
| 280 | # environment script. If that variable isn't set, we're | 285 | # environment script. If that variable isn't set, we're |
| 281 | # either in an in-tree build scenario or the environment | 286 | # either in an in-tree build scenario or the environment |
| 282 | # script wasn't source'd. | 287 | # script wasn't source'd. |
| 283 | if [ -z "$OECORE_NATIVE_SYSROOT" ]; then | 288 | if [ -z "$OECORE_NATIVE_SYSROOT" ]; then |
| 284 | setup_tmpdir | 289 | setup_tmpdir |
| 285 | BUILD_ARCH=`uname -m` | 290 | BUILD_ARCH=`uname -m` |
| 286 | BUILD_OS=`uname | tr '[A-Z]' '[a-z]'` | 291 | BUILD_OS=`uname | tr '[A-Z]' '[a-z]'` |
| 287 | BUILD_SYS="$BUILD_ARCH-$BUILD_OS" | 292 | BUILD_SYS="$BUILD_ARCH-$BUILD_OS" |
| 288 | 293 | ||
| 289 | OECORE_NATIVE_SYSROOT=$TMPDIR/sysroots/$BUILD_SYS | 294 | OECORE_NATIVE_SYSROOT=$TMPDIR/sysroots/$BUILD_SYS |
| 290 | fi | 295 | fi |
| 291 | } | 296 | } |
| 292 | 297 | ||
| 293 | # Locate a rootfs image based on defaults defined above | 298 | # Locate a rootfs image based on defaults defined above |
