From 4a9392f5a3295b900eebc81fd6fd64a8029525df Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 17 Nov 2006 11:08:32 +0000 Subject: 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 --- scripts/qemu-ifup | 2 ++ scripts/qemu/README | 58 ------------------------------------------------- scripts/qemu/qemu-ext2 | 8 ------- scripts/qemu/qemu-ifup | 2 -- scripts/qemu/qemu-nfs | 14 ------------ scripts/runqemu | 48 ++++++++++++++++++++++++++++++++++++++++ scripts/runqemu.README | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 109 insertions(+), 82 deletions(-) create mode 100755 scripts/qemu-ifup delete mode 100644 scripts/qemu/README delete mode 100755 scripts/qemu/qemu-ext2 delete mode 100755 scripts/qemu/qemu-ifup delete mode 100755 scripts/qemu/qemu-nfs create mode 100755 scripts/runqemu create mode 100644 scripts/runqemu.README (limited to 'scripts') diff --git a/scripts/qemu-ifup b/scripts/qemu-ifup new file mode 100755 index 0000000000..da3918c6ac --- /dev/null +++ b/scripts/qemu-ifup @@ -0,0 +1,2 @@ +#!/bin/sh +ifconfig tap0 192.168.7.1 \ No newline at end of file diff --git a/scripts/qemu/README b/scripts/qemu/README deleted file mode 100644 index 10bf64ebba..0000000000 --- a/scripts/qemu/README +++ /dev/null @@ -1,58 +0,0 @@ -qemu-arm poky image notes -========================= - -Poky can generate qemu-system-arm bootable kernels and images with can -then be used on an x86 desktop. There are two ways to run such images; - -Via ext2 filesystem image -========================== - -Run; - -qemu-ext2 .bin .ext2 - - -Via NFS -======== - -As root; - -% apt-get install nfs-kernel-server - -% mkdir /srv/qemuarm - -Edit via /etc/exports : - -# /etc/exports: the access control list for filesystems which may be exported -# to NFS clients. See exports(5). -/srv/qemuarm 192.168.7.2(rw,no_root_squash) - -% /etc/init.d/nfs-kernel-server restart - -% modprobe tun - -untar build/tmp/deploy/images/.rootfs.tar.bz2 into /srv/qemuarm - -Move poky built qemu-system-arm into your path, i.e; - -% cp ./build/tmp/staging/i686-linux/bin/qemu-system-arm /usr/local/bin - -Finally, launch: - -% ./qemu-nfs ../../build/tmp/deploy/images/.bin - -( change perms on /dev/net/tun to run as non root ) - -Notes -===== - - - You can set QEMU_MEMORY env var to control amount of available memory - ( defaults to 64M ) - - There is a bug in qemu in that means occasionally it will use 100% cpu. - You will need to restart it in this situation. - - -More Info -========= - - - See http://o-hand.com/~richard/qemu.html 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 @@ -#!/bin/sh - -if [ -z "$QEMU_MEMORY" ] -then -QEMU_MEMORY="64M" -fi - -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-ifup b/scripts/qemu/qemu-ifup deleted file mode 100755 index da3918c6ac..0000000000 --- a/scripts/qemu/qemu-ifup +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -ifconfig tap0 192.168.7.1 \ No newline at end of file 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 @@ -#!/bin/sh - -if [ -z "$QEMU_MEMORY" ] -then -QEMU_MEMORY="64M" -fi - -# New command-line for versatile/PB -dd if=/dev/zero of=/tmp/blank bs=1024 count=8192 -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 -rm /tmp/blank - -# Old command-line for versatile/CP -#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 @@ +#!/bin/sh + +PATH=$BUILDDIR/tmp/staging/$BUILD_SYS/bin:$PATH + +if [ -z "$QEMU_MEMORY" ]; then + QEMU_MEMORY="64M" +fi + +if [ "x$1" != "x" ]; then + MACHINE=$1 +else + MACHINE="qemuarm" +fi + +if [ "x$2" != "x" ]; then + TYPE=$1 +else + TYPE="ext2" +fi + +if [ "x$3" != "x" ]; then + ZIMAGE=$3 +fi + +if [ "x$4" != "x" ]; then + HDIMAGE=$4 +fi + +if [ "$MACHINE" == "qemuarm" ]; then + if [ "x$ZIMAGE" == "x" ]; then + ZIMAGE=$BUILDDIR/tmp/deploy/images/zImage-qemuarm.bin + fi + + QEMU=`which qemu-system-arm` + + if [ "$TYPE" == "ext2" ]; then + if [ "x$HDIMAGE" == "x" ]; then + HDIMAGE=$BUILDDIR/tmp/deploy/images/oh-image-pda-qemuarm.ext2 + fi + 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 + fi + if [ "$TYPE" == "nfs" -a ]; then + dd if=/dev/zero of=/tmp/blank bs=1024 count=8192 + 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 + rm /tmp/blank + fi +fi + diff --git a/scripts/runqemu.README b/scripts/runqemu.README new file mode 100644 index 0000000000..713e273946 --- /dev/null +++ b/scripts/runqemu.README @@ -0,0 +1,59 @@ +Using qemu with poky notes +========================== + +Poky can generate qemu bootable kernels and images with can be used +on a desktop system. Both arm and x86 images can currently be booted. +The runqemu script is run as: + + runqemu + +where: + + is "qemuarm" or "qemux86" + is "ext2" or "nfs" + is the path to a kernel (zimage-qemuarm.bin) + is the path to an ext2 image (filesystem-qemuarm.ext2) + +It will default to the qemuarm, ext2 and the last kernel and oh-image-pda +image built by poky. + +NFS Image Notes +=============== + +As root; + +% apt-get install nfs-kernel-server + +% mkdir /srv/qemuarm + +Edit via /etc/exports : + +# /etc/exports: the access control list for filesystems which may be exported +# to NFS clients. See exports(5). +/srv/qemuarm 192.168.7.2(rw,no_root_squash) + +% /etc/init.d/nfs-kernel-server restart + +% modprobe tun + +untar build/tmp/deploy/images/.rootfs.tar.bz2 into /srv/qemuarm + +Finally, launch: + +% runqemu nfs + +Notes +===== + + - The runqemu script runs qemu with sudo. Change perms on /dev/net/tun to + run as non root + - You can set QEMU_MEMORY env var to control amount of available memory + ( defaults to 64M ) + - There is a bug in qemu in that means occasionally it will use 100% cpu. + You will need to restart it in this situation. + +More Info +========= + + - See http://o-hand.com/~richard/qemu.html + -- cgit v1.2.3-54-g00ecf