Commit Graph

313 Commits

Author SHA1 Message Date
Richard Purdie
73aef33dfa scritps/runqemu: Ensure we only have two serial ports
I have a theory that some of the console boot issues we're seeing are due to
starting images with three serial ports yet only starting gettys on two of them.

This means that occasionally, depending on the port numbering we may not get
a login prompt on the console we expect it on.

To fix this, change the runqemu code so that if serial ports are passed in on
the commandline (as is the case in automated testing), we don't add any other
GUI serial consoles.

We do need to make sure we do have at least two serial ports since we don't want
getty timeout warnings.

(From OE-Core rev: 44e1279970d306b0da4fcc11f9e780915f481819)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1b0348535dce3b776efbcf26406b94730a51eb85)
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2025-02-24 07:00:53 -08:00
Konrad Weihmann
6ee7342411 runqemu: keep generating tap devices
in case there is no tap device the script tries to
generate a new one.
The new device is then unguarded for a moment, so
the newly generated device could be acquired
by a different instance or user, before it is locked to
the instance with acquire_taplock.
To fix that keep generating new tap devices in case
the lock can't be acquired up to 5 times.
If no tap device can be locked it fails in the existing
error handling

(From OE-Core rev: 23876576d054ebbab9b02c0012782aa56feda123)

(From OE-Core rev: 5215635442949a62f502e839ddf1f12e790e5e37)

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-09-27 05:57:35 -07:00
Ross Burton
da694d9d58 runqemu: add qmp socket support
Add support for qmp sockets and defaults to unix:qmp.sock if unspecified

(From OE-Core rev: 31de620e9d899b93c6e982d3a563bbf618ce79c6)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Backported from master: 380631797f0d63124a8c21efa93ab672dbd79283
Qemu throws many warnings without qmp and many runtime tests fail
without this patch also on kirkstone.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-03-01 05:19:53 -10:00
Trevor Gamblin
1e41c667e6 scripts/runqemu: fix regex escape sequences
When invoking runqemu with Python 3.12, the following warning is
encountered:

|SyntaxWarning: invalid escape sequence '\.'

This is because the interpreter scans the string before it is processed
by the regex module, and it interprets the backslash as part of an
escape sequence, but not a standard one. This will be registered as an
error rather than a warning in future Python versions. To avoid the it,
simply add an extra backslash so that Python doesn't misinterpret the
string, while the regex parser still sees an escaped '.' character.

(From OE-Core rev: 2f8982ef4c903f43867da56fcfd080a6556daa8b)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Backported from master: 0e8a4142bb90a92d175df6b2537d24a372356f98

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-03-01 05:19:53 -10:00
Alexander Kanavin
6cb27ba537 runqemu: direct mesa to use its own drivers, rather than ones provided by host distro
With mesa 23.0, it is not longer possible to use the host drivers, as
mesa upstream has added strict checks for matching builds between
drivers and libraries that load them.

Add a check and a hint to runqemu so that there is a helpful error when
there is no native/nativesdk opengl/virgl support.

(From OE-Core rev: 5103ce67741782e43612f495bcc851c6509b734b)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit f0946844df7270fe368858d8929e6b380675b78b)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-02-28 03:32:09 -10:00
Alexander Kanavin
bb2ce4dcf6 scripts/runqemu: allocate unfsd ports in a way that doesn't race or clash with unrelated processes
There is already a neat check_free_port() function for finding an available port
atomically, so use that and make two additional tweaks:

- no need to allocate two separate ports; per unfsd documentation they can be the same

- move lockfile release until after unfsd has been shut down and the port(s) used has been freed

[YOCTO #15077]

(From OE-Core rev: 343510b33650c88367f95e8d8322fae92ae901ca)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit dee96e82fb04ea99ecd6c25513c7bd368df3bd37)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-07-12 05:11:38 -10:00
Alexander Kanavin
e69c311ed6 scripts/runqemu: split lock dir creation into a reusable function
(From OE-Core rev: 2ada5f426e71e3873ba8c47dd925d8cfc103524b)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 004d6bcb067ecf1d796801fa43a98820c4efd3c7)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-07-12 05:11:38 -10:00
Mikko Rapeli
351110f0cf runqemu: kill qemu if it hangs
qemu doesn't always behave well and can hang too.
kill it with force if it was still alive. Move clean up
commands into cleanup() function.

(From OE-Core rev: 929e7679c1d9b21ac5130a9cbc83c415fb9f63f5)

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 079c2935d2f585ce49e1c7daab2155fcf0094c48)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-09 13:19:03 +00:00
Joshua Watt
67b2d0267a runqemu: Fix gl-es argument from causing other arguments to be ignored
The code to parse arguments was inadvertently skipping all arguments in
the elif block after gl-es if it was specified on the command line.

(From OE-Core rev: 45356f2ef90e4b67b890ca745513fafa32a469cf)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 718bb8d56f6a24c86e67830a7d13af54df2ebb4e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
(cherry picked from commit dd1dcfada1fa46ecb8227c2852769b35026875d3)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-09 17:42:08 +00:00
Joshua Watt
b9f2ebe163 runqemu: Do not perturb script environment
Instead of changing the script environment to affect the child
processes, make a copy of the environment with modifications and pass
that to subprocess.

Specifically, when dri rendering is enabled, LD_PRELOAD was being passed
to all processes created by the script which resulted in other commands
(e.g. stty) exiting with a failure like:

 /bin/sh: symbol lookup error: sysroots-uninative/x86_64-linux/lib/librt.so.1: undefined symbol: __libc_unwind_link_get, version GLIBC_PRIVATE

Making a copy of the environment fixes this because the LD_PRELOAD is
now only passed to qemu itself.

(From OE-Core rev: 74911cf7ea703c54920a6c58c344a22a46398b02)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 2232599d330bd5f2a9e206b490196569ad855de8)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-09 17:42:08 +00:00
Alexandre Belloni
a5eeb959bf runqemu: display host uptime when starting
In order to be able to debug issues on the host that have an impact on the
guest, it is useful to get the uptime of the host while starting so we can
match with the events in dmesg. Also include the uptime when cleaning up.

(From OE-Core rev: 08406e03abddc7290c0c2296aa179725a58155d3)

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2d96499823f7de6e16a461426491e015ba63c1ec)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-16 17:53:23 +01:00
Mark Hatle
cb87867c47 runqemu: Add missing space on default display option
(From OE-Core rev: fcb55a198eddf4110fd4baf67614a7598441d952)

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ee9428611fc38bc711b5b3e12cf0d3257b1b5680)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-23 15:22:52 +01:00
Scott Murray
d3f246413b runqemu: Do not auto detect graphics if publicvnc is specified
The graphics option auto detection logic added in 7f78bb7a was not
checking if the publicvnc option had been specified, meaning that
it would be ignored and the auto detection result used instead.
Add setting a flag variable in the argument parsing and check
it along with the ones for the other graphics backend options.

(From OE-Core rev: 4b73b55c2d258768cda2bf7262ebb36bcb7fed5b)

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-15 17:30:34 +01:00
Richard Purdie
0be2abfe7c runqemu: Allow auto detection of the correct graphics options
Running "runqemu qemux86 kvm" when qemu is configured for sdl and/or gtk
display output currently leads to a poor user experience with no cursor
and corrupted fonts in the gtk case. This is due to no options being
passed to qemu which leads to the loss of the font envirornment variable
and the show-cursor option.

If the user hasn't specified a display type, grep the output of
"qemu-system-xxx --help" for the display types and pick the "best"
which ensures our config is passed in. That resolves the gtk font issue
and the cursor issue with both sdl and gtk.

(From OE-Core rev: 7f78bb7a7baf67b9226fb460ca9e12fde6ef40c8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-14 09:47:00 +01:00
Richard Purdie
d38868cfff scripts/runqemu: Fix memory limits for qemux86-64
When setting memory to 4GB, qemu is only running with 2GB for x86_64.
Avoid this by removing the mem= option to the kernel and letting the
qemu configuration handle it for x86 in a similar way to mips.

(From OE-Core rev: 2fd53417eba354c31c058c4bb066bb882e098add)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-15 08:40:09 +00:00
Robert P. J. Day
eec3bbdd27 scripts: Various typo/grammar/punctuation fixes
Among other things, fix misspellings of:

  - absolute
  - deprecated
  - suitable
  - handle

and a bunch of other things.

(From OE-Core rev: c3773cd6c44dfe82be9ecd248120e7d6c753f891)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-02 18:43:24 +00:00
Alexander Kanavin
0f82f85dc9 runqemu: preload uninative libraries when host gl drivers are in use
Some of the host distributions build the drivers in a way (RPATH/RUNPATH)
that tricks uninative loader into loading pieces of the host libc, if
the same pieces haven't been previously loaded by native binaries. Mixing
the two libc versions leads to failures.

This change ensures that the correct (uninative) versions are always in use.

(From OE-Core rev: 39c10816d5ec9d9c7952d786d7a3f942d25d0c27)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-07 10:08:59 +00:00
Alexander Kanavin
276975e4ea qemu: replace a gtk wrapper with directly setting environment from runqemu
The wrapper is executed by host bash, and host bash refuses to run
when pseudo libc is preloaded via LD_PRELOAD (which is the case
when gl is enabled).

Only the fontconfig setting is carried over as local testing showed that
only that is necessary for the gui to look ok nowadays; adjust further
if necessary.

(From OE-Core rev: 34f152de14f803fcfe5c92c515bf585838bba10a)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-07 10:08:59 +00:00
Alexander Kanavin
2a3e849326 qemuboot/runqemu: fully form the ip= kernel parameter
New systemd is actually parsing this in systemd-network-generator
and fails if it is not fully formed. 'off' means 'static ip, do nothing':
https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt

(From OE-Core rev: 2cf12c8dde0f05917797f8b4a80883dc0647b95d)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-11 10:53:44 +00:00
Alexander Kanavin
6616b85af4 runqemu: additional setting to force software rendering with sdl 2.0.18
(From OE-Core rev: 282e28bec1419d4e34076234027f34af3a49e7b5)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-17 09:56:15 +00:00
Ross Burton
67700e174d runqemu: check the qemu PID has been set before kill()ing it
If runqemu is killed, check that we have a valid PID for the qemu before
sending a kill() to it.

[ YOCTO #14651 ]

(From OE-Core rev: 0f3afbd3a6a6bef668612f818517df7543c0a683)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-09 10:33:25 +00:00
Adrian Freihofer
9c3e6fd9b6 runqemu: support rootfs mounted ro
Optionally allow to set QB_KERNEL_ROOT to e.g. "/dev/vda ro" to mount the
rootfs reay-only in Qemu.

(From OE-Core rev: 448eb1fd21287ba16b17e9402ce040b86ae3638c)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-13 16:11:28 +00:00
Jon Mason
859776220f runqemu: work without SERIAL_CONSOLES being defined
Not all machine definitions need to have SERIAL_CONSOLES defined, but
runqemu currently will fail with the following script error if not
present:

Traceback (most recent call last):
  File "/builder/meta-arm/poky/scripts/runqemu", line 1604, in main
    config.setup_final()
  File "/builder/meta-arm/poky/scripts/runqemu", line 1446, in setup_final
    self.setup_serial()
  File "/builder/meta-arm/poky/scripts/runqemu", line 1381, in setup_serial
    self.kernel_cmdline_script += ' console=%s' %entry.split(';')[1]
IndexError: list index out of range

To get around this issue, add a sanity check to runqemu to avoid the
parsing of SERIAL_CONSOLES if empty.

(From OE-Core rev: e8359000e765f876c041b6ccabe63f069f83efec)

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03 10:12:42 +00:00
Alexander Kanavin
05ce40b2ce runqemu: unbreak non-gl displays
Correct two issues:
1. Looking for dri.pc is only needed when gl is enabled.
2. virtio-vga-gl works only when gl is enabled via -display,
otherwise virtio-vga needs to be selected.

(From OE-Core rev: d6d5fe44510d2087b735758ac85e804533a1778c)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30 18:56:47 +01:00
Jon Mason
47d033595a runqemu: add DEPLOY_DIR_IMAGE replacement in QB_OPT_APPEND
Add the ability to replace DEPLOY_DIR_IMAGE with that path in
QB_OPT_APPEND.  This allows for anything present in DEPLOY_DIR_IMAGE to
be passed into the qemu parameters.  This is especially useful if you
want to run multiple flash images (as -bios only allows for one).

(From OE-Core rev: 1f0bec0421617e8aa9645c385195a755f0d44e75)

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14 22:32:50 +01:00
Alexander Kanavin
8dfe2412da runqemu: correct vga-virtio option to keep virgl enabled
qemu 6.1 has (perhaps unintentionally) disabled virgl in -vga virtio:
https://gitlab.com/qemu-project/qemu/-/issues/586

(From OE-Core rev: 2c6c7f0ff24da7060cea35f8ff89f2cabd96f2fb)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11 18:41:37 +01:00
Alexander Kanavin
46a8566183 qemu: add a hint on how to enable CPU render nodes when a suitable GPU is absent
This is particularly useful for llvm-accelerated GL rendering from qemu guest to
an offscreen buffer (accessible over vnc or spice) using llvmpipe on the
host, rather than using unaccelerated swrast renderer in the guest.

This is the best that can be done in the absence of a host GPU with render node
support (such as old Matrox cards common in servers, or fully virtualized cloud
environments with no GPU at all).

Note: even though NVidia blob drivers do support render nodes, they do not
support gbm (yet?), and so rendering will fall back to llvmpipe as well even when
the system has a 3000 euro NVidia GPU. Cue Linus picture.

(From OE-Core rev: 9b1daa173481f7f560e00e0dc22b4010ff1dc0ec)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-23 08:25:53 +01:00
Matthias Klein
f83a4482a9 runqemu: decouple bios and kernel options
This will allow the use of a bios (e.g. U-Boot) in combination with
a WIC file (from which U-Boot loads the kernel).

(From OE-Core rev: 5fc65c9d18679b62b13fead7b91126c665525884)

Signed-off-by: Matthias Klein <matthias@extraklein.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-04 20:45:41 +01:00
Matthias Klein
6d90c0e47a runqemu: Fix typo in error message
(From OE-Core rev: 5cc0051d50974e198313f9513b24fd7ae9a96dd4)

Signed-off-by: Matthias Klein <matthias@extraklein.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-04 20:45:41 +01:00
Richard Purdie
a16d7d2ec6 runqemu: Remove potential lock races around tap device handling
The qemu tap device handling is potentially race ridden. We pass the
fd to the main qemu subprocess which is good as it means the lock is held
as long as the qemu process exists. This means we shouldn't unlock it
ourselves though, only close the file. We also can't delete the file
as we have no idea if qemu is still using it. We could try and obtain
an exclusive new lock, then the file would be safe to unlink but it
doesn't seem worth it.

Also fix the same issue in the port lock code.

(From OE-Core rev: 2a87bddabf816d09ec801e33972879e6983627eb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-08 14:58:28 +01:00
Alexandre Belloni
998d23a2c6 runqemu: time the copy to tmpfs
Measure and display the time it takes to copy the rootfs to its new
location (usually in tmpfs) to try to understand whether it sometimes takes
a lot of time on the autobuilders.

(From OE-Core rev: be213114c1349e02ca48fd617a6c3badae8aa101)

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-06 23:16:50 +01:00
Alexander Kanavin
1584108bdc qemu: use 4 cores in qemu guests
Each of the cores is mapped to a thread on the host, this
should speed up things inside qemu which can take advantage of that.

(From OE-Core rev: 56f98d12a79585a4d4c459160f39403e05b620a5)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-13 18:09:10 +01:00
Richard Purdie
d5eb86b3aa runqemu: Ensure we cleanup snapshot files after image run
We need to cleanup snapshot files if we make a copy of them to ensure
the tmpfs doesn't run out of space. There is already NFS code needing
this so make it a generic code path.

(From OE-Core rev: a3e0eec5a4785a0c4859455eb10b43aa832e606d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-23 00:08:38 +01:00
Richard Purdie
232cb7b055 oeqa/runqemu: Support RUNQEMU_TMPFS_DIR as a location to copy snapshot images to
We have a working theory that IO queues on the autobuilder are impacting
runtime testing under qemu, particularly async writes which inice does not
influence. We already pass the snapshot option to qemu which copies the
image and runs out of the copy. Add in the ability to copy the image to
a specificed location which can be a tmpfs. This means that writes to the
image would no longer be blocked by other writes to disk in the system.

Preliminary tests show that this does improve the qemu errors at the expense
of sometimes showing qemu startup timeouts as on a loaded system with a large
test image, it can take longer than 120s to copy the image to tmpfs. Having
a most consistent failure mode for loaded tests is probably desireable though.

(From OE-Core rev: fd1c26ab426c3699ffd8082b83d65a84c8eb8bff)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-06 09:30:10 +01:00
Alexander Kanavin
379ee98034 runqemu: do not stop processing graphical options after nographic
Some options such as egl-headless are fully compatible with it, so
there is no need to quit.

(From OE-Core rev: 66d11106f9e76d19e397ba3d14c3a22726033567)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-05 15:29:01 +01:00
Jon Mason
fae414bb70 runqemu: modify novga to conform to documentation
Passing 'novga' only adds '-vga none' to the qemu commandline and does
not prevent other vga devices from being added, contrary to the
documentation/help.  Clean-up the vga logic and add the ability to
prevent other vga devices from being added.

(From OE-Core rev: 9f8d049dbbe0b1760979d9f3b745124abfc54c90)

Signed-off-by: Jon Mason <jon.mason@arm.com>
Change-Id: I7ff8f9f3e419ce8bae3f3847d75f9275ca30406a
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-11 14:00:36 +00:00
Jon Mason
16d1669ff9 runqemu: correct forcing of ttyS0
Some platforms do not use ttyS* for their serial consoles (e.g., qemuarm
and qemuarm64).  The hardcoding of this can cause issues.  Modify
runqemu to use the serial consoles defined in SERIAL_CONSOLES instead of
hardcoding.

(From OE-Core rev: 9dea4cd2f9f46ab3a75562639a22d8f56b4d26af)

Signed-off-by: Jon Mason <jon.mason@arm.com>
Change-Id: I746d56de5669c955c5e29d3ded70c0a4d3171f17
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-11 14:00:36 +00:00
Jon Mason
bd0ada8994 runqemu: add QB_GRAPHICS
Add a new runqemu field for VGA devices.  Currently, these are being set
in QB_OPT_APPEND, which can make them difficult to override if importing
the config file into another one.

(From OE-Core rev: 695c98b6522be4373806c154a2999eaeef205556)

Signed-off-by: Jon Mason <jon.mason@arm.com>
Change-Id: I8cb9527954c5b06c083c42fe2466cb3338584b7d
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-11 14:00:36 +00:00
Jon Mason
ca1382756c runqemu: use "raw" instead of "bin" for ovmf
bin is not an acceptable format for qemu and will throw an error is set.
The correct format in this case is raw.

(From OE-Core rev: cd279aeb986b4676ea8ecb1e7b12c7e29e83460a)

Signed-off-by: Jon Mason <jon.mason@arm.com>
Change-Id: I9d78e356d39ecb15bef886c19870b029d9badd65
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-06 22:39:03 +00:00
Khem Raj
acfa0e0dce runqemu: Add new option to disable vga emulation
When using nographic, explicitly disabling vga is needed some cases
since some qemu firmware (OpenFirmware ) defaults to std vga, and
when vga is enabled then it disables output to serial and redirects
that to vga which is by design, hwoever we expect the console output
to go to serial when using nographic, therefore its important to
disable vga with nographic especially on qemu based ppc platforms

(From OE-Core rev: eabbdb3c4f78ab23348a6b988f59d9d98b5e2c7c)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-23 22:35:00 +00:00
Sinan Kaya
24cd090741 runqemu: Add support for VHD/VHDX rootfs
(From OE-Core rev: fafa2fe6d4d40ab6ba7d39b397d2bde9eb0d6b72)

Signed-off-by: Sinan Kaya <okaya@kernel.org>
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-20 00:45:05 +00:00
Khem Raj
b6b985a223 qemuboot: Add QB_RNG variable
RNG passthru has been enabled on all qemu machines but its being added
to each one of them, with this patch its turned into QB variables which
defaults to host passthru, yet it can be overridden if needed via
machine or config metadata if needed.

(From OE-Core rev: 26dd24506ef36088e17f999ce5489dc4b72194e8)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-24 22:32:49 +01:00
Richard Purdie
f19f252e2b runqemu: Add a hook to allow it to renice
We have an issue where qemu is being starved of resources on our autobuilders.
We can't raise its priority without special capacilties, therefore add a hook
which if present can allow this to happen using an executable
"~/runqemu-renice".

(From OE-Core rev: 141a3c9ce93bc3d526303021ecf0460c6e9fea8a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-06 09:58:50 +01:00
Richard Purdie
ee98c6ab03 runqemu: Show an error for conflicting graphics options
The autobuilder managed to pass the nographic option with "sdl gl" due
to a problem elsewhere. It would have been useful for runqemu to have
errored rather than passing conflicting options to qemu. Add an
error for this invalid usecase.

(From OE-Core rev: 377a6ffbcba0d3c5ede470c989756c4d1636873f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-26 14:33:57 +01:00
Vasyl Vavrychuk
21c13f75b5 runqemu: Check gtk or sdl option is passed together with gl or gl-es options.
runqemu help reports that gtk or sdl option is needed with gl or gl-es
option. But if user forgot to add gtk or sdl option, then gl or gl-es
options were silently skipped.

(From OE-Core rev: 4d1e93d4bf013bb0c48032bfda43f77c5aba9ecf)

Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-19 10:57:44 +01:00
Chen Qi
98549fd68c runqemu: fix permission check of /dev/vhost-net
The code should check /dev/vhost-net instead of /dev/kvm. And
the permission check logically belongs to the part when kvm-vhost
is enabled. Also fix the URL to point to the correct wiki page.

(From OE-Core rev: 53bdf2d20077921bdf83641c365d60d85174f5b5)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-11 20:35:39 +01:00
Jason Wessel
157e44bdba runqemu: If using a vmtype image do not add the -no-reboot flag
There is no way to use runqemu and turn off the no-reboot flag with a
command line argument.  If someone really wants it back it can be
added with the qemuparams="" argument.

Also if you use the "halt -p" from user space, the qemu will exit when
it is complete.  It is impossible to test self deploying image with
runqemu if you cannot reboot the device.  One might argue that you can
run runqemu in a loop, but that defeats the purpose of having a
wrapper around a tool that already does what is needed in the first
place.

For the vmtype images, the -no-reboot flag should not be added.

(From OE-Core rev: 6d07a72356f9a8ea76b6cda9159d3ca4743028d9)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-28 08:36:00 +01:00
Sakib Sajal
a3102471e4 qemu: uprev v4.2.0 -> v5.0.0
Major update after v4.2.

Changes:
  - os_find_datadir() was changed after the v4.2 release
    causing v5.0 to not find the bios and not boot the
    image. Fix is sent to upstream qemu.
    See: qemu/find_datadir.patch
  - v5.0 binary had host contamination for dynamically linked
    libraries, "--extra-ldflags='${LDFLAGS}'" in EXTRA_OECONF
    resolved the issue
  - bluetooth code was removed: qemu.git$ git show 1d4ffe8dc7
    hence removed PACKAGECONFIG[bluez]
  - -show-cursor qemu option is now deprecated, updated
    scripts/runqemu to use updated option instead
  - added PACKAGECONFIG definitions
  - added qemu-ptest to conf/distro/include/ptest-packagelists.inc
  - increased support for ARM architecture, cpu and board
  - removed patches merged upstream and refreshed
    existing ones

Testing:
Build core-image-minimal against the machines in
openembedded-core/meta/conf/machine and succesfully
booted with qemu v5.0

Ran qemu-ptest on x86-64 and arm64 with identical results:
PASS: 1166
SKIP:    0
FAIL:    0

(From OE-Core rev: ee9ec9e344541c1ccd9b9b8e3b8c1e00d008ad85)

Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-23 12:31:03 +01:00
Alexander Kanavin
cfa1424b3c runqemu: force software x11 renderer for SDL when GL is not in use
If libsdl is configured with opengl enabled, it will try to use GL
renderers to open a window even if qemu doesn't use virgl. Setting
the environment variable forces a software X11 renderer, which is the
same one used when libsdl has opengl switched off. This avoids
needlessly loading the GL libraries and drivers from the host.

(From OE-Core rev: 73b75f5ff6c0b5333898fa340f4d9e2e5111fdef)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-12 15:20:42 +01:00
Alexander Kanavin
1ec9103116 runqemu: set host DRI driver path for all instances of virgl usage
Falling through to host GL stack via epoxy chrpath hack was
found to be problematic in case of SDL particularly (because it does
not actually use epoxy, and does its own dlopen()).

So let's just use the mesa-native libraries everywhere, but instruct
them to load DRI drivers from the host.

NVidia's proprietary blob users have to take care of themselves, I'm afraid.

(From OE-Core rev: 2125920828eba7bab1afc977d5e9bccb124078e5)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-07 12:16:00 +01:00