aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/poky-qemu
diff options
context:
space:
mode:
authorScott Garman <scott.a.garman@intel.com>2010-12-07 20:59:06 -0800
committerRichard Purdie <rpurdie@linux.intel.com>2010-12-09 15:00:45 +0000
commitba5e0b9531b9a967aa3d408a13024590d96b8391 (patch)
tree47b7536aa4da6efc78106a1a57c6ebe9a13e91d2 /scripts/poky-qemu
parent7581654a030961eda03b07de0e0f6d62a7f4055e (diff)
downloadopenembedded-core-ba5e0b9531b9a967aa3d408a13024590d96b8391.tar.gz
Make poky-qemu and related scripts work with arbitrary SDK locations
* No longer assume SDK toolchains are installed in /opt/poky * [BUGFIX #568] where specifying paths to both the kernel and fs image caused an error due to POKY_NATIVE_SYSROOT never being set, triggering failure of poky-qemu-ifup/ifdown * Cosmetic improvements to usage() functions by using basename Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Diffstat (limited to 'scripts/poky-qemu')
-rwxr-xr-xscripts/poky-qemu38
1 files changed, 22 insertions, 16 deletions
diff --git a/scripts/poky-qemu b/scripts/poky-qemu
index bc312e0fb6..67af439ea9 100755
--- a/scripts/poky-qemu
+++ b/scripts/poky-qemu
@@ -31,9 +31,9 @@ usage() {
echo " serial - enables a serial console on /dev/ttyS0"
echo ""
echo "Examples:"
- echo " $0 qemuarm"
- echo " $0 qemux86-64 poky-image-sato ext3"
- echo " $0 path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial"
+ echo " $MYNAME qemuarm"
+ echo " $MYNAME qemux86-64 poky-image-sato ext3"
+ echo " $MYNAME path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial"
exit 1
}
@@ -213,23 +213,29 @@ setup_tmpdir() {
echo "before running this script" >&2;
exit 1; }
- # We have bitbake in PATH, get TMPDIR and BUILD_SYS
- # from the environment
+ # We have bitbake in PATH, get TMPDIR from bitbake
TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
- BUILD_SYS=`bitbake -e | grep BUILD_SYS=\" | cut -d '=' -f2 | cut -d '"' -f2`
else
- BUILD_ARCH=`uname -m`
- BUILD_OS=`uname | tr '[A-Z]' '[a-z]'`
- BUILD_SYS="$BUILD_ARCH-$BUILD_OS"
TMPDIR=$BUILDDIR/tmp
fi
- if [ -z "$POKY_NATIVE_SYSROOT" ]; then
- POKY_NATIVE_SYSROOT=$TMPDIR/sysroots/$BUILD_SYS
- fi
- CROSSPATH=$POKY_NATIVE_SYSROOT/usr/bin
fi
}
+setup_sysroot() {
+ # Toolchain installs set up $POKY_NATIVE_SYSROOT in their
+ # environment script. If that variable isn't set, we're
+ # either in an in-tree poky scenario or the environment
+ # script wasn't source'd.
+ if [ -z "$POKY_NATIVE_SYSROOT" ]; then
+ setup_tmpdir
+ BUILD_ARCH=`uname -m`
+ BUILD_OS=`uname | tr '[A-Z]' '[a-z]'`
+ BUILD_SYS="$BUILD_ARCH-$BUILD_OS"
+
+ POKY_NATIVE_SYSROOT=$TMPDIR/sysroots/$BUILD_SYS
+ fi
+}
+
# Locate a rootfs image based on defaults defined above
findimage() {
where=$1
@@ -254,8 +260,6 @@ findimage() {
}
if [[ -e "$ROOTFS" && -z "$FSTYPE" ]]; then
- setup_tmpdir
-
# Extract the filename extension
EXT=`echo $ROOTFS | awk -F . '{ print \$NF }'`
if [[ "x$EXT" == "xext2" || "x$EXT" == "xext3" ||
@@ -281,7 +285,6 @@ fi
# KERNEL is now set for all cases
if [ -z "$FSTYPE" ]; then
- setup_tmpdir
eval FSTYPE=\$${machine2}_DEFAULT_FSTYPE
if [ -z "$FSTYPE" ]; then
@@ -318,6 +321,9 @@ echo "KERNEL: [$KERNEL]"
echo "ROOTFS: [$ROOTFS]"
echo "FSTYPE: [$FSTYPE]"
+setup_sysroot
+# POKY_NATIVE_SYSROOT is now set for all cases
+
# We can't run without a libGL.so
libgl='no'