aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Weihmann <kweihmann@outlook.com>2020-04-14 21:19:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-24 14:07:54 +0100
commit3af8aaff68ed332d812ea7dc184d392700ad7882 (patch)
tree4df298c30d87e507be3d725a4138c8e649d48aa3
parent76e142a370c66dd7929c9df4401aae8346f2dd68 (diff)
downloadopenembedded-core-contrib-3af8aaff68ed332d812ea7dc184d392700ad7882.tar.gz
openembedded-core-contrib-3af8aaff68ed332d812ea7dc184d392700ad7882.tar.bz2
openembedded-core-contrib-3af8aaff68ed332d812ea7dc184d392700ad7882.zip
testimage: enable ovmf support
Add support for running wic images with EFI as testimage. Introduces a variable called QEMU_USE_OVMF for configuration. Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/testimage.bbclass6
-rw-r--r--meta/lib/oeqa/core/target/qemu.py6
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py5
3 files changed, 13 insertions, 4 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 01d8598604..c1669f133d 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -275,11 +275,14 @@ def testimage_main(d):
# Get use_kvm
kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH'))
+ # Get OVMF
+ ovmf = d.getVar("QEMU_USE_OVMF")
+
slirp = False
if d.getVar("QEMU_USE_SLIRP"):
slirp = True
- # TODO: We use the current implementatin of qemu runner because of
+ # TODO: We use the current implementation of qemu runner because of
# time constrains, qemu runner really needs a refactor too.
target_kwargs = { 'machine' : machine,
'rootfs' : rootfs,
@@ -293,6 +296,7 @@ def testimage_main(d):
'slirp' : slirp,
'dump_dir' : d.getVar("TESTIMAGE_DUMP_DIR"),
'serial_ports': len(d.getVar("SERIAL_CONSOLES").split()),
+ 'ovmf' : ovmf,
}
if d.getVar("TESTIMAGE_BOOT_PATTERNS"):
diff --git a/meta/lib/oeqa/core/target/qemu.py b/meta/lib/oeqa/core/target/qemu.py
index 059106e915..295e8765e9 100644
--- a/meta/lib/oeqa/core/target/qemu.py
+++ b/meta/lib/oeqa/core/target/qemu.py
@@ -20,7 +20,7 @@ class OEQemuTarget(OESSHTarget):
port=None, machine='', rootfs='', kernel='', kvm=False, slirp=False,
dump_dir='', dump_host_cmds='', display='', bootlog='',
tmpdir='', dir_image='', boottime=60, serial_ports=2,
- boot_patterns = defaultdict(str), **kwargs):
+ boot_patterns = defaultdict(str), ovmf=False, **kwargs):
super(OEQemuTarget, self).__init__(logger, None, server_ip, timeout,
user, port)
@@ -31,6 +31,7 @@ class OEQemuTarget(OESSHTarget):
self.rootfs = rootfs
self.kernel = kernel
self.kvm = kvm
+ self.ovmf = ovmf
self.use_slirp = slirp
self.boot_patterns = boot_patterns
@@ -39,7 +40,8 @@ class OEQemuTarget(OESSHTarget):
logfile=bootlog, boottime=boottime,
use_kvm=kvm, use_slirp=slirp, dump_dir=dump_dir,
dump_host_cmds=dump_host_cmds, logger=logger,
- serial_ports=serial_ports, boot_patterns = boot_patterns)
+ serial_ports=serial_ports, boot_patterns = boot_patterns,
+ use_ovmf=ovmf)
def start(self, params=None, extra_bootparams=None, runqemuparams=''):
if self.use_slirp and not self.server_ip:
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 7ae309845a..7d9b36f811 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -32,7 +32,7 @@ re_control_char = re.compile('[%s]' % re.escape("".join(control_chars)))
class QemuRunner:
def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds,
- use_kvm, logger, use_slirp=False, serial_ports=2, boot_patterns = defaultdict(str)):
+ use_kvm, logger, use_slirp=False, serial_ports=2, boot_patterns = defaultdict(str), use_ovmf=False):
# Popen object for runqemu
self.runqemu = None
@@ -55,6 +55,7 @@ class QemuRunner:
self.logged = False
self.thread = None
self.use_kvm = use_kvm
+ self.use_ovmf = use_ovmf
self.use_slirp = use_slirp
self.serial_ports = serial_ports
self.msg = ''
@@ -158,6 +159,8 @@ class QemuRunner:
launch_cmd += ' nographic'
if self.use_slirp:
launch_cmd += ' slirp'
+ if self.use_ovmf:
+ launch_cmd += ' ovmf'
launch_cmd += ' %s %s %s' % (runqemuparams, self.machine, self.rootfs)
return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams, env=env)