Skip to contentSkip to conversation

runqemu: support non-bootable wic images

PATCH Superseded Adrian Freihofer 1 participant 2 messages Jun 7, 2019

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover runqemu: support non-bootable wic images

Resolves [Yocto 13336]
Compared to v1, no new wic-nb image type is added (this caused problems with bitbake -c testimage).

runqemu now evaluates the QB_MACHINE setting to determine whether a wic image should be booted as a vmtype image (kernel loaded from file passed by -kernel option) or as a fstype image (kernel in image). If QB_MACHINE contains "-machine virt" runqemu passes a "-kernel" parameter to qemu. Otherwise runqemu treats the wic image as vmtype image as before.

The last patch additionally allows the user to enforce one behavior by passing wic-vm or wic-fs to runqemu.

Adrian Freihofer (4):
qemurunner: fix undefined variable
testimage: consider QB_DEFAULT_FSTYPE
runqemu: support non-bootable wic images
runqemu: add wic-fs and wic-wm paramters

 meta/classes/testimage.bbclass    |  6 +++++-
 meta/lib/oeqa/utils/qemurunner.py |  1 +
 scripts/runqemu                   | 40 +++++++++++++++++++++++++++++++++------
 3 files changed, 40 insertions(+), 7 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 2/4 testimage: consider QB_DEFAULT_FSTYPE

testimage.bbclass starts qemu with the first image type found in the IMAGE_FSTYPES list. It's weird: this ['wic', 'tar'] works but this ['tar'. 'wic'] does not. If QB_DEFAULT_FSTYPE is defined, this fstype is booted.

---
 meta/classes/testimage.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/classes/testimage.bbclass +5 -1
index 9bb5a5cb0b..525c5a6173 100644
@@ -210,7 +210,11 @@ def testimage_main(d):
             bb.fatal('Unsupported image type built. Add a comptible image to '
                      'IMAGE_FSTYPES. Supported types: %s' %
                      ', '.join(supported_fstypes))
-    rootfs = '%s.%s' % (image_name, fstypes[0])
+    qfstype = fstypes[0]
+    qdeffstype = d.getVar("QB_DEFAULT_FSTYPE")
+    if qdeffstype:
+        qfstype = qdeffstype
+    rootfs = '%s.%s' % (image_name, qfstype)
 
     # Get tmpdir (not really used, just for compatibility)
     tmpdir = d.getVar("TMPDIR")
Signature · 1 line
2.11.0