summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-11-17 11:08:32 +0000
committerRichard Purdie <richard@openedhand.com>2006-11-17 11:08:32 +0000
commit4a9392f5a3295b900eebc81fd6fd64a8029525df (patch)
tree9211a76434c7cf72cbe4b55b4320d9574089bc3b /scripts
parentf4a8621a19550e4168a45e69386c82f031aa37f1 (diff)
downloadpoky-4a9392f5a3295b900eebc81fd6fd64a8029525df.tar.gz
Improve the qemu scripts and documentation (qemux86 support isn't complete yet)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@867 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/qemu-ifup (renamed from scripts/qemu/qemu-ifup)0
-rwxr-xr-xscripts/qemu/qemu-ext28
-rwxr-xr-xscripts/qemu/qemu-nfs14
-rwxr-xr-xscripts/runqemu48
-rw-r--r--scripts/runqemu.README (renamed from scripts/qemu/README)37
5 files changed, 67 insertions, 40 deletions
diff --git a/scripts/qemu/qemu-ifup b/scripts/qemu-ifup
index da3918c6ac..da3918c6ac 100755
--- a/scripts/qemu/qemu-ifup
+++ b/scripts/qemu-ifup
diff --git a/scripts/qemu/qemu-ext2 b/scripts/qemu/qemu-ext2
deleted file mode 100755
index 4d69f0f1ca..0000000000
--- a/scripts/qemu/qemu-ext2
+++ /dev/null
@@ -1,8 +0,0 @@
1#!/bin/sh
2
3if [ -z "$QEMU_MEMORY" ]
4then
5QEMU_MEMORY="64M"
6fi
7
8qemu-system-arm -kernel $1 -append "root=/dev/sda mem=$QEMU_MEMORY" -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=./qemu-ifup -M versatilepb -hda $2 -usb -usbdevice wacom-tablet
diff --git a/scripts/qemu/qemu-nfs b/scripts/qemu/qemu-nfs
deleted file mode 100755
index 503aaa2e02..0000000000
--- a/scripts/qemu/qemu-nfs
+++ /dev/null
@@ -1,14 +0,0 @@
1#!/bin/sh
2
3if [ -z "$QEMU_MEMORY" ]
4then
5QEMU_MEMORY="64M"
6fi
7
8# New command-line for versatile/PB
9dd if=/dev/zero of=/tmp/blank bs=1024 count=8192
10qemu-system-arm -kernel $1 -append "root=/dev/nfs 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=./qemu-ifup -M versatilepb -hda /tmp/blank
11rm /tmp/blank
12
13# Old command-line for versatile/CP
14#qemu-system-arm -kernel $1 -append "root=/dev/nfs nfsroot=192.168.7.1:/srv/qemuarm rw ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=$QEMU_MEMORY" -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=./qemu-ifup
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
3PATH=$BUILDDIR/tmp/staging/$BUILD_SYS/bin:$PATH
4
5if [ -z "$QEMU_MEMORY" ]; then
6 QEMU_MEMORY="64M"
7fi
8
9if [ "x$1" != "x" ]; then
10 MACHINE=$1
11else
12 MACHINE="qemuarm"
13fi
14
15if [ "x$2" != "x" ]; then
16 TYPE=$1
17else
18 TYPE="ext2"
19fi
20
21if [ "x$3" != "x" ]; then
22 ZIMAGE=$3
23fi
24
25if [ "x$4" != "x" ]; then
26 HDIMAGE=$4
27fi
28
29if [ "$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
47fi
48
diff --git a/scripts/qemu/README b/scripts/runqemu.README
index 10bf64ebba..713e273946 100644
--- a/scripts/qemu/README
+++ b/scripts/runqemu.README
@@ -1,19 +1,24 @@
1qemu-arm poky image notes 1Using qemu with poky notes
2========================= 2==========================
3 3
4Poky can generate qemu-system-arm bootable kernels and images with can 4Poky can generate qemu bootable kernels and images with can be used
5then be used on an x86 desktop. There are two ways to run such images; 5on a desktop system. Both arm and x86 images can currently be booted.
6The runqemu script is run as:
6 7
7Via ext2 filesystem image 8 runqemu <target> <type> <zimage> <filesystem>
8==========================
9 9
10Run; 10where:
11 11
12qemu-ext2 <zimage-qemuarm>.bin <filesystem-qemuarm>.ext2 12 <target> is "qemuarm" or "qemux86"
13 <type> is "ext2" or "nfs"
14 <zimage> is the path to a kernel (zimage-qemuarm.bin)
15 <filesystem> is the path to an ext2 image (filesystem-qemuarm.ext2)
13 16
17It will default to the qemuarm, ext2 and the last kernel and oh-image-pda
18image built by poky.
14 19
15Via NFS 20NFS Image Notes
16======== 21===============
17 22
18As root; 23As root;
19 24
@@ -33,26 +38,22 @@ Edit via /etc/exports :
33 38
34untar build/tmp/deploy/images/<built image>.rootfs.tar.bz2 into /srv/qemuarm 39untar build/tmp/deploy/images/<built image>.rootfs.tar.bz2 into /srv/qemuarm
35 40
36Move poky built qemu-system-arm into your path, i.e;
37
38% cp ./build/tmp/staging/i686-linux/bin/qemu-system-arm /usr/local/bin
39
40Finally, launch: 41Finally, launch:
41 42
42% ./qemu-nfs ../../build/tmp/deploy/images/<zimage-qemuarm>.bin 43% runqemu <target> nfs
43
44( change perms on /dev/net/tun to run as non root )
45 44
46Notes 45Notes
47===== 46=====
48 47
48 - The runqemu script runs qemu with sudo. Change perms on /dev/net/tun to
49 run as non root
49 - You can set QEMU_MEMORY env var to control amount of available memory 50 - You can set QEMU_MEMORY env var to control amount of available memory
50 ( defaults to 64M ) 51 ( defaults to 64M )
51 - There is a bug in qemu in that means occasionally it will use 100% cpu. 52 - There is a bug in qemu in that means occasionally it will use 100% cpu.
52 You will need to restart it in this situation. 53 You will need to restart it in this situation.
53 54
54
55More Info 55More Info
56========= 56=========
57 57
58 - See http://o-hand.com/~richard/qemu.html 58 - See http://o-hand.com/~richard/qemu.html
59