summaryrefslogtreecommitdiffstats
path: root/scripts/poky-qemu-internal
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/poky-qemu-internal')
-rwxr-xr-xscripts/poky-qemu-internal33
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"
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`