Bug 13336

Summary: runqemu: support non bootable wic images
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Adrian Freihofer <adrian.freihofer>
Component: Scripts and ToolsAssignee: Adrian Freihofer <adrian.freihofer>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: randy.macleod, ross.burton
Version: unspecified   
Target Milestone: 2.8 M1   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Adrian Freihofer 2019-05-07 10:41:39 UTC
runqemu supports two types of images:
- fsimages: rootfs only
- vmimages: bootloader, kernel, rootfs

wic images are handled as vmtype images. Hence, wic images without bootloader and kernel are not supported. However, it is totally fine to create a wic image which is of type fstype.

This patch http://lists.openembedded.org/pipermail/openembedded-core/2019-April/281223.html allows to add QB_DEFAULT_FSTYPE = "wic-nb" to the machine configuration and to boot a wic image without bootloader and kernel.

Are there any concerns or suggestions about the implementation?
Comment 1 Adrian Freihofer 2019-06-04 09:00:41 UTC
One more note: I also thought about extending wic to automatically detect if there is a bootloader in the image and automatically treat the image as fsimage or vmimage. But there are two arguments against it:
- It is possible that somebody wants to compile a vmimage for the real hardware, but still wants to boot this image in Qemu as an fsimage.
- There are many special cases, such as different bootloaders and partitioning schemas which are hard to detect reliably.

If I received a hint about what would be wrong with my implementation, I would try to provide an alternative implementation.
Comment 2 Adrian Freihofer 2019-06-08 08:25:03 UTC
A new implementation is available on the mailing list:
http://lists.openembedded.org/pipermail/openembedded-core/2019-June/283392.html

If QB_MACHINE contains "-machine virt", runqemu treats the wic image as a fstype image. Otherwise, wic images are still treated as Vmtype images.
Comment 3 Adrian Freihofer 2019-06-16 14:24:40 UTC
It was solved by adding a new parameter QB_FSINFO. The parameter allows to pass e.g. "wic:no-kernel-in-fs" to runqemu. Further details can be found in the commit message.
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=0e4c79a7c4dae93fb1b12e8c0a59e8252e3f4b71