summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
AgeCommit message (Collapse)Author
2020-09-24qemuboot: Add QB_RNG variableKhem Raj
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. Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-06runqemu: Add a hook to allow it to reniceRichard Purdie
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". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-26runqemu: Show an error for conflicting graphics optionsRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-19runqemu: Check gtk or sdl option is passed together with gl or gl-es options.Vasyl Vavrychuk
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. Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-11runqemu: fix permission check of /dev/vhost-netChen Qi
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. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-28runqemu: If using a vmtype image do not add the -no-reboot flagJason Wessel
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. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-23qemu: uprev v4.2.0 -> v5.0.0Sakib Sajal
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 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-05-12runqemu: force software x11 renderer for SDL when GL is not in useAlexander Kanavin
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. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-07runqemu: set host DRI driver path for all instances of virgl usageAlexander Kanavin
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. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-24runqemu: add QB_ROOTFS_EXTRA_OPT parameterKonrad Weihmann
Content of the optional parameter will be appended to the rootfs-device in the qemu configuration, in case QB_ROOTFS_OPT is not specified. By default this is empty. Example use cases are: Defining 'readonly' when using squashfs, so multiple instances of qemu can share the same base image, something that cannot be done by just specifying 'snapshot'. Defining 'bootindex=0' which helps to get past the EFI shell in ovmf-binary. This also enables the use case of running WIC images with EFI bootloader through the testimage.bbclass. Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-29runqemu: Change nfs to mount via TCPHe Zhe
Since kernel commit b24ee6c64ca7 ("NFS: allow deprecation of NFS UDP protocol"), NFS UDP has been disabled by default due to the potential data corruption caused by fragmentation during high loads. So now we cannot boot up with nfs mode and default kernel. We'd better turn to use TCP accordingly. Signed-off-by: He Zhe <zhe.he@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-19runqemu: support multiple NICsAdrian Freihofer
Emulating more than one network interface with runqemu is a bit tricky, but possible. For example, the following leads to an emulated device with eth0 and eth1: QB_NETWORK_DEVICE_prepend = " \ -device virtio-net-device,mac=52:54:00:12:34:03 \ " or QB_NETWORK_DEVICE_append = " \ -device virtio-net-pci,mac=52:54:00:12:34:03 \ " When booting Qemu with two NICs, the kernel does not know which interface the specified ip=192.168.7.... command line argument should be applied. This delays the boot process for a very long time and a guest wihtout IP configuration. This add two new configuraton parameters to runqemu: QB_CMDLINE_IP_SLIRP and QB_CMDLINE_IP_TAP to explicitely specify the ip= kernel command line arguments for tap and slirp mode. Note: Simply adding "::eth0" broke some builds on the Yocto autobuilder. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-10runqemu: Add network bridge supportJoshua Watt
Qemu supports attaching the virtual machine to an existing network bridge interface via the qemu-bridge-helper program (as long as the system is correctly configured to give the user permissions). Add support for runqemu to do this also via the "bridge=<INTERFACE>" argument. Note that for this to work correctly, the host qemu-bridge-helper must be used, not the one that might have been built by qemu-native. In order for qemu to correctly find this program, a qemu-oe-bridge-helper program has been added to qemu-helper-native, and runqemu will use this helper as the bridge helper. The helper will look for the host qemu-bridge-helper first by looking in the QEMU_BRIDGE_HELPER environment variable, then by search common paths where the helper is installed. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-06runqemu: add virtio block deviceMaxim Uvarov
Implement new QB_DRIVE_TYPE="/dev/vdb" which falls back to virtio block device emulated by qemu. That is needed to support following qemu command line: -drive id=disk0,file=%s,if=none,format=%s \ -device virtio-blk-device,drive=disk0' Real use case is arm64 emulation with qemu with atf+optee+uboot, so that uboot driver sees this disk and able to load from it. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-31runqemu: Add multiconfig supportJoshua Watt
Users may want to run qemu against a specific multiconfig instead of the base configuration, so give them the ability to specify which config should be used with the MULTICONFIG environment variable. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-15runqemu: handle tap device creation failure properlyPaul Eggleton
If we fail to run the command to generate the tap devices then we should show a reasonable message and then exit, without showing a traceback. "return 1" at this point in the code does nothing because the caller doesn't check the return, so just use sys.exit(). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-15runqemu: log parameters correctly within testimagePaul Eggleton
It is not a good idea to mix logging and calls to print() - if the output is being captured the result can be that the two types of output are not recorded contiguously; this could be observed if an error occurred running runqemu from inside testimage: ---------- snip ---------- ERROR: core-image-minimal-1.0-r0 do_testimage: Output from runqemu: runqemu - INFO - Continuing with the following parameters: runqemu - INFO - Setting up tap interface under sudo sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper runqemu - ERROR - Setting up tap device failed: Command '('sudo', '/home/paul/poky/poky/scripts/runqemu-ifup', '1000', '1000', '/home/paul/poky/poky/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin')' returned non-zero exit status 1. Run runqemu-gen-tapdevs to manually create one. runqemu - INFO - Cleaning up KERNEL: [/home/paul/poky/poky/build/tmp/deploy/images/qemux86-64/bzImage--5.2.20+git0+bd0762cd13_dd25a04fc5-r0-qemux86-64-20191205213021.bin] MACHINE: [qemux86-64] FSTYPE: [ext4] ROOTFS: [/home/paul/poky/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.ext4] CONFFILE: [/home/paul/poky/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.qemuboot.conf] ---------- snip ---------- What we should see here is the KERNEL, MACHINE, etc. lines appearing immediately after the "Continuing with the following parameters:" line as they do when you run runqemu directly. If we put all of the lines through the logger instead then it works properly. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-21runqemu: add options that enable virgl with the SDL frontendAlexander Kanavin
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-15runqemu: Remove disabling of high resolution timerJoerg Vehlow
The option 'highres=off' sneaked itself into the runqemu script for all configurations, where the root filesystem type is not 'cpio' or 'cpio.gz'. See: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13590 Signed-off-by: Joerg Vehlow <joerg.vehlow@aox-tech.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-11runqemu: unset another environment variable for 'egl-headless'Alexander Kanavin
Some host distributions (opensuse for example) are using 'pkgconf', which, unlike the original pkg-config, appends PKG_CONFIG_SYSROOT_DIR to every directory from the .pc file. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-18runqemu: Mention snapshot in the help outputRichard Purdie
This is a useful option but not documented in the help text. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-16runqemu: decouple gtk and gl optionsAlexander Kanavin
This will allow not having to multiply these options for the sdl frontend, instead combining them as needed. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2019-09-06runqemu: Fix typo in help text.Drew Moseley
Signed-off-by: Drew Moseley <drew.moseley@northern.tech> Signed-off-by: Ross Burton <ross.burton@intel.com>
2019-08-30qemu: switch to '-vga std' emulated hardware from vmware/cirrus for x86/mipsAlexander Kanavin
This is the qemu default since qemu 2.2, is generally supported better, and is recommended by upstream. It also has already been in use for arm/risc and ovmf. Additional information: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13466 https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/ '-vga virtio' emulated hardware remains in use when virgl is enabled via a runqemu override. Also, adjust the error whitelist, as there is a number of new messages coming from the drivers that are not actual errors. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-29qemu: set default RAM to 256M for all machinesAlexander Kanavin
There was a discussion about what amount of RAM is appropriate for a default; the outcome was that for now it is still 256M. Some qemu machine definitions have however set this to 512M so for the sake of treating all architectures fairly, they are reset back to 256M. Also runqemu is adjusted to use 256M if QB_MEM is not set at all. http://lists.openembedded.org/pipermail/openembedded-core/2019-August/285900.html Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-21scripts/runqemu: Add support for the BIOS variableAlistair Francis
Add support for specifying a BIOS the same way that the KERNEL variable is specified. This includes specifying a QB_DEFAULT_BIOS variable. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-08runqemu: Add support to handle EnrollDefaultKeys PK/KEK1 certificateRicardo Neri
The EnrollDefaultKeys.efi application (distributed in ovmf-shell-image) expects the hypervisor to provide a Platform Key and first Key Exchange Key certificate. For QEMU, this is done by adding an OEM string in the Type 11 SMBIOS table. The string contains the EnrollDefaultKeys application GUID followed by the certificate string. For now, the string is passed in the command line until QEMU understands OEM strings from regular files (please see https://bugs.launchpad.net/qemu/+bug/1826200). If runqemu detects it is given an OVMF binary with support for Secure Boot (i.e., ovmf.secboot* binaries), extract the certificate string from the OvmfPkKek1.pem certificate and modify the command-line parameters to provide the key. Such certificate is created when building OVMF with support for Secure Boot. Cc: Ross Burton <ross.burton@intel.com> Cc: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
2019-08-03runqemu: fix get portlock fail for multi usersChangqing Li
when runqemu with slirp option on same host with different users, it will report PermissionError: [Errno 13] Permission denied: '/tmp/qemu-port-locks/2222.lock' and during handle this exception, another exception happened since key not exist. Fix by check if key exist first Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-26runqemu: add lockfile for port used when slirp enabledChangqing Li
There is race condition when multi qemu starting with slirp, add lockfile for each port to avoid problem like: runqemu - ERROR - Failed to run qemu: qemu-system-x86_64: Could not set up host forwarding rule 'tcp::2323-:23' [YOCTO #13364] Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-26image_types: Remove remnants of hdddirectDaniel Ammann
hdddirect was removed in commit 929ba563f1bc7195c4981b8e139c432b2cc388ea. Signed-off-by: Daniel Ammann <daniel.ammann@bytesatwork.ch> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-10runqemu: QB_FSINFO to support fstype wic imagesAdrian Freihofer
wic images are handled as vmtype images. Starting qemu with "-kernel" parameter and an image of type wic is not supported. Especially for "-machine virt" the combination of wic with -kernel parameter would be beneficial. The new parameter QB_FSINFO allows to pass image type specific flags to runqemu. QB_FSINFO is a space separated list of parameters. Parameters are structured according to the following pattern: image-type:flag. For now two parameters are supported: - wic:no-kernel-in-fs The wic image is treated as rootfs only image. A -kernel option is passed to qemu. - wic:kernel-in-fs The wic image is treated as VM image including a bootloader and a kernel. This is still the default behavior. Example: QB_DEFAULT_FSTYPE = "wic" QB_FSINFO = "wic:no-kernel-in-fs" QB_KERNEL_ROOT = "/dev/vda1" QB_SYSTEM_NAME = "qemu-system-aarch64" QB_MACHINE = "-machine virt" ... [YOCTO #13336] Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-07runqemu: Add the support to pass multi ports to tcpserial parameterKevin Hao
In some cases(such as the oeqa's qemurunner), we need to setup multi serial devices via the '-serial 127.0.0.1:xx" and the order of them is significant. The mixing use of "tcpserial" and "-serial 127.0.0.1:xx" cause ambiguous issues and we can't fix it by only adjusting the order of them. So add the support to pass multi ports to the tcpserial parameter, this will make sure that the order of setting up the serial is really what we want. [YOCTO Bug 13309] Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-31runqemu: Add support for kvm on aarch64Richard Purdie
The main issue is to make the x86 checks apply to x86 targets only. We may end up with better checks on other architectures but this adapts the code to allow for that and its still controlled by whether QB_CPU_KVM is set. The code needed minor refactoring so the qemu-system-XXX name is set earlier so the kvm code can use it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09meta/lib+scripts: Convert to SPDX license headersRichard Purdie
This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-12runqemu: do not check return code of tputChen Qi
The subprocess.run was replaced by subprocess.check_call because of compatibility support down to python 3.4. But we really don't care about whether that command succeeds. Some user reports that in some tmux environment, this command fails and gives some unpleasant traceback output. So we use 'call' instead of 'check_call' to avoid such problem. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-04runqemu: make gl options gtk+-specificAlexander Kanavin
If in the future GL is enabled for SDL frontend, or some other frontend, it would be useful to be able to differentiate. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-04runqemu: add an option to choose the SDL frontend instead of Gtk+ defaultAlexander Kanavin
When Gtk+ and SDL are both enabled, qemu defaults to Gtk+. This option allows to revert to the 'classic' frontend. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25runqemu: do not check for GL librariesAlexander Kanavin
qemu has been using libepoxy for a long time, and libepoxy loads GL via dlopen() only when instructed to. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25runqemu: add options for enabling virgl GL accelerationAlexander Kanavin
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-15runqemu: Make QB_MEM easier to setRobert Yang
It only could be set as the following in the past: QB_MEM = "-m 256" Now it also can be set as: QB_MEM = "-m 256M (or m)" QB_MEM = "256M (or m)" [YOCTO #11522] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-15runqemu: Let qemuparams override default settingsRobert Yang
Fixed: In meta/conf/machine/include/qemuboot-x86.inc: QB_CPU_x86-64 = "-cpu core2duo" $ runqemu qemux86-64 qemuparams="-cpu coreduo" Check /proc/cpuinfo, it should use coreduo rather than core2duo since user specifies it, but it doesn't, append qemuparams to the last can fix the problem. [YOCTO #11773] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-15runqemu: clean up subprocess usageRoss Burton
Where possible pass lists instead of strings, don't use a subshell, and call check*() instead of using Popen directly. Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-12-01scripts/runqemu: Improve lockfile handling for python with close_fd=TrueRichard Purdie
On python versions with close_fds=True (python 3.2 onwards), the tap device lockfile isn't passed to the child process. Since this guards against use of an active interface, we really want this here, so pass it in pass_fds. This means if the parent exits early, the child still holds the lock, avoiding messages like: runqemu - ERROR - Failed to run qemu: qemu-system-x86_64: could not configure /dev/net/tun (tap0): Device or resource busy Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-01scripts/runqemu: Tidy up lock handling codeRichard Purdie
Various tweaks: - Balance up the aquire/release functions - Use debug messge for both acquiring and release message for consistency in logs - Use None instead of an empty string - Reset the value of the field if we don't have the lock any more Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-01scripts/runqemu: Fix logic error causing failures with MACHINE from the ↵Richard Purdie
environment MACHINE=qemux86-64 oe-selftest -r runqemu.RunqemuTests.test_boot_machine_slirp_qcow2 fails yet oe-selftest -r runqemu.RunqemuTests.test_boot_machine_slirp_qcow2 with MACHINE in local.conf would work. It turns out that: runqemu slirp wic.qcow2 qemux86-64 works but: MACHINE=qemux86-64 runqemu slirp wic.qcow2 qemux86-64 does not. The reason are the misplaced return statements in runqemu, its skipping a block of logic when MACHINE is set in the environment when it shouldn't. Fix this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-13scripts/runqemu: Replace subprocess.run() for compatibiltyMichael Halstead
subprocess.run() was introduced in Python 3.5. We currently support down to Python 3.4 so I've replaced it with subprocess.check_call() which is available in that version. Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-13scripts/runqemu: Add serialstdio modeRichard Purdie
Its currently not possible to have a console available whilst using qemu in graphics mode. This is causing some issues for testing autobuilder bringup so all a "serialstdio" mode to runqemu to accomodate this. The existing serialstdio internal variable is renamed to allow the new user visible option. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-25runqemu: fix handling of SIGTERM and the problem of line wrappingChen Qi
The current handling of SIGTERM is incorrect as the process pid returned by Popen call with shell setting to True is actualy the shell instead of the qemu process. So use shlex to split cmd so that we can avoid using shell=True. This ensures the child process is the actual qemu process. Also, as we install a SIGTERM handler, we need handle the situation of qemu terminated by SIGTERM, otherwise we will get ERROR message in such case. Besides, we have a problem that after running qemu, the terminal's behavior is incorrect regarding long lines or long commands. Long commands or long outputs should appear in multiple lines, but they appear in the same line, overriding previous output. Use `tput smam' to fix this problem. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15runqemu: exit gracefully with an error message if qemu system is not evaluatedJagadeesh Krishnanjanappa
It solves below error: -- snip -- return 'qemu-system-%s' % qbsys UnboundLocalError: local variable 'qbsys' referenced before assignment -- snip -- [YOCTO #12846] Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-26logging: use warning instead warnChen Qi
The warn method is deprecated. We should use the documented warning instead. Quoting from the python's official doc: """ Note: There is an obsolete method warn which is functionally identical to warning. As warn is deprecated, please do not use it - use warning instead. """ Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>