I am creating an image without wic. I have my own recipe for creating the image. This recipe, as part of its work, removes the content of the /boot directory from the rootfs (including the kernel) and re-populates it with a custom efi application. Sometimes this leads to a race with meta/classes/image.bbclass:get_rootfs_size() because said function tries explicitly to calculate the size of the kernel file. I do not need any of this to happen, because, as said, I do not use wic and I use fixed sizes partitions, so he actual used space is irrelevant. This code should not run at all, unless wic is selected as image type. Which is not, in my case. None of the tasks related to wic should run, unless wic is explicitly requested. And even if it was, it should not try to calculate the disk size, unless it is requested to actually allocate space dynamically.
I noticed that also other cases use this function. For example when building an Edison image, with the standard recipe. So wic is not the only user. However it seems to be the cause of issues.
We discussed this on IRC. The conclusion was that there's nothing wrong with the implementation of get_rootfs_size() and do_rootfs_wicenv. What caused the race condition was manipulating the rootfs after do_image. Therefore what remains is the request to make do_rootfs_wicenv optional and turn if off by default. IMHO that's fairly low priority, though.
The main problem reported is that the task for wic is executed unconditionally. Btw, the previous comment is incorrect: the modification of the rootfs was happening with: "addtask do_uefiapp_deploy after do_rootfs before do_image" So, if what I requested from bitbake is honored, there should have been no race, afaik. Now I have a workaround in place that seems to work, but the explanation given for why my implementation was not working doesn't seem to be correct.
Igor is right, do_rootfs_wicenv should run after do_image (because image pre/post commands might still modify the rootfs). - addtask do_rootfs_wicenv after do_rootfs before do_image_wic do_image_complete + addtask do_rootfs_wicenv after do_image before do_image_wic do_image_complete
I'm going to remove this task and explicitly mention it only in wic related recipes.
Please review the fix: http://lists.openembedded.org/pipermail/openembedded-core/2016-March/119274.html
The fix has been merged to master: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=d6cb46cafdb9023556f5fbce32f0f8640cd5c7ce