summaryrefslogtreecommitdiffstats
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)
downloadpoky-36ed211c35abf9eb5f90ecef6fa57165117b28e9.tar.gz
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 @@
1#!/bin/sh 1#!/bin/bash
2 2
3# Handle running Poky images standalone with QEMU 3# Handle running Poky images standalone with QEMU
4# 4#
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 @@
1#!/bin/sh 1#!/bin/bash
2 2
3# Handle running Poky images under qemu 3# Handle running Poky images under qemu
4# 4#
@@ -45,18 +45,24 @@ if [ "x$SERIAL_LOGFILE" != "x" ]; then
45 SERIALOPTS="-serial file:$SERIAL_LOGFILE" 45 SERIALOPTS="-serial file:$SERIAL_LOGFILE"
46fi 46fi
47 47
48case "$MACHINE" in
49 "qemuarm") ;;
50 "qemux86") ;;
51 "akita") ;;
52 "spitz") ;;
53 *)
54 echo "Error: Unsupported machine type $MACHINE"
55 return
56 ;;
57esac
58
48if [ "$TYPE" != "nfs" -a ! -f "$HDIMAGE" ]; then 59if [ "$TYPE" != "nfs" -a ! -f "$HDIMAGE" ]; then
49 echo "Error, image file $HDIMAGE doesn't exist" 60 echo "Error: Image file $HDIMAGE doesn't exist"
50 return 61 return
51fi 62fi
52 63
53if [ ! -f "$ZIMAGE" ]; then 64if [ ! -f "$ZIMAGE" ]; then
54 echo "Error, kernel image file $ZIMAGE doesn't exist" 65 echo "Error: Kernel image file $ZIMAGE doesn't exist"
55 return
56fi
57
58if [ "$MACHINE" != "qemuarm" -a "$MACHINE" != "qemux86" -a "$MACHINE" != "akita" -a "$MACHINE" != "spitz" ]; then
59 echo "Error, unsupported machine type $MACHINE"
60 return 66 return
61fi 67fi
62 68
@@ -71,7 +77,7 @@ if [ "$MACHINE" = "qemuarm" ]; then
71 HDIMAGE=/srv/nfs/qemuarm 77 HDIMAGE=/srv/nfs/qemuarm
72 fi 78 fi
73 if [ ! -d "$HDIMAGE" ]; then 79 if [ ! -d "$HDIMAGE" ]; then
74 echo "Error, NFS mount point $HDIMAGE doesn't exist" 80 echo "Error: NFS mount point $HDIMAGE doesn't exist"
75 return 81 return
76 fi 82 fi
77 KERNCMDLINE="root=/dev/nfs nfsroot=192.168.7.1:$HDIMAGE rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" 83 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
90 HDIMAGE=/srv/nfs/qemux86 96 HDIMAGE=/srv/nfs/qemux86
91 fi 97 fi
92 if [ ! -d "$HDIMAGE" ]; then 98 if [ ! -d "$HDIMAGE" ]; then
93 echo "Error, NFS mount point $HDIMAGE doesn't exist." 99 echo "Error: NFS mount point $HDIMAGE doesn't exist."
94 return 100 return
95 fi 101 fi
96 KERNCMDLINE="root=/dev/nfs nfsroot=192.168.7.1:$HDIMAGE rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" 102 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
125fi 131fi
126 132
127if [ "x$QEMUOPTIONS" = "x" ]; then 133if [ "x$QEMUOPTIONS" = "x" ]; then
128 echo "Error, unable to support this combination of options" 134 echo "Error: Unable to support this combination of options"
129 return 135 return
130fi 136fi
131 137
@@ -141,6 +147,11 @@ PATH=$CROSSPATH:$SDKPATH:$PATH
141 147
142QEMUBIN=`which $QEMU` 148QEMUBIN=`which $QEMU`
143 149
150if [ ! -x "$QEMUBIN" ]; then
151 echo "Error: No QEMU binary '$QEMU' could be found."
152 return
153fi
154
144function _quit() { 155function _quit() {
145 if [ -n "$PIDFILE" ]; then 156 if [ -n "$PIDFILE" ]; then
146 #echo kill `cat $PIDFILE` 157 #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 @@
1#!/bin/sh 1#!/bin/bash
2 2
3# Handle Poky <-> QEmu interface voodoo 3# Handle Poky <-> QEmu interface voodoo
4# 4#
@@ -122,4 +122,3 @@ fi
122CROSSPATH=$BUILDDIR/tmp/staging/$BUILD_SYS/usr/bin:$CROSSPATH:$BUILDDIR/tmp/cross/bin 122CROSSPATH=$BUILDDIR/tmp/staging/$BUILD_SYS/usr/bin:$CROSSPATH:$BUILDDIR/tmp/cross/bin
123 123
124. $INTERNAL_SCRIPT 124. $INTERNAL_SCRIPT
125