]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts: Mark qemu scripts as bash specific to avoid dash problems and error if a...
authorRichard Purdie <richard@openedhand.com>
Fri, 22 Feb 2008 16:23:33 +0000 (16:23 +0000)
committerRichard Purdie <richard@openedhand.com>
Fri, 22 Feb 2008 16:23:33 +0000 (16:23 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3859 311d38ba-8fff-0310-9ca6-ca027cbcb966

scripts/poky-qemu
scripts/poky-qemu-internal
scripts/runqemu

index 79456f6a60c8b1015f736c4b0ec3bbf842376c4d..9030700dedc873382322359d06b7bbb5f3d04555 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Handle running Poky images standalone with QEMU
 #
index aad967a95e4e999226c8a8b166cd05fecac6a19c..1a8fb63b358dae7d2b765ffc4d29d53527162818 100755 (executable)
@@ -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`
index 673490bf23a300d78debcc5b7bb5e9a9f2bad78b..4bbd3f6d8aeab6f54be41c9dd208055f07820602 100755 (executable)
@@ -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
-