summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-02-22 16:23:33 +0000
committerRichard Purdie <richard@openedhand.com>2008-02-22 16:23:33 +0000
commit36ed211c35abf9eb5f90ecef6fa57165117b28e9 (patch)
treeec5875927aac3738814c8cc23030efa26cf390be /scripts
parent2084d46ed48b39f7f9d6c84b7236d40e3af7bb8b (diff)
downloadopenembedded-core-36ed211c35abf9eb5f90ecef6fa57165117b28e9.tar.gz
openembedded-core-36ed211c35abf9eb5f90ecef6fa57165117b28e9.tar.bz2
openembedded-core-36ed211c35abf9eb5f90ecef6fa57165117b28e9.zip
scripts: Mark qemu scripts as bash specific to avoid dash problems and error if a suitable qemu binary can't be found
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3859 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/poky-qemu2
-rwxr-xr-xscripts/poky-qemu-internal33
-rwxr-xr-xscripts/runqemu3
3 files changed, 24 insertions, 14 deletions
diff --git a/scripts/poky-qemu b/scripts/poky-qemu
index 79456f6a60..9030700ded 100755
--- a/scripts/poky-qemu
+++ b/scripts/poky-qemu
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Handle running Poky images standalone with QEMU
#
diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal
index aad967a95e..1a8fb63b35 100755
--- a/scripts/poky-qemu-internal
+++ b/scripts/poky-qemu-internal
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Handle running Poky images under qemu
#
@@ -45,18 +45,24 @@ if [ "x$SERIAL_LOGFILE" != "x" ]; then
SERIALOPTS="-serial file:$SERIAL_LOGFILE"
fi
+case "$MACHINE" in
+ "qemuarm") ;;
+ "qemux86") ;;
+ "akita") ;;
+ "spitz") ;;
+ *)
+ echo "Error: Unsupported machine type $MACHINE"
+ return
+ ;;
+esac
+
if [ "$TYPE" != "nfs" -a ! -f "$HDIMAGE" ]; then
- echo "Error, image file $HDIMAGE doesn't exist"
+ echo "Error: Image file $HDIMAGE doesn't exist"
return
fi
if [ ! -f "$ZIMAGE" ]; then
- echo "Error, kernel image file $ZIMAGE doesn't exist"
- return
-fi
-
-if [ "$MACHINE" != "qemuarm" -a "$MACHINE" != "qemux86" -a "$MACHINE" != "akita" -a "$MACHINE" != "spitz" ]; then
- echo "Error, unsupported machine type $MACHINE"
+ echo "Error: Kernel image file $ZIMAGE doesn't exist"
return
fi
@@ -71,7 +77,7 @@ if [ "$MACHINE" = "qemuarm" ]; then
HDIMAGE=/srv/nfs/qemuarm
fi
if [ ! -d "$HDIMAGE" ]; then
- echo "Error, NFS mount point $HDIMAGE doesn't exist"
+ echo "Error: NFS mount point $HDIMAGE doesn't exist"
return
fi
KERNCMDLINE="root=/dev/nfs nfsroot=192.168.7.1:$HDIMAGE rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
@@ -90,7 +96,7 @@ if [ "$MACHINE" = "qemux86" ]; then
HDIMAGE=/srv/nfs/qemux86
fi
if [ ! -d "$HDIMAGE" ]; then
- echo "Error, NFS mount point $HDIMAGE doesn't exist."
+ echo "Error: NFS mount point $HDIMAGE doesn't exist."
return
fi
KERNCMDLINE="root=/dev/nfs nfsroot=192.168.7.1:$HDIMAGE rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
@@ -125,7 +131,7 @@ if [ "$MACHINE" = "akita" ]; then
fi
if [ "x$QEMUOPTIONS" = "x" ]; then
- echo "Error, unable to support this combination of options"
+ echo "Error: Unable to support this combination of options"
return
fi
@@ -141,6 +147,11 @@ PATH=$CROSSPATH:$SDKPATH:$PATH
QEMUBIN=`which $QEMU`
+if [ ! -x "$QEMUBIN" ]; then
+ echo "Error: No QEMU binary '$QEMU' could be found."
+ return
+fi
+
function _quit() {
if [ -n "$PIDFILE" ]; then
#echo kill `cat $PIDFILE`
diff --git a/scripts/runqemu b/scripts/runqemu
index 673490bf23..4bbd3f6d8a 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Handle Poky <-> QEmu interface voodoo
#
@@ -122,4 +122,3 @@ fi
CROSSPATH=$BUILDDIR/tmp/staging/$BUILD_SYS/usr/bin:$CROSSPATH:$BUILDDIR/tmp/cross/bin
. $INTERNAL_SCRIPT
-