diff options
author | Enrico Jorns <ejo@pengutronix.de> | 2024-06-04 10:16:29 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-06-06 11:56:04 +0100 |
commit | 03cad9cc19e4477f0373a5b5d64879e8d85f1cb6 (patch) | |
tree | 6aba30c99b77ce77b1c87a832bd328f96931105c /meta/lib | |
parent | e773e53b72352bfdc1bd72d449fbdbe72d4ce32b (diff) | |
download | poky-03cad9cc19e4477f0373a5b5d64879e8d85f1cb6.tar.gz |
oeqa/utils/commands: extend docstring for runqemu context manager
Usage and arguments are not necessarily self-explaining, thus add a bit
of documentation here.
(From OE-Core rev: 62343333d50b75ad04a4220bcf0990e0a89996a0)
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/utils/commands.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index 575e380017..bf2f49d0c0 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py | |||
@@ -314,7 +314,23 @@ def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec= | |||
314 | @contextlib.contextmanager | 314 | @contextlib.contextmanager |
315 | def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, qemuparams=None, overrides={}, discard_writes=True): | 315 | def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, qemuparams=None, overrides={}, discard_writes=True): |
316 | """ | 316 | """ |
317 | launch_cmd means directly run the command, don't need set rootfs or env vars. | 317 | Starts a context manager for a 'oeqa.targetcontrol.QemuTarget' resource. |
318 | The underlying Qemu will be booted into a shell when the generator yields | ||
319 | and stopped when the 'with' block exits. | ||
320 | |||
321 | Usage: | ||
322 | |||
323 | with runqemu('core-image-minimal') as qemu: | ||
324 | qemu.run_serial('cat /proc/cpuinfo') | ||
325 | |||
326 | Args: | ||
327 | pn (str): (image) recipe to run on | ||
328 | ssh (boolean): whether or not to enable SSH (network access) | ||
329 | runqemuparams (str): space-separated list of params to pass to 'runqemu' script (like 'nographics', 'ovmf', etc.) | ||
330 | image_fstype (str): IMAGE_FSTYPE to use | ||
331 | launch_cmd (str): directly run this command and bypass automatic runqemu parameter generation | ||
332 | overrides (dict): dict of "'<bitbake-variable>': value" pairs that allows overriding bitbake variables | ||
333 | discard_writes (boolean): enables qemu -snapshot feature to prevent modifying original image | ||
318 | """ | 334 | """ |
319 | 335 | ||
320 | import bb.tinfoil | 336 | import bb.tinfoil |