diff options
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-x | scripts/runqemu | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/scripts/runqemu b/scripts/runqemu new file mode 100755 index 0000000000..49403a6167 --- /dev/null +++ b/scripts/runqemu | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | PATH=$BUILDDIR/tmp/staging/$BUILD_SYS/bin:$PATH | ||
4 | |||
5 | if [ -z "$QEMU_MEMORY" ]; then | ||
6 | QEMU_MEMORY="64M" | ||
7 | fi | ||
8 | |||
9 | if [ "x$1" != "x" ]; then | ||
10 | MACHINE=$1 | ||
11 | else | ||
12 | MACHINE="qemuarm" | ||
13 | fi | ||
14 | |||
15 | if [ "x$2" != "x" ]; then | ||
16 | TYPE=$1 | ||
17 | else | ||
18 | TYPE="ext2" | ||
19 | fi | ||
20 | |||
21 | if [ "x$3" != "x" ]; then | ||
22 | ZIMAGE=$3 | ||
23 | fi | ||
24 | |||
25 | if [ "x$4" != "x" ]; then | ||
26 | HDIMAGE=$4 | ||
27 | fi | ||
28 | |||
29 | if [ "$MACHINE" == "qemuarm" ]; then | ||
30 | if [ "x$ZIMAGE" == "x" ]; then | ||
31 | ZIMAGE=$BUILDDIR/tmp/deploy/images/zImage-qemuarm.bin | ||
32 | fi | ||
33 | |||
34 | QEMU=`which qemu-system-arm` | ||
35 | |||
36 | if [ "$TYPE" == "ext2" ]; then | ||
37 | if [ "x$HDIMAGE" == "x" ]; then | ||
38 | HDIMAGE=$BUILDDIR/tmp/deploy/images/oh-image-pda-qemuarm.ext2 | ||
39 | fi | ||
40 | sudo $QEMU -kernel $ZIMAGE -append "root=/dev/sda mem=$QEMU_MEMORY" -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$OEROOT/scripts/qemu-ifup -M versatilepb -hda $HDIMAGE -usb -usbdevice wacom-tablet | ||
41 | fi | ||
42 | if [ "$TYPE" == "nfs" -a ]; then | ||
43 | dd if=/dev/zero of=/tmp/blank bs=1024 count=8192 | ||
44 | sudo $QEMU -kernel $1 -append "root=/dev/sda nfsroot=192.168.7.1:/srv/qemuarm rw ip=192.168.7.2::192.168.7.1:255.255.255.0" -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$OEROOT/scripts/qemu-ifup -M versatilepb -hda /tmp/blank | ||
45 | rm /tmp/blank | ||
46 | fi | ||
47 | fi | ||
48 | |||