diff options
author | Richard Purdie <richard@openedhand.com> | 2006-11-17 11:08:32 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2006-11-17 11:08:32 +0000 |
commit | 4a9392f5a3295b900eebc81fd6fd64a8029525df (patch) | |
tree | 9211a76434c7cf72cbe4b55b4320d9574089bc3b /scripts | |
parent | f4a8621a19550e4168a45e69386c82f031aa37f1 (diff) | |
download | poky-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-x | scripts/qemu-ifup (renamed from scripts/qemu/qemu-ifup) | 0 | ||||
-rwxr-xr-x | scripts/qemu/qemu-ext2 | 8 | ||||
-rwxr-xr-x | scripts/qemu/qemu-nfs | 14 | ||||
-rwxr-xr-x | scripts/runqemu | 48 | ||||
-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 | |||
3 | if [ -z "$QEMU_MEMORY" ] | ||
4 | then | ||
5 | QEMU_MEMORY="64M" | ||
6 | fi | ||
7 | |||
8 | qemu-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 | |||
3 | if [ -z "$QEMU_MEMORY" ] | ||
4 | then | ||
5 | QEMU_MEMORY="64M" | ||
6 | fi | ||
7 | |||
8 | # New command-line for versatile/PB | ||
9 | dd if=/dev/zero of=/tmp/blank bs=1024 count=8192 | ||
10 | 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" -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=./qemu-ifup -M versatilepb -hda /tmp/blank | ||
11 | rm /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 | |||
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 | |||
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 @@ | |||
1 | qemu-arm poky image notes | 1 | Using qemu with poky notes |
2 | ========================= | 2 | ========================== |
3 | 3 | ||
4 | Poky can generate qemu-system-arm bootable kernels and images with can | 4 | Poky can generate qemu bootable kernels and images with can be used |
5 | then be used on an x86 desktop. There are two ways to run such images; | 5 | on a desktop system. Both arm and x86 images can currently be booted. |
6 | The runqemu script is run as: | ||
6 | 7 | ||
7 | Via ext2 filesystem image | 8 | runqemu <target> <type> <zimage> <filesystem> |
8 | ========================== | ||
9 | 9 | ||
10 | Run; | 10 | where: |
11 | 11 | ||
12 | qemu-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 | ||
17 | It will default to the qemuarm, ext2 and the last kernel and oh-image-pda | ||
18 | image built by poky. | ||
14 | 19 | ||
15 | Via NFS | 20 | NFS Image Notes |
16 | ======== | 21 | =============== |
17 | 22 | ||
18 | As root; | 23 | As root; |
19 | 24 | ||
@@ -33,26 +38,22 @@ Edit via /etc/exports : | |||
33 | 38 | ||
34 | untar build/tmp/deploy/images/<built image>.rootfs.tar.bz2 into /srv/qemuarm | 39 | untar build/tmp/deploy/images/<built image>.rootfs.tar.bz2 into /srv/qemuarm |
35 | 40 | ||
36 | Move 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 | |||
40 | Finally, launch: | 41 | Finally, 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 | ||
46 | Notes | 45 | Notes |
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 | |||
55 | More Info | 55 | More Info |
56 | ========= | 56 | ========= |
57 | 57 | ||
58 | - See http://o-hand.com/~richard/qemu.html | 58 | - See http://o-hand.com/~richard/qemu.html |
59 | |||