Bug 10637

Summary: WIC image dependencies are not included in the build
Product: [Build System, Metadata & Runtime] OE-Core Reporter: brian avery <brian.avery>
Component: Scripts and ToolsAssignee: Ed Bartosh <eduard.bartosh>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: richard.purdie, ross.burton
Version: 2.3   
Target Milestone: 2.3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description brian avery 2016-11-09 19:03:52 UTC
Goal - Build a wic image from core-image-minimal and directdisk.wks
---
Add to local.conf:
IMAGE_FSTYPES+="wic wic.bmap"
WKS_FILE="directdisk.wks"
---
$ bitbake core-image-minimal
wic complains with
| Error: Please build syslinux first
$ bitbake syslinux && bitbake core-image-minimal

| Error: A native program mkdosfs required to build the image was not found (see details above).
| 
| Please bake it with 'bitbake dosfstools-native' and try again.
====
So in total, wic errored out, one at a time, about the following:
syslinux,dosfstools-native,mtools-native,syslinux-native
Once these were all built by hand, wic ran to completion fine.
===
Ideally the image fstypes addition of wic or wic.bmap would add the necessary dependencies.
Comment 1 Richard Purdie 2016-11-17 15:50:15 UTC
We've had various discussions on this. The dependencies wic needs depend on the contents of the wks file. Currently the user is expected to add the correct dependencies depending on the wks file they are using.

I appreciate that is suboptimal but this is what we get for using another file format for indirection.

I'll leave this for Ed to comment further on.
Comment 2 Ed Bartosh 2016-11-23 15:42:31 UTC
Richard is right here. There is no easy way to get the list of dependencies except of specifying them explicitly.

In this particular case adding these 3 lines to conf/local.conf worked for me:
WKS_FILE = "directdisk.wks"
IMAGE_FSTYPES += "wic wic.bmap"
do_image_wic[depends] += "syslinux:do_build syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"


Probably there is a better way to do it, but the idea is the same - to explicitly add dependencies that wic requires to build particular image.

Thoughts?
Comment 3 Ed Bartosh 2016-11-24 14:45:18 UTC
To make building a wic image for qemu machines easier I've added WKS_FILE and do_image_wic dependencies into machine configurations:
http://lists.openembedded.org/pipermail/openembedded-core/2016-November/129219.html

So, to enable image building user would only need to add 'wic' to IMAGE_FSTYPES
Comment 4 Ed Bartosh 2016-12-02 13:21:38 UTC
the patch has been merged to poky master: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8a00c404ab7717c50bc43d12b78bede1d68c109e