diff options
| -rwxr-xr-x | scripts/poky-qemu (renamed from scripts/runqemu-standalone) | 2 | ||||
| -rwxr-xr-x | scripts/poky-qemu-ifup (renamed from scripts/qemu-ifup) | 0 | ||||
| -rwxr-xr-x | scripts/poky-qemu-internal (renamed from scripts/runqemu-internal) | 2 | ||||
| -rw-r--r-- | scripts/poky-qemu.README | 96 | ||||
| -rwxr-xr-x | scripts/runqemu | 4 | ||||
| -rw-r--r-- | scripts/runqemu.README | 61 |
6 files changed, 100 insertions, 65 deletions
diff --git a/scripts/runqemu-standalone b/scripts/poky-qemu index 08829e933f..8710e05dd6 100755 --- a/scripts/runqemu-standalone +++ b/scripts/poky-qemu | |||
| @@ -40,6 +40,6 @@ if [ "x$MACHINE" = "x" ]; then | |||
| 40 | MACHINE=`basename $ZIMAGE | sed -e 's#.*-\([a-z]*\)-*[0-9]*..*#\1#'` | 40 | MACHINE=`basename $ZIMAGE | sed -e 's#.*-\([a-z]*\)-*[0-9]*..*#\1#'` |
| 41 | fi | 41 | fi |
| 42 | 42 | ||
| 43 | INTERNAL_SCRIPT=`which runqemu-internal` | 43 | INTERNAL_SCRIPT=`which poky-qemu-internal` |
| 44 | source $INTERNAL_SCRIPT | 44 | source $INTERNAL_SCRIPT |
| 45 | 45 | ||
diff --git a/scripts/qemu-ifup b/scripts/poky-qemu-ifup index af081fb4d7..af081fb4d7 100755 --- a/scripts/qemu-ifup +++ b/scripts/poky-qemu-ifup | |||
diff --git a/scripts/runqemu-internal b/scripts/poky-qemu-internal index 1ad0ef34b8..e13f1b6dbe 100755 --- a/scripts/runqemu-internal +++ b/scripts/poky-qemu-internal | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | # HDIMAGE - the disk image file to use | 27 | # HDIMAGE - the disk image file to use |
| 28 | # | 28 | # |
| 29 | 29 | ||
| 30 | QEMUIFUP=`which qemu-ifup` | 30 | QEMUIFUP=`which poky-qemu-ifup` |
| 31 | KERNEL_NETWORK_CMD="ip=192.168.7.2::192.168.7.1:255.255.255.0" | 31 | KERNEL_NETWORK_CMD="ip=192.168.7.2::192.168.7.1:255.255.255.0" |
| 32 | QEMU_NETWORK_CMD="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$QEMUIFUP" | 32 | QEMU_NETWORK_CMD="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$QEMUIFUP" |
| 33 | 33 | ||
diff --git a/scripts/poky-qemu.README b/scripts/poky-qemu.README new file mode 100644 index 0000000000..1b4e763a38 --- /dev/null +++ b/scripts/poky-qemu.README | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | Poky images with QEMU | ||
| 2 | ===================== | ||
| 3 | |||
| 4 | Poky can generate qemu bootable kernels and images with can be used | ||
| 5 | on a desktop system. Both arm and x86 images can currently be booted. | ||
| 6 | There are two scripts, runqemu and poky-qemu, one for use within poky, | ||
| 7 | the other externally. | ||
| 8 | |||
| 9 | QEMU outside Poky (poky-qemu) | ||
| 10 | ============================= | ||
| 11 | |||
| 12 | The poky-qemu script is run as: | ||
| 13 | |||
| 14 | MACHINE=<machine> poky-qemu <zimage> <filesystem> | ||
| 15 | |||
| 16 | where: | ||
| 17 | |||
| 18 | <zimage> is the path to a kernel (e.g. zimage-qemuarm.bin) | ||
| 19 | <filesystem> is the path to an ext2 image (e.g. filesystem-qemuarm.ext2) | ||
| 20 | <machine> is "qemuarm" or "qemux86" | ||
| 21 | |||
| 22 | The MACHINE=<machine> prefix is optional and without it the script will try | ||
| 23 | to detect the machine name from the name of the <zimage> file. | ||
| 24 | |||
| 25 | If <filesystem> isn't specified, nfs booting will be assumed. | ||
| 26 | |||
| 27 | |||
| 28 | QEMU within Poky (runqemu) | ||
| 29 | ========================== | ||
| 30 | |||
| 31 | The runqemu script is run as: | ||
| 32 | |||
| 33 | runqemu <target> <type> <zimage> <filesystem> | ||
| 34 | |||
| 35 | where: | ||
| 36 | |||
| 37 | <target> is "qemuarm" or "qemux86" | ||
| 38 | <type> is "ext2" or "nfs" | ||
| 39 | <zimage> is the path to a kernel (zimage-qemuarm.bin) | ||
| 40 | <filesystem> is the path to an ext2 image (filesystem-qemuarm.ext2) | ||
| 41 | |||
| 42 | It will default to the qemuarm, ext2 and the last kernel and oh-image-sdk | ||
| 43 | image built by poky. | ||
| 44 | |||
| 45 | |||
| 46 | Notes | ||
| 47 | ===== | ||
| 48 | |||
| 49 | - The scripts run qemu using sudo. Change perms on /dev/net/tun to | ||
| 50 | run as non root | ||
| 51 | - You can access the host computer at 192.168.7.1 within the image. | ||
| 52 | - Your qemu system will be accessible as 192.16.7.2. | ||
| 53 | - The default NFS mount points are /srv/nfs/qemux86 or /srv/nfs/qemuarm | ||
| 54 | depending on the target type. | ||
| 55 | - You can set QEMU_MEMORY to control amount of available memory (default 64M). | ||
| 56 | - You can set SERIAL_LOGFILE to have the serial output from the image logged | ||
| 57 | to a file. | ||
| 58 | |||
| 59 | |||
| 60 | NFS Image Notes | ||
| 61 | =============== | ||
| 62 | |||
| 63 | As root; | ||
| 64 | |||
| 65 | % apt-get install nfs-kernel-server | ||
| 66 | |||
| 67 | % mkdir /srv/nfs/qemuarm | ||
| 68 | |||
| 69 | Edit via /etc/exports : | ||
| 70 | |||
| 71 | # /etc/exports: the access control list for filesystems which may be exported | ||
| 72 | # to NFS clients. See exports(5). | ||
| 73 | /srv/nfs/qemuarm 192.168.7.2(rw,no_root_squash) | ||
| 74 | |||
| 75 | % /etc/init.d/nfs-kernel-server restart | ||
| 76 | |||
| 77 | % modprobe tun | ||
| 78 | |||
| 79 | untar build/tmp/deploy/images/<built image>.rootfs.tar.bz2 into /srv/nfs/qemuarm | ||
| 80 | |||
| 81 | Finally, launch: | ||
| 82 | |||
| 83 | % runqemu <target> nfs | ||
| 84 | |||
| 85 | (Substitute qemux86 for qemuarm when using qemux86) | ||
| 86 | |||
| 87 | |||
| 88 | Known Issues | ||
| 89 | ============ | ||
| 90 | |||
| 91 | - There is a bug in the ARM qemu in that means occasionally it will use 100% | ||
| 92 | cpu. You will need to restart it in this situation. | ||
| 93 | - There is a problem with the ARM image not auto assigning an IP when using an | ||
| 94 | ext2 image. To have working TCP/IP connectivity run: | ||
| 95 | 'ifconfig eth0 192.168.7.2 up' | ||
| 96 | |||
diff --git a/scripts/runqemu b/scripts/runqemu index 30fd0697c6..7ed080e20a 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
| @@ -72,7 +72,7 @@ if [ "$MACHINE" = "qemux86" ]; then | |||
| 72 | fi | 72 | fi |
| 73 | if [ "$TYPE" = "ext2" ]; then | 73 | if [ "$TYPE" = "ext2" ]; then |
| 74 | if [ "x$HDIMAGE" = "x" ]; then | 74 | if [ "x$HDIMAGE" = "x" ]; then |
| 75 | HDIMAGE=$BUILDDIR/tmp/deploy/images/oh-image-pda-qemux86.ext2 | 75 | HDIMAGE=$BUILDDIR/tmp/deploy/images/oh-image-sdk-qemux86.ext2 |
| 76 | fi | 76 | fi |
| 77 | fi | 77 | fi |
| 78 | CROSSPATH=$BUILDDIR/tmp/cross/i586-poky-linux/bin | 78 | CROSSPATH=$BUILDDIR/tmp/cross/i586-poky-linux/bin |
| @@ -92,7 +92,7 @@ else | |||
| 92 | echo "Warning: distccd not present, no distcc support loaded" | 92 | echo "Warning: distccd not present, no distcc support loaded" |
| 93 | fi | 93 | fi |
| 94 | 94 | ||
| 95 | INTERNAL_SCRIPT=`which runqemu-internal` | 95 | INTERNAL_SCRIPT=`which poky-qemu-internal` |
| 96 | source $INTERNAL_SCRIPT | 96 | source $INTERNAL_SCRIPT |
| 97 | 97 | ||
| 98 | if [ -x "$DISTCCD" ]; then | 98 | if [ -x "$DISTCCD" ]; then |
diff --git a/scripts/runqemu.README b/scripts/runqemu.README deleted file mode 100644 index 2f68b85cb8..0000000000 --- a/scripts/runqemu.README +++ /dev/null | |||
| @@ -1,61 +0,0 @@ | |||
| 1 | Using qemu with poky notes | ||
| 2 | ========================== | ||
| 3 | |||
| 4 | Poky can generate qemu bootable kernels and images with can be used | ||
| 5 | on a desktop system. Both arm and x86 images can currently be booted. | ||
| 6 | The runqemu script is run as: | ||
| 7 | |||
| 8 | runqemu <target> <type> <zimage> <filesystem> | ||
| 9 | |||
| 10 | where: | ||
| 11 | |||
| 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) | ||
| 16 | |||
| 17 | It will default to the qemuarm, ext2 and the last kernel and oh-image-pda | ||
| 18 | image built by poky. | ||
| 19 | |||
| 20 | NFS Image Notes | ||
| 21 | =============== | ||
| 22 | |||
| 23 | As root; | ||
| 24 | |||
| 25 | % apt-get install nfs-kernel-server | ||
| 26 | |||
| 27 | % mkdir /srv/nfs/qemuarm | ||
| 28 | |||
| 29 | Edit via /etc/exports : | ||
| 30 | |||
| 31 | # /etc/exports: the access control list for filesystems which may be exported | ||
| 32 | # to NFS clients. See exports(5). | ||
| 33 | /srv/nfs/qemuarm 192.168.7.2(rw,no_root_squash) | ||
| 34 | |||
| 35 | % /etc/init.d/nfs-kernel-server restart | ||
| 36 | |||
| 37 | % modprobe tun | ||
| 38 | |||
| 39 | untar build/tmp/deploy/images/<built image>.rootfs.tar.bz2 into /srv/nfs/qemuarm | ||
| 40 | |||
| 41 | Finally, launch: | ||
| 42 | |||
| 43 | % runqemu <target> nfs | ||
| 44 | |||
| 45 | (Substitute qemux86 for qemuarm when using qemux86) | ||
| 46 | |||
| 47 | Notes | ||
| 48 | ===== | ||
| 49 | |||
| 50 | - The runqemu script runs qemu with sudo. Change perms on /dev/net/tun to | ||
| 51 | run as non root | ||
| 52 | - You can set QEMU_MEMORY env var to control amount of available memory | ||
| 53 | ( defaults to 64M ) | ||
| 54 | - There is a bug in qemu in that means occasionally it will use 100% cpu. | ||
| 55 | You will need to restart it in this situation. | ||
| 56 | |||
| 57 | More Info | ||
| 58 | ========= | ||
| 59 | |||
| 60 | - See http://o-hand.com/~richard/qemu.html | ||
| 61 | |||
