summaryrefslogtreecommitdiffstats
path: root/meta/lib
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:10:08 +0100
commitda0ab97f6104e63aa5e822f57eef8dfc3b524941 (patch)
treeb011b38047eaccfed4f07208c80c98bbd35b354b /meta/lib
parentb3a109509bfed84fb504151168e3b26dfe7b2bb0 (diff)
downloadpoky-da0ab97f6104e63aa5e822f57eef8dfc3b524941.tar.gz
testimage: enable ovmf support
Add support for running wic images with EFI as testimage. Introduces a variable called QEMU_USE_OVMF for configuration. (From OE-Core rev: 3af8aaff68ed332d812ea7dc184d392700ad7882) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/core/target/qemu.py6
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py5
2 files changed, 8 insertions, 3 deletions
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):
20 port=None, machine='', rootfs='', kernel='', kvm=False, slirp=False, 20 port=None, machine='', rootfs='', kernel='', kvm=False, slirp=False,
21 dump_dir='', dump_host_cmds='', display='', bootlog='', 21 dump_dir='', dump_host_cmds='', display='', bootlog='',
22 tmpdir='', dir_image='', boottime=60, serial_ports=2, 22 tmpdir='', dir_image='', boottime=60, serial_ports=2,
23 boot_patterns = defaultdict(str), **kwargs): 23 boot_patterns = defaultdict(str), ovmf=False, **kwargs):
24 24
25 super(OEQemuTarget, self).__init__(logger, None, server_ip, timeout, 25 super(OEQemuTarget, self).__init__(logger, None, server_ip, timeout,
26 user, port) 26 user, port)
@@ -31,6 +31,7 @@ class OEQemuTarget(OESSHTarget):
31 self.rootfs = rootfs 31 self.rootfs = rootfs
32 self.kernel = kernel 32 self.kernel = kernel
33 self.kvm = kvm 33 self.kvm = kvm
34 self.ovmf = ovmf
34 self.use_slirp = slirp 35 self.use_slirp = slirp
35 self.boot_patterns = boot_patterns 36 self.boot_patterns = boot_patterns
36 37
@@ -39,7 +40,8 @@ class OEQemuTarget(OESSHTarget):
39 logfile=bootlog, boottime=boottime, 40 logfile=bootlog, boottime=boottime,
40 use_kvm=kvm, use_slirp=slirp, dump_dir=dump_dir, 41 use_kvm=kvm, use_slirp=slirp, dump_dir=dump_dir,
41 dump_host_cmds=dump_host_cmds, logger=logger, 42 dump_host_cmds=dump_host_cmds, logger=logger,
42 serial_ports=serial_ports, boot_patterns = boot_patterns) 43 serial_ports=serial_ports, boot_patterns = boot_patterns,
44 use_ovmf=ovmf)
43 45
44 def start(self, params=None, extra_bootparams=None, runqemuparams=''): 46 def start(self, params=None, extra_bootparams=None, runqemuparams=''):
45 if self.use_slirp and not self.server_ip: 47 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)))
32class QemuRunner: 32class QemuRunner:
33 33
34 def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds, 34 def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds,
35 use_kvm, logger, use_slirp=False, serial_ports=2, boot_patterns = defaultdict(str)): 35 use_kvm, logger, use_slirp=False, serial_ports=2, boot_patterns = defaultdict(str), use_ovmf=False):
36 36
37 # Popen object for runqemu 37 # Popen object for runqemu
38 self.runqemu = None 38 self.runqemu = None
@@ -55,6 +55,7 @@ class QemuRunner:
55 self.logged = False 55 self.logged = False
56 self.thread = None 56 self.thread = None
57 self.use_kvm = use_kvm 57 self.use_kvm = use_kvm
58 self.use_ovmf = use_ovmf
58 self.use_slirp = use_slirp 59 self.use_slirp = use_slirp
59 self.serial_ports = serial_ports 60 self.serial_ports = serial_ports
60 self.msg = '' 61 self.msg = ''
@@ -158,6 +159,8 @@ class QemuRunner:
158 launch_cmd += ' nographic' 159 launch_cmd += ' nographic'
159 if self.use_slirp: 160 if self.use_slirp:
160 launch_cmd += ' slirp' 161 launch_cmd += ' slirp'
162 if self.use_ovmf:
163 launch_cmd += ' ovmf'
161 launch_cmd += ' %s %s %s' % (runqemuparams, self.machine, self.rootfs) 164 launch_cmd += ' %s %s %s' % (runqemuparams, self.machine, self.rootfs)
162 165
163 return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams, env=env) 166 return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams, env=env)