diff options
Diffstat (limited to 'scripts/poky-qemu-internal')
-rwxr-xr-x | scripts/poky-qemu-internal | 33 |
1 files changed, 22 insertions, 11 deletions
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" |
46 | fi | 46 | fi |
47 | 47 | ||
48 | case "$MACHINE" in | ||
49 | "qemuarm") ;; | ||
50 | "qemux86") ;; | ||
51 | "akita") ;; | ||
52 | "spitz") ;; | ||
53 | *) | ||
54 | echo "Error: Unsupported machine type $MACHINE" | ||
55 | return | ||
56 | ;; | ||
57 | esac | ||
58 | |||
48 | if [ "$TYPE" != "nfs" -a ! -f "$HDIMAGE" ]; then | 59 | if [ "$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 |
51 | fi | 62 | fi |
52 | 63 | ||
53 | if [ ! -f "$ZIMAGE" ]; then | 64 | if [ ! -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 | ||
56 | fi | ||
57 | |||
58 | if [ "$MACHINE" != "qemuarm" -a "$MACHINE" != "qemux86" -a "$MACHINE" != "akita" -a "$MACHINE" != "spitz" ]; then | ||
59 | echo "Error, unsupported machine type $MACHINE" | ||
60 | return | 66 | return |
61 | fi | 67 | fi |
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 | |||
125 | fi | 131 | fi |
126 | 132 | ||
127 | if [ "x$QEMUOPTIONS" = "x" ]; then | 133 | if [ "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 |
130 | fi | 136 | fi |
131 | 137 | ||
@@ -141,6 +147,11 @@ PATH=$CROSSPATH:$SDKPATH:$PATH | |||
141 | 147 | ||
142 | QEMUBIN=`which $QEMU` | 148 | QEMUBIN=`which $QEMU` |
143 | 149 | ||
150 | if [ ! -x "$QEMUBIN" ]; then | ||
151 | echo "Error: No QEMU binary '$QEMU' could be found." | ||
152 | return | ||
153 | fi | ||
154 | |||
144 | function _quit() { | 155 | function _quit() { |
145 | if [ -n "$PIDFILE" ]; then | 156 | if [ -n "$PIDFILE" ]; then |
146 | #echo kill `cat $PIDFILE` | 157 | #echo kill `cat $PIDFILE` |