Commit Graph

197 Commits

Author SHA1 Message Date
Richard Purdie 0d214406c4 scripts/runqemu: Add snapshot support
Allow access to the snapshot option of qemu to simplify some of our runtime
testing to avoid copying images.

(From OE-Core rev: 8fec4a5a004f0e99734f8c0820c66522d08f213e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 12:07:32 +01:00
Richard Purdie b2dc9c7ee2 runqemu: Enable virtio RNG for all platforms
We have problems where systems simply stop booting and hang. This is due
to a lack of entropy which means ssh keys and networking can't be brought
up. Adding in the virtio-rng passthrough support allows host entropy to
pass into the guess and avoids these hangs.

This is particularly problematic after the gnutls upgrade which starts
using /dev/random instead of /dev/urandom but was an issue we'd occasionally
seem before that.

It particualrly affected x86 and ppc machines for some reason.

(From OE-Core rev: 51b001909f1856c45cf87091d6e4446c266d5786)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 12:07:32 +01:00
Richard Purdie eb1494f9da runqemu: Update to modern prefrerred net syntax
(From OE-Core rev: 5e61766d976b6d036946c1b4e4ac742a33a03815)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 12:07:32 +01:00
Richard Purdie d1cb381977 runqemu: Allow unique network interface MAC addresses
Current qemu instances all share the same MAC address. This shouldn't be an
issue as they are all on separate network interfaces, however on the slight
chance this is causing problems, its easy enough to ensure we use unique
MAC addresses based on the IP numbers we assign.

(From OE-Core rev: c01962bf88786dd84ad83cc1d315297607d29f7c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 12:07:32 +01:00
Joshua Lock d1303c220e runqemu: fix run from testimage with non-standard DEPLOY_DIR_IMAGE
testimage.bbclass uses runqemu to execute runtime tests on a qemu
target, this means that bitbake is already running and `bitbake -e`
can't be called to obtain bitbake variables.

runqemu tries to work around being unable to read values for
bitbake variables by inferring the MACHINE from the
DEPLOY_DIR_IMAGE setting, however if a user sets that variable in
a manner which doesn't follow the systems expectations (i.e. if
running `bitbake -c testimage` against a directory of pre-generated
images in a user-specified path) the inferring of the MACHINE name
from the DEPLOY_DIR_IMAGE location will fail.

It's possible that check_arg_machine() shouldn't cause runqemu to
fail and that runqemu should proceed with the user-supplied value
even if it can't be verified. This patch simply ensures that a
workflow where the user sets DEPLOY_DIR_IMAGE continues to work
without changing too much of the runqemu code.

[YOCTO #10238]

(From OE-Core rev: f94ac02f459e2ea0fc471463966997814a67e0ca)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 12:07:32 +01:00
Joshua Lock 8a8948e0e1 runqemu: fixes for when invoked during a bitbake run
When runqemu is invoked from a running bitbake instance it will be
unable to call `bitbake -e` due to the lock held by the calling
bitbake instance.

Our test code sets an OE_TMPDIR environment variable from which we
can infer/guess paths. Add code to do so when self.bitbake_e can't
be set, much as the sh version of runqemu did.

[YOCTO #10240]

(From OE-Core rev: 1e8165ea2f19aecdc03ccd102ee44ef0544f0f39)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 12:07:32 +01:00
Joshua Lock d5d4869634 runqemu: better handle running on a host with different paths
If the STAGING_*_NATIVE directories from the config file don't exist
and we're in a sourced OE build directory try to extract the paths
from `bitbake -e`

(From OE-Core rev: 9326af1c20636320c70caecebd47aedafb3f2d25)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 12:07:32 +01:00
Joshua Lock e162303ecb runqemu: assume artefacts are relative to *.qemuboot.conf
When runqemu is started with a *.qemuboot.conf arg assume that image
artefacts are relative to that file, rather than in whatever
directory the DEPLOY_DIR_IMAGE variable in the conf file points to.

(From OE-Core rev: a6448371b87f754def669adfdc01b07d18003405)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 12:07:32 +01:00
Robert Yang b405712414 runqemu: refactor it and remove machine knowledge
Previously, runqemu had hard coded machine knowledge, which limited its
usage, for example, qemu can boot genericx86, but runqemu can't, we need
edit runqemu/runqemu-internal a lot if we want to boot genericx86.

Now bsp conf files can set vars to make it can be boot by runqemu, and
qemuboot.bbclass will save these info to DEPLOY_DIR_IMAGE/qemuboot.conf.
Please see qemuboot.bbclass' comments on how to set the vars.

* Re-write it in python3, which can reduce lines from 1239 to about 750
  lines
* All the machine knowledges are gone
* All of the TUN_ARCH knowledge are gone
* All the previous options are preserved, and there is a new way to run
  runqemu: (it doesn't need run "bitake -e" in such a case)
  $ runqemu tmp/deploy/images/qemux86
  or:
  $ runqemu tmp/deploy/images/qemuarm/<image>.ext4
  or:
  $ runqemu tmp/deploy/images/qemuarm/qemuboot.conf
* Fixed audio support, not limited on x86 or x86_64
* Fix SLIRP mode, add help message, avoid mixing with tap
* Fix NFS boot, it will extract <image>.tar.bz2 or tar.gz to
  DEPLOY_DIR_IMAGE/<image>-nfsroot when no NFS_DIR, and remove it after
  stop.
* More bsps can be boot, such as genericx86 and genericx86-64.
* The patch for qemuzynq, qemuzynqmp, qemumicroblaze has been sent to
  meta-xilinx' mailing list.
* I can't find any qemush4 bsp or how to build it, so it is not
  considered atm.

[YOCTO #1018]
[YOCTO #4827]
[YOCTO #7459]
[YOCTO #7887]

(From OE-Core rev: 60ca8a8d899b90a4693fd62b6ec97d0c76a9f6c5)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 12:07:32 +01:00
Alistair Francis ce8e654e2c runqemu: qemuzynqmp: Add Linux boot support
Add support to direct boot Linux instead of just booting u-boot.

(From OE-Core rev: e5c6a78db46192800669f1b392351f6b52f3e20c)

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
Alistair Francis ff3bc6c61f runqemu: Add suport for qemuzynqmp
(From OE-Core rev: d2a7c1db9bff6ae3844e3d017e94f29d1501bf57)

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-12 23:47:15 +01:00
Robert Yang 1db3dc8803 runqemu: let ramfs equal to cpio.gz
For example, support both:
$ runqemu qemux86-64 ramfs
$ runqemu qemux86-64 cpio.gz (new)

(From OE-Core rev: 6529264776701d4f5a1e4a8336ac2e01a6ddea85)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-14 10:58:34 +01:00
Robert Yang c093f7c623 runqemu: fix for iso
It should be the similar type as hddimg, rather than ext234 or btrfs.

(From OE-Core rev: d5ddc5ec1628c94bd5edc45bc821da1ce616e80f)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-29 23:20:12 +01:00
Robert Yang fae732f24e runqemu-internal: cleanup unsed code
* remove akita and spitz related code
  They are not supported by runqemu anymore:
  $ runqemu spitz
  Error: unable to classify arg [spitz]
  So remove related code.

* Remove checking of 256M for qemuarm, qemu can check it, for example:
  $ runqemu qemuarm qemuparams="-m 1024"
  [snip]
  qemu: Too much memory for this machine: 1024 MB, maximum 256 MB
  [snip]

(From OE-Core rev: 36fb785bf8cd2f387c91d52f597602a5dbc3948b)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:14 +00:00
Robert Yang e469bb722e runqemu: simplify checking for iso and ramfs
(From OE-Core rev: 69a1fca4374797dea56035ce56a17441a2ca9280)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:14 +00:00
Robert Yang 3610329929 runqemu: add support for qcow2 and vdi
[YOCTO #9168]

(From OE-Core rev: 0f8306c77b4ebed1ff127b0786b7109abf0d57cd)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:14 +00:00
Robert Yang d85ca4a616 runqemu: remove ISO and RAMFS from help text
They don't work, and the script can check the type correctly.

(From OE-Core rev: b5cc1e70dbd5df160ddedcaa40d0ab714a307561)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:14 +00:00
Robert Yang 58bc8542de runqemu: simplify the checking for vm images
* So that we can add more image support easliy.
* I think that wic should be vm images.

(From OE-Core rev: 82d0014a0e1526ffa1ff7c8ea3903aeae31bada4)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:14 +00:00
Robert Yang 6716eb245d runqemu: fix ROOTFS for vmdk
* Make it can boot scsi and virtio block drive such as root=/dev/sdX and
  /dev/vdX.

* Drop VM from help info, id doesn't work, and the script can check
  whether it is a vm disk or not.

* Make it can be run by:
  $ runqemu tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.vmdk
  or:
  $ runqemu qemux86-64 vmdk

[YOCTO #9170]

(From OE-Core rev: 88c081b10902ec52928be78ad320c474bb918e01)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:14 +00:00
Ed Bartosh c26a9c3afd runqemu: support path/to/<image>-<machine>.wic
Supported providing wic image path to runqemu:
  runquemu path/to/<image>-<machine>.wic

[YOCTO #8691]

(From OE-Core rev: 58a3bfb1e4b493200820cdf0bf3fc79e31e792de)

(From OE-Core rev: e6150971ea4eea49b802a12aea5ab733e894c92d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15 16:28:44 +00:00
Ed Bartosh c7f0578b78 runqemu: don't set KERNEL for wic images
Wic images should be boot as is, without pointing qemu to the kernel
binary. Current code doesn't use kernel, but sets KERNEL variable and
shows kernel path in the console output. This can confuse users.

Changed runqemu and runqemu-internal code to avoid setting KERNEL
variable and show kernel path.

(From OE-Core rev: 474caa7ed5ff05caa5d49d270b283882fa616ed1)

(From OE-Core rev: 35e776e00cce25f2c9c45500612fb66022ec4739)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15 16:28:44 +00:00
Ed Bartosh 2c3a009b20 runqemu: add support for wic images
Quemu should be able to run wic images this way:
    runqemu <machine> <image recipe> wic

Tested with 'runqemu qemux86-64 wic-image-minimal wic'

(From OE-Core rev: 8716be799949cb8bde7fa49cbea61312a3a93bb7)

(From OE-Core rev: dd42931bf99b8bbd4ad452b3941d957f41b81796)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15 16:28:43 +00:00
Ruslan Bilovol 7100c4201c scripts: runqemu: remove QEMUARCH from help message
The QEMUARCH env variable is not used since commit
"d469c92 classes/imagetest-qemu: remove old image
testing class". Remove it from help message so
it will not confuse other people

(From OE-Core rev: f2f2fa61e2c331409f20c999f93d78ef752b4fd2)

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:40 +00:00
Ross Burton 11a9c24d6c runqemu: don't specify IP when starting a VNC server
Whilst qemu doesn't appear to support opening sockets on IPv6 yet, future-proof
the script by just specifying a port and letting qemu work out the rest.

(From OE-Core rev: abf8975bce4bf5d05dbb186d5089f0c3fe07eefb)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:36 +00:00
Aníbal Limón eebcbe19b7 runqemu: Enable support for kvm without vhost in x86 and x86_64
KVM can be used without vhost so add a new option to runqemu for
use kvm with vhost.

Example,
	runqemu qemux86 core-image-minimal kvm # kvm without vhost
	runqemu qemux86 core-image-minimal kvm-vhost # kvm with vhost

[YOCTO #7443]

(From OE-Core rev: 7f5f8f87a4180a2b05188047c6a05da5571f94e2)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:28 +00:00
Pascal Bach aa1253f23d runqemu: don't complain about conflicting machines if they are equal
When the MACHINE variable was set as an environment variable, via
"export MACHINE=qemuarm" and runqemu was executed as "runqemu qemuarm"

The confusing error message appears:
Error: conflicting MACHINE types [qemuarm] and [qemuarm]

This checks if the two values are equal, in that case there is no problem
and execution can continue.

(From OE-Core rev: 6615a21d578ba9ab053ba0b3deab26ebf88e577b)

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:30 +01:00
Patrick Ohly 2a05181d98 runqemu: avoid image file name mismatches
Giving anything with -image in it as bootparams or in qemuparams (for
example, an additional -drive parameter with an image file or an
"-initrd .../core-image-minimal-initramfs-qemux86.cpio.gz") caused
runqemu to treat these parameters as names of the rootfs image file.

Matching *-image) after checking the current argument for more
specific cases like bootparams and qemuparams avoids this
misinterpretation of the command line parameters.

(From OE-Core rev: 29e0aaa7345ca823bb4af2d4a870e98ac75e04e7)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:44 +01:00
Leonardo Sandoval e0543d1094 runqemu: Define OECORE_MACHINE_SYSROOT on setup_sysroot
At least the OVFM (UEFI Firmware for Qemu and KVM) recipe stores the BIOS
under $OE_TMPDIR/sysroots/$MACHINE, now defined as OECORE_MACHINE_SYSROOT.
The latter is used when searching BIOS, VGA BIOS and keymaps. As a example,
to boot a OVFM BIOS, one can run the following command:

$ runqemu qemux86-64 core-image-minimal \
    biosdir=usr/share/ovmf  \
    biosfilename=bios.bin \
    nographic

Note the bios* parameters: these two are needed to specify the subfolder
(parent folder is OECORE_MACHINE_SYSROOT) and BIOS filename (without it,
it picks a BIOS named bios-256k.bin).

[YOCTO #5654]

(From OE-Core rev: bded344a464bb854db3935da1f6a3320e5aa01e5)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:34 +01:00
Patrick Ohly 8215c42af1 runqemu: support full-disk images
This makes it possible to boot images with multiple partitions (the
ones ending in .hddimg or .hdddirect) in several ways:
   runqemu qemux86 core-image-minimal hddimg
   runqemu tmp/deploy/images/qemux86/core-image-minimal-qemux86.hddimg
   VM=tmp-glibc/deploy/images/qemux86/iot-os-image-qemux86.hddimg FSTYPE=hddimg runqemu

Same for hdddirect.

This is useful for testing initramfs scripts, secure boot (when
switching to UEFI), or boot loaders like syslinux. For testing the
content of the rootfs, the ext4 image is better because that approach
is faster (no need to create another large image during build, rootfs
can be read directly instead of reading boot.img through loop device).

When booting a live image, the kernel, initramfs (if any) and kernel
parameters are taken from the image by the virtual machine's BIOS, so any
additional kernel parameters given to runqemu are ignored. This can be
avoided (already without this change) in a slightly hacky runqemu setup:
   ROOTFS=tmp/deploy/images/qemux86/core-image-minimal-qemux86.hddimg \
   FSTYPE=ext4 \
   KERNEL=tmp/deploy/images/qemux86/bzImage-initramfs-qemux86.bin \
   MACHINE=qemux86 \
   runqemu serial kvm nographic 'bootparams=root=/dev/ram0'

The additional bzImage-initramfs-qemux86.bin kernel here was created
by adding this to local.conf:
   INITRAMFS_IMAGE = "core-image-minimal-initramfs"
   INITRAMFS_IMAGE_BUNDLE = "1"

In the code, the new FSTYPE=hddimg resp. hdddirect behaves almost
exactly like the older vmdk FSTYPE. New types were chosen because it
seemed cleaner than using FSTYPE=vmdk when the actual image pointed to
by VM is not in that format. The downside is that several checks for
FSTYPE=vmdk had to be duplicated for FSTYPE=hddimg.

The VM variable now gets interpreted as "virtual machine disk image"
instead of "vmdk image".

(From OE-Core rev: 37741c539f5d3021e59828b49e968cd42b89a368)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-06 15:26:23 +01:00
Randy Witt d893a2503d runqemu: Add a tcpserial option
The option was added so that the qemurunner could start a second tcp
serial port without adding machine conditional logic to qemurunner.

The issue that made this necessary was that when "virt" is passed to
qemu-system-aarch64, the normal mechanism for specifying a tcp serial
port does not work. This is because the hardware for the "virt" machine
is hardcoded in the device tree blob and the addition devices must be
virtio devices.

So runqemu can specify virtio for qemuarm64 whereas it seems all other
qemu machines work with the "-serial tcp*" option.

(From OE-Core rev: 849d65d55e4df5fa443b2cb7b4cee23913fc9d5a)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:47:07 +01:00
Jagadeesh Krishnanjanappa 8b1bc367be runqemu: fix MACHINE being detected as qemuarm for qemuarm64 kernel image
Basically, runqemu script autodetects MACHINE type based on the
kernel image name; if MACHINE name is not specified. Since 'qemuarm'
string is common in both qemuarm amnd qemuarm64 kernel image names, the
MACHINE type is considered as 'qemuarm' even when qemuarm64 kernel
image name is given in command line.

(From OE-Core rev: 388b243668a5c28fb69b760ce9be5adbc85352d8)

Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:47:14 +01:00
Richard Purdie b8107c5991 scripts/runqemu: Allow FSTYPE to be changed from the environment
Currently its not possible to change FSTYPE from the environment but it would
be useful to do so where multiple image types have been generated. This
adds that possibility.

(From OE-Core rev: c210430c24af6717aa955efe1afe9fc4d2d3f2a9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20 11:03:49 +00:00
Bernhard Reutner-Fischer efc7f04f92 scripts/runqemu: clarify help text
(From OE-Core rev: 0542472969d0eb28fd44da97e4e01d69d864d157)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-09 15:58:00 +00:00
Richard Purdie 7dcf6c9d45 machine/qemu: Switch from ext3 to ext4
There is no good reason not to use ext4 at this point, it has advantages
and few drawbacks. Therefore switch the qemu machines over (and the default
runqemu script options).

(From OE-Core rev: 430b9ae71b1aa76f8421127d17e0e0723d4818d3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21 22:05:37 +00:00
Ricardo Neri edde3e58da runqemu: Add option for BIOS binary filename
If we intend to use a custom BIOS binary file, it would be good to be
able to specify the name of the binary via the -bios option of qemu. The
name of the custom binary could be different from the default name used
by qemu. For instance, it was bios.bin in qemu 1.5.0 and changed to
bios-256k.bin for 2.1.0.

(From OE-Core rev: 29c9e6f44541b7f8731e21e9d1a0adca9da28e37)

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:57 +00:00
Kai Kang f78f9d7adb runqemu: add qemuarm64 support.
Update scripts runqemu and runqemu-internal to support to boot
qemuarm64.

(From OE-Core rev: 2f020b53bdb8c262e432bc4df35101fa990c460c)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-23 10:18:18 +00:00
Matthieu Crapet 37dcf148ba scripts/runqemu: avoid pipe with sed
Replace:
cat <file> | sed -e xxx
By:
sed -e xxx <file>

(From OE-Core rev: 173769374b1b37244d64767144398337001f1c6f)

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-08 13:00:33 +01:00
Ricardo Neri 68acafd7dc runqemu: Add option for custom BIOS directory
Add support to specify a directory for custom BIOS, VGA BIOS and
keymaps as supported by qemu (-L option). Even though this can be
done through qemuparams, having this option provides better user
experience by not having to specify a long and cluttered path along
with other qemuparams that the user might want to specify.

This new options assumes first that the path provided is relative to
OECORE_NATIVE_SYSROOT and will check whether it exists before proceeding.
If not, it will treat the provided path as absolute. This provides
the user flexibility to use BIOS binaries generated inside or outside
the OE build environment.

(From OE-Core rev: d302f5683dd736ac4cd4b601a046d22000d41e68)

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21 12:05:54 +00:00
Saul Wold e47afff7d8 runqemu: Use readlink instead of realpath
(From OE-Core rev: 5a4b5c6b8ebd5f8d29888aafcd9608e03717bcd5)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-25 21:29:53 +00:00
Saul Wold 425dc69bc7 runqemu: Ensure ROOTFS path is absolute
There is a problem if a relative path is passed to the kernel for NFS usage
that it will not correctly find it, so ensure that the ROOTFS path is absolute.

[YOCTO #2807]

(From OE-Core rev: 5722be0ddda4ec3c96c06b425e5c7e0194326253)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-21 16:09:08 +00:00
Cristian Iorga a2a20adbfd runqemu: enforce right CPU type for qemux86/x86-64
Set in accordance with qemu machines configs.

Fixes [YOCTO #5817].

(From OE-Core rev: 0e5cfef90ff762b33da6dc301dfc9cb3947c8a02)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-13 17:53:30 +00:00
Jason Wessel 2fedfdca12 runqemu, runqemu-internal: Allow slirp for NFS and KVM use
The default slirp address for the NFS server is 10.0.2.2.  If not
using a tap interface this address must be used or the target system
cannot connect properly.  Also the ip=... kernel arguments need to be
set to dhcp when using slirp or the root NFS will not get setup
properly.

The call to cleanup() results in a routine which is not defined when
setting up the NFS because it is called before acquire() for the
locking of the tap interfaces, the solution being to simply not call
cleanup() that early.

When using slirp, kvm should not execute the vhost net checks because
the vhost net will not be configure or used.

(From OE-Core rev: 1ea04d87525f26c2cd32ba29c0f14c6226f60729)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-28 00:52:36 +00:00
Valentin Popa dd50c4d8a0 runqemu: Allow user to set -vga option with qemuparams
At the moment, the user cannot to set -vga other then vmware
(because "vmware" is set by default); and the first argument
in qemuparams has higher precedence.

(From OE-Core rev: 54a43397c48c974570e3eade55163eb766994a55)

Signed-off-by: Valentin Popa <valentin.popa@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-20 12:26:30 +00:00
Scott Garman fc0bb31aa7 runqemu: remove core-image-* whitelist
Using a whitelist for image names to default to when none are
specified on the command line is no longer desired. Instead,
choose the most recently created image filename that conforms
to typical image naming conventions.

Fixes [YOCTO #5617].

(From OE-Core rev: 9f69e00200cdbd5ba2e46a54f33c29797816e43f)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-09 18:01:46 +00:00
Richard Purdie b8819b02dc runqemu: Use correct kvm CPU options for qemux86* with kvm
The existing -cpu host option caused kernel panics when people attempted to use
the kvm option. After research and discussion, the best options appear to
be the kvm32/kvm64 cpu types so lets use these instead. These resolve
the kernel issues for me.

[YOCTO #3908]

(From OE-Core rev: bdc6d3be6ffa4ed358153f9c9332b632324f5833)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-26 16:37:56 +01:00
Paul Eggleton f79b21a57b scripts/runqemu: write temp file into correct location
We want the temporary file to be written in /tmp not the current
directory.

(From OE-Core rev: fcb40c11998030eb5fce89ce5a9ca567870aafa9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-24 17:57:03 +01:00
Paul Eggleton 6670be71f7 bitbake.conf: include machine name in DEPLOY_DIR_IMAGE
This allows a clean seperation between image outputs from different
machines, and makes it possible to have convenience symlinks to make
the output ready to deploy.

This did require some surgery in runqemu; if explicit paths to the image
and kernel are not supplied then DEPLOY_DIR_IMAGE needs to be determined
from bitbake or set in the environment. However the script does try to
avoid requiring it unless it really is needed. Corresponding changes
were made in the automated testing code as well.

Based on an RFC patch by Koen Kooi <koen@dominion.thruhere.net>

(From OE-Core rev: 7e90261aec61f79680b5eaeaf5b18c7b795412a4)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-14 08:21:00 +01:00
Mihai Prica 12d003a800 scripts/runqemu: Fix MACHINE regex
When runqemu tries to determine the MACHINE variable from a
kernel or vmdk filename that doesn't contain any known machine
name, the variable gets set to the filename. It should remain
unset and cause an error.

[YOCTO #2890]

(From OE-Core rev: 22c0668d9e0a22c095d78bab7b45ef4f803dd0d1)

Signed-off-by: Mihai Prica <mihai.prica@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-04 14:17:29 +01:00
Nathan Rossi f6538c3b64 scripts/runqemu: Add support for 'qemumicroblaze' machine
* Add support to boot the 'qemumicroblaze' machine in
  qemu-system-microblazeel
* Use the specific machine model for a MicroBlaze system 'petalogix-ml605'
* Use the DTB generated from the kernel build as the DTB for boot
* Force use of initrd rootfs (either in ext or cpio formats)

(From OE-Core rev: 2c164a5dfc877d180ef58d46c063573621297929)

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-10 09:41:51 +01:00
Nathan Rossi 41563388ed scripts/runqemu: Add support for 'qemuzynq' machine
* Add support to boot the 'qemuzynq' machine in qemu-system-arm
* Use the specific machine model for Zynq 'xilinx-zynq-a9'
* Use the DTB generated from the kernel build as the DTB for boot
* Force use of initrd rootfs (either in ext or cpio formats)

(From OE-Core rev: 1e4b1d95e1f47654e928f38cd091ffe272689844)

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-10 09:41:51 +01:00
Radu Moisan 88a6eb8027 lib/oeqa/utils/qemurunner.py: class to handle qemu instance
Handles qemu instances (launch, kill, restart, serial connection, logging)
Launch is blocking until login prompt and returns to the task. A qemu
serial connection is used to save the boot log and get the ip from the image.
Changed runqemu script not to error out when using custom serial option.

(From OE-Core rev: ee7d64dfcc02ba8f568b17d181e0a58d3c810076)

Signed-off-by: Radu Moisan <radu.moisan@intel.com>
Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-09 10:53:45 +01:00
Andrei Dinu 52c9f6650f SLiRP support in runqemu
runqemu script now takes argument "slirp" in order to
run networking on the qemu machine, without root privileges.

changed the runqemu-internal script in order not to activate
the tap devices if the option is set.

[YOCTO #1474]

(From OE-Core rev: fa7fd7b1cbcfbd01af1949d2ea09b880a0ae0175)

Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 14:14:40 +01:00
Stefan Stanacar bc02e97db7 scripts/runqemu: add ext4 to the list of extracted extensions
(From OE-Core rev: 702deed71de41ef2e93bc5435e136bf219537d3a)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12 08:33:16 +01:00
Richard Purdie ebf4d7a90d runqemu: Improve error handling/exit codes
runqemu-internal is sourced so should be returning with an error code in
case of errors. runqemu needs to deal with this.

This patch fixes up the various error paths so we're consistent and get
a sane exit status for runqemu which helps a lot in its use in the qemu
runtime testing on the autobuilder.

(From OE-Core rev: 753533b2f338ff2ef97eebd5eace7623404ae457)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-20 11:53:06 +00:00
Ross Burton 06e245303c runqemu: add option to make the VNC server publically available
If the qemu is running on a headless machine, a VNC server that only allows
connections from localhost isn't too useful.

Add a "vncpublic" option to bind a VNC server to 0.0.0.0, so it's publically
available.

(From OE-Core rev: 883666821ec46483bbfb9b3cb84c5afa8118a553)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11 14:46:09 +00:00
Chen Qi 0c1b6098d4 runqemu scripts: add support for booting an ISO image
Add support for booting an ISO image for runqemu scripts.

[YOCTO #3710]

(From OE-Core rev: edd629029979dc18905fce23b64216f15eea501f)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-16 11:57:33 +00:00
Trevor Woerner ae84362fcc runqemu: change terminal's INTR key in 'serial' mode
If you are using an image in '-serial stdio' mode, temporarily change the
terminal's interrupt character to 'Ctrl-]' for the duration of the image
run. In this way, hitting 'Ctrl-C' for something running in the image
doesn't accidentally abort the entire qemu session.

(From OE-Core rev: 642cfaac0cb515008cfc91aafe04ab1db7a51581)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-26 11:34:07 +00:00
Björn Stenberg 3c77b8c19a Fix typo in kvm capability detection in runqemu
(From OE-Core rev: 7db394c4021f57b6bfc5cbad3fb2bd4903527758)

Signed-off-by: Björn Stenberg <bjst@enea.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-26 11:34:03 +00:00
Trevor Woerner b05efc27d0 runqemu: add support for FSTYPE=vmdk
Allow vmdk images to be run through the 'runqemu' facility.

(From OE-Core rev: 9efa0aa914cae9e13d90ddf99b482ccf0936573c)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-17 17:24:50 +00:00
Cristian Iorga ef5dcad3e3 qemu: Fixed running QEMU with virtio error reporting
If vhost_net module is not properly installed,
runqemu script will report the error and
provide the user with a link to the guide.
Also corrected small cosmetic issues in
runqemu script messages.
Also removed <> (read/write) check.

Fixes [YOCTO #3184]

(From OE-Core rev: f7365f62325189b0f9a9a1d440f11f2356c8f01d)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-03 13:37:03 +01:00
Cristian Iorga ab2b2a1f2a qemux86: Support for KVM, paravirt and virtio added
KVM, paravirtualization and virtio drivers are now activated
in runqemu using the kvm option flag for qemux86.
Host CPU features are also exported to guest OS (Yocto Linux).
Usage example: runqemu qemux86 core-image-x11 kvm

Implements [YOCTO #2550].

(From OE-Core rev: a35d03e2eb905de4eadc9c7df5b50bff1fb7f897)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-21 11:10:19 +01:00
Scott Garman 32fdbd879c runqemu: show bitbake errors to user
In certain edge cases, bitbake may fail to run and cause setup_tmpdir()
within runqemu to fail, and not give the user a helpful error message.
Catch this case and show the user the output of bitbake -e.

This fixes [YOCTO #3112]

(From OE-Core rev: 465d7b6e66b5a55706535e194b3e44e11ee542c6)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-21 11:10:19 +01:00
Khem Raj d7ef15a063 runqemu: Explicitly specify MACHINE when calling bitbake
When using runqemu with distros outside oe-core then
MACHINE may not be there in local.conf so use the one
thats available in environment of runqemu which is actually
the correct one.

(From OE-Core rev: 5c3fec058a2d370fbb625901ca1822ce04927ac2)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-14 09:50:24 +01:00
Saul Wold c9669451aa runqemu: Move the KVM check after the MACHINE/KERNEL Checks
The MACHINE/KERNEL Checks setup MACHINE is it's unset, the KVM checks valid
MACHINE is qemux86 or qemux86-64 and fail if it's unset!

[YOCTO #2970]

(From OE-Core rev: 8d5e6999caff50a4b7d9a9ba69f9875285270459)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-25 14:46:57 +01:00
Khem Raj fcdf262fab runqemu: Honor KERNEL and ROOTFS settings from environment
Expand the usage to be able to specify KERNEL and ROOTFS
on commandline. This helps in using the script for booting
images that are essentially not part of OE-Core

(From OE-Core rev: c985b02130658dd64581ecf14b16e2c70d1d8db5)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-23 11:43:32 +01:00
Scott Garman 641f582f53 runqemu: work with yocto-bsp created kernel filenames
The yocto-bsp tool generates kernels with additional strings within
the filename, e.g. zImage-myqemuarm.bin. Loosen the MACHINE detection
regex to work with these filenames.

Fixes [YOCTO #2890].

(From OE-Core rev: 17d616adffc3514b6778acc6ab5d6da34a7366b5)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-19 10:45:59 +01:00
Scott Garman 5bffd94316 runqemu: support booting ramfs-based images
Added support for booting ramfs-based images (e.g, poky-tiny) which
do not have block device support.

This fixes [YOCTO #2612].

(From OE-Core rev: b09c45f017da71ff966004752f8e926ea00ac451)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-17 18:04:20 +01:00
Khem Raj 9e5bce826a runqemu: Fix running qemu when build without gl
When gl is disabled in PACKAGECONFIG then we dont need
to check for supporting libs to be present before running
qemu.

(From OE-Core rev: 6612873dc59054e6d37fa7488226218bfb759127)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 10:53:56 +01:00
Dennis Lan 521cf20942 runqemu/mips: adjust runqemu script to support mipsel machine
(From OE-Core rev: a12e2409af246d4c1d0e0c9a2457fb9c850bd8ca)

Signed-off-by: Dennis Lan <dennis.yxun@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 10:53:54 +01:00
Scott Garman 91a3a07884 runqemu: fix support for ext4 rootfs images
(From OE-Core rev: c9479ae46d0b891eda8f0db89bc66fdf08c3f7c2)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 16:58:57 +01:00
Scott Garman 24f02d58a7 runqemu: fix usage() help for MACHINE setting
(From OE-Core rev: 36482a0064993b047829631d063beadbc03f2cbf)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 16:58:57 +01:00
Cristian Ciupitu 9a4b266674 runqemu: fix fedora pkg names when run fails
runqemu can fail to with the following message:

    You need libGL.so and libGLU.so to exist in your library path to run the QEMU emulator.
        Fedora package names are: mesa-libGL mesa-libGLU.

The libGL.so and libGLU.so files are provided by the mesa-libGL-devel
and mesa-libGLU-devel Fedora packages (yum provides '*/libGL*.so').

(From OE-Core rev: f2b6f9c3a8b4f87b5570b78766a118e4290d773a)

Signed-off-by: Cristian Ciupitu <cristian.ciupitu@yahoo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-02 16:47:43 +01:00
Khem Raj f13ef77b5d runqemu: Add qemush4 and qemumips64 knowledge
New machines need to be added and they also
have different kernel commandlines

(From OE-Core rev: 3a5432aec0faea49d2c04984cd169ceb35bba89f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-21 09:59:03 +01:00
Peter Seebach 441623224b runqemu: replace bashism with working shell idiom
The =~ operator is not one of my favorites, not just due to portability
issues, but because it's not well known, and a lot of people might
not expect a regex operator.

The canonical shell idiom for this is to use case with alternation
and wildcards.  As a side note, if you are matching anything containing
core-image-sato, you don't need to also check for core-image-sato-sdk.

(From OE-Core rev: 716ae8dbd1fb29292c9fca0f59d3807a54508e87)

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-15 18:51:13 +01:00
Bernhard Reutner-Fischer c048ff9f9d runqemu: be sh neutral
Now runs with dash and busybox' ash as well as with bash

(From OE-Core rev: 2b93ed90736ed08c25561e24343a5ef2b8f7dbef)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-06 09:55:48 +01:00
Bernhard Reutner-Fischer 56f243e4ce runqemu: minor tweaks
(From OE-Core rev: cda565317eefbac1b7fb268d3d8720ebae8057fa)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-06 09:55:47 +01:00
Bernhard Reutner-Fischer 215a1ea026 runqemu: add and use error()
(From OE-Core rev: d77186606efdbb03fd92e7ee9e9ee2f9be601ba5)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-06 09:55:47 +01:00
Bernhard Reutner-Fischer 987bc36d13 runqemu: simplify process_filename()
(From OE-Core rev: 042efbe653b699bd33175117e1363d87e4602e4f)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-06 09:55:47 +01:00
Bernhard Reutner-Fischer e99f652ede runqemu: use modern, single-char name of test(1)
I do not have "[[", just "[". Be gentle to users of legacy-free setups,
also by using '=' instead of the double notation.

(From OE-Core rev: e96ba42a977f4c07aa196ce379ecd73e4ddc23c5)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-06 09:55:47 +01:00
Bernhard Reutner-Fischer 97482d61cf runqemu: Use OE_TMPDIR
The error message erroneously talked about TMPDIR.
Just use OE_TMPDIR everywhere to make the name of the variable obvious.

(From OE-Core rev: 7b633d0a4cf9aa05e6243974bab2b780c246f8ba)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-06 09:55:46 +01:00
Scott Garman 3af7e95d69 runqemu: set console=ttyS0 when running with nographic option
When passing the nograhic option to the runqemu script, set
console=ttyS0 in the kernel options so the user can view
the kernel boot messages.

This fixes [YOCTO #1475]

(From OE-Core rev: 28f05bf6e5da9cd8f01cff50c317233e3064e3cb)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-29 22:57:29 +01:00
Robert Yang aff0f018d2 qemu: add fedora pkg names when build failed
When qemu build failed, we can see such messages:

You need libGL.so and libGLU.so to exist in your library path and the
development headers for SDL installed to build qemu-native.

Ubuntu package names are: libgl1-mesa-dev, libglu1-mesa-dev and
libsdl1.2-dev

These pkgs have different names on Fedora distributions, and Fedora is
one the
main linux distributions, so add Fedora package names.

The following Fedora versions have these pkgs:
	Fedora 9 64bit
	Fedora 13 32bit
	Fedora 13 64bit
	Fedora 16 64bit

[YOCTO #2174]

(From OE-Core rev: 246438582f8a23ce1847bae230bce07fbb3c6d15)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-26 12:13:04 +01:00
Liming Wang 523f6b69c6 qemuppc: replace emulation of qemuppc from prep to mac99
With this new emulation, existing qemuppc functionality is maintained
and other functionality such as framebuffer + sato and NFS boot are
added.

(From OE-Core rev: 52ea026df141ea23bbab38ad3a9733c15097eaa4)

Signed-off-by: Liming Wang <liming.wang@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-17 14:53:17 +00:00
Paul Eggleton 44d8f38a5e scripts/runqemu: show an error if /dev/net/tun is unusable
If /dev/net/tun is either not present or is not writable by the
user, then show an appropriate error message. (QEMU needs access to this
device in order to enable networking; it may be missing if it is not
enabled or loaded into the kernel, and some distributions such as CentOS
5.x set restrictive permissions upon it.)

(From OE-Core rev: a00b94900d437828f25debce1c30ffcc0bbf29e9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-15 14:36:21 +00:00
Saul Wold 3d7d510701 runqemu: look for *-image* to be more flexible for image names
We can't just look for *image* since it will catch up bzimage

(From OE-Core rev: c2f88c658b73da67d93312591b3e67b42f629fe3)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-29 11:22:07 +00:00
Paul Eggleton 7d1e1018f4 scripts: use OE_TMPDIR instead of TMPDIR external variable
On OpenSUSE within an X session, TMPDIR is set to the system temporary
directory (/tmp) which is incorrect for these scripts. Thus, change
runqemu and oe-setup-rpmrepo to use OE_TMPDIR from the external
environment rather than TMPDIR.

Fixes [YOCTO #1530]

(From OE-Core rev: 4e24c10952c7a52af7f2447595fd484692d35534)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-28 21:41:43 +01:00
Scott Garman 9c740e0425 runqemu: improve auto-detection of rootfs filenames
This refactors the way rootfs filenames are auto-detected when you
run the runqemu script without an explicit rootfs filename argument.
It allows the script to use rootfs files generated by hob, and when
there are mutliple rootfs files to choose from, it will pick the
most recently created one.

Fixes [YOCTO #1437].

(From OE-Core rev: 094453f443ed592d814dfb4182a0a02f0a2552e4)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-09 18:42:05 +01:00
Richard Purdie 32bb9c3184 imagetest-qemu/runqueue: Since we no longer support BUILDDIR, use TMPDIR
Commit 993672fa2739794a6dd0dbd7bb232fa60522b897 removed the BUILDDIR
support from runqueue which broke the imagetest-qemu integration. We now
therefore need to set TMPDIR and pass this through the environment to
ensure the runqueue script finds the right locations without running
bitbake directly.

This patch also adds a sleep to the qemu command in the error case so that
this remains on the screen for a period of time so the user can see errors
more easily.

This change unbreaks automated testing failures on the autobuilder.

(From OE-Core rev: de470333dbdeea444199340e4cd458c13fed6a5a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-09 18:39:26 +01:00
Scott Garman fa45552688 runqemu: standardize ability to specify custom qemu/kenel boot options
The old manner of specifying custom options to QEMU in this script
using angle brackets was a frequent source of confusion. Meanwhile,
Otavio Salvador added a decent method of specifying custom kernel
boot options to this script. This patch documents the bootparams
option and adds a similar way of specifying custom QEMU options
using qemuparams="".

This fixes [YOCTO #1019]

(From OE-Core rev: 1038df14a96d789b3f9e9e1692305ba1fea67886)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-05 20:25:45 +01:00
Liming Wang 8a8a3b3905 scripts/runqemu: disable unfs boot mode for qemuppc
Because unfs boot mode is unstable for qemuppc, disable
it temporarily.

(From OE-Core rev: 74ff1bc8c248824116ba4b787b10fa6ee0c13ce1)

Signed-off-by: Liming Wang <liming.wang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-29 13:48:03 +01:00
Otavio Salvador 6f5066a3a0 scripts/runqemu: add support to pass bootparams to kernel
(From OE-Core rev: 4a2d3cfeeef4de6da1301c65033fa251538cddc9)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-23 18:23:34 -07:00
Anders Darander 1927021c78 scripts/runqemu: modify search paths for libgl
On e.g. Debian libql is found under /usr/lib/x86_64-linux-gnu/libGL.so.
Use a wildcard to match different locations, as uname -i only return unknown on Debian.

(From OE-Core rev: 66e34066a0ac71f4212824b1e6353a4d323f4e21)

Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-19 09:29:19 -07:00
Khem Raj 0350be9458 scripts/runqemu: Make it run on ubuntu 11.10
location of libGL has moved in ubuntu 11.10
so we look for it in the new locations

(From OE-Core rev: 8d80918995a15663db7cc9c0683d45ee8ba7d45c)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-11 19:22:06 +01:00
Khem Raj 68bd81506f scripts/runqemu: grep for line beginning with TMPDIR
Currently the grep regexp matches any occurance of
'TMPDIR=' but if you have another variable defined
e.g. OE_BUILD_TMPDIR=xxx then that gets picked up
too.

$ bitbake -e | grep TMPDIR=\"
TMPDIR="/home/kraj/work/angstrom/build/tmp-angstrom_2010_x-eglibc"
OE_BUILD_TMPDIR="/home/kraj/work/angstrom/build/tmp-angstrom_2010_x"

So we become a bit more stringent and look for
line starting with TMPDIR

$ bitbake -e | grep ^TMPDIR=\"
TMPDIR="/home/kraj/work/angstrom/build/tmp-angstrom_2010_x-eglibc"

make sure that it greps
only TMPDIR=xxx occurance and not values of other variables
whose names happens to end with TMPDIR

(From OE-Core rev: 12ddf6c6a7559d97d9b8f84fcc89ed02e30df85d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-02 14:32:10 +01:00
Scott Garman 3fddac4ee9 runqemu: report error if TMPDIR cannot be determined
Invoking runqemu outside of the build directory for an
in-tree setup results in an empty TMPDIR because bitbake -e
cannot be run to find it.

A symptom of this problem is running runqemu and getting the
following error:

Error: Unable to find tunctl binary in <directory>

Catch this case and report the error to the user.

This fixes [YOCTO #1278]

(From OE-Core rev: ab5544ac801a976b56468ade0f5d2e95c11feb87)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-25 12:54:34 +01:00
Nitin A Kamble d591e696b2 scripts/runqemu: enable btrfs
(From OE-Core rev: 45689bbd46b0bb8e66b7c0ff7cc3321e5eef5b5f)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-30 20:56:36 +01:00
Anders Darander 81d14f5629 runqemu: take TMPDIR from bitbake
The old standard of using /home/anders/openembedded-core/build/tmp as TMPDIR do not work any longer,
as - is appended to the real TMPDIR. Thus, always take TMPDIR from
bitbake, unless TMPDIR is set in the environment.

(From OE-Core rev: 993672fa2739794a6dd0dbd7bb232fa60522b897)

Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-14 15:28:25 +01:00
Richard Purdie 65f4b65410 Further cleanup of various poky references
(From OE-Core rev: fe73ea8c510877fe4e3c117985e8f3d0b79ddf1b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 12:56:16 +01:00
Richard Purdie e7126c1e53 Replace POKY_KVM_WIKI -> YOCTO_KVM_WIKI
(From OE-Core rev: 416e76102fdef606a0459351b85d4f7b30729114)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 00:29:30 +01:00
Richard Purdie 7469527855 POKY_NATIVE_SYSROOT -> OECORE_NATIVE_SYSROOT
(From OE-Core rev: c056aeaa13549b404088e3d465f3b03443e5ab88)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21 00:29:30 +01:00