summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKonrad Weihmann <kweihmann@outlook.com>2020-04-14 21:19:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-02 16:12:36 +0100
commit21b666b47b95f2962921243ee054b77f37bffb23 (patch)
tree460e2990fbb04746eec3f97f5cc1f5199eb574ad /meta
parent81c46e46a8f3db9659fef58d6bd1ce0e45f4ff95 (diff)
downloadpoky-21b666b47b95f2962921243ee054b77f37bffb23.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: 458a860b45c0fb5bb3162b5a112b518c3339c1dd) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3af8aaff68ed332d812ea7dc184d392700ad7882) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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 deb81bc256..53945478af 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -275,11 +275,14 @@ def testimage_main(d):
275 # Get use_kvm 275 # Get use_kvm
276 kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH')) 276 kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH'))
277 277
278 # Get OVMF
279 ovmf = d.getVar("QEMU_USE_OVMF")
280
278 slirp = False 281 slirp = False
279 if d.getVar("QEMU_USE_SLIRP"): 282 if d.getVar("QEMU_USE_SLIRP"):
280 slirp = True 283 slirp = True
281 284
282 # TODO: We use the current implementatin of qemu runner because of 285 # TODO: We use the current implementation of qemu runner because of
283 # time constrains, qemu runner really needs a refactor too. 286 # time constrains, qemu runner really needs a refactor too.
284 target_kwargs = { 'machine' : machine, 287 target_kwargs = { 'machine' : machine,
285 'rootfs' : rootfs, 288 'rootfs' : rootfs,
@@ -293,6 +296,7 @@ def testimage_main(d):
293 'slirp' : slirp, 296 'slirp' : slirp,
294 'dump_dir' : d.getVar("TESTIMAGE_DUMP_DIR"), 297 'dump_dir' : d.getVar("TESTIMAGE_DUMP_DIR"),
295 'serial_ports': len(d.getVar("SERIAL_CONSOLES").split()), 298 'serial_ports': len(d.getVar("SERIAL_CONSOLES").split()),
299 'ovmf' : ovmf,
296 } 300 }
297 301
298 if d.getVar("TESTIMAGE_BOOT_PATTERNS"): 302 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):
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 77ae08ebeb..992fff9370 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
@@ -56,6 +56,7 @@ class QemuRunner:
56 self.logged = False 56 self.logged = False
57 self.thread = None 57 self.thread = None
58 self.use_kvm = use_kvm 58 self.use_kvm = use_kvm
59 self.use_ovmf = use_ovmf
59 self.use_slirp = use_slirp 60 self.use_slirp = use_slirp
60 self.serial_ports = serial_ports 61 self.serial_ports = serial_ports
61 self.msg = '' 62 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)