| Summary: | [rm_work] building VDI image twice fails with rm_work enabled | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Jonathan Liu <net147> | ||||
| Component: | deployment | Assignee: | Ed Bartosh <eduard.bartosh> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | Medium | CC: | jatedev, liezhi.yang, richard.purdie, ross.burton, sgw, stephano | ||||
| Version: | 2.1 | ||||||
| Target Milestone: | 2.2 | ||||||
| Hardware: | x86 | ||||||
| OS: | x86 | ||||||
| Whiteboard: | |||||||
| OS type for building Yocto: | --- | Type of Regression: | Regression (Used to work) | ||||
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |||||
| Attachments: |
|
||||||
|
Description
Jonathan Liu
2016-08-18 12:30:31 UTC
This seems to be a regression caused by http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=efc07c293695c21329442d69fe34411027416188. The issue disappears after reverting the commit. I can reproduce the issue and confirm that it's caused by commit efc07c293695c21329442d69fe34411027416188 The fix for syslinux failure is quite straightforward. see attached patch. However, I suspect other bootloaders, buildhistory, wic-related and possibly other tasks to expect rootfs directory and files to be present. So, the question is should we revert efc07c293695c21329442d69fe34411027416188 or should we get ready to fix similar issues when they appear? Created attachment 3369 [details]
fix v.1
(In reply to comment #2) > I can reproduce the issue and confirm that it's caused by commit > efc07c293695c21329442d69fe34411027416188 > > The fix for syslinux failure is quite straightforward. see attached patch. > > However, I suspect other bootloaders, buildhistory, wic-related and possibly > other tasks to expect rootfs directory and files to be present. > > So, the question is should we revert > efc07c293695c21329442d69fe34411027416188 or should we get ready to fix > similar issues when they appear? I get the following after applying your fix and running "bitbake -c cleanall core-image-minimal; bitbake core-image-minimal; bitbake core-image-minimal": ERROR: core-image-minimal-1.0-r0 do_image_complete: Function failed: buildhistory_get_imageinfo (log file is located at [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_image_complete.28557) ERROR: Logfile of failure stored in: [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_image_complete.28557 Log data follows: | DEBUG: Executing python function do_image_complete | NOTE: Executing write_deploy_manifest ... | DEBUG: Executing python function write_deploy_manifest | DEBUG: Python function write_deploy_manifest finished | NOTE: Executing buildhistory_get_imageinfo ... | DEBUG: Executing shell function buildhistory_get_imageinfo | [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/run.buildhistory_get_imageinfo.28557: line 171: cd: [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/rootfs: No such file or directory | WARNING: [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/run.buildhistory_get_imageinfo.28557:1 exit 1 from '[ "$3" = "fakeroot" ]' | DEBUG: Python function do_image_complete finished | ERROR: Function failed: buildhistory_get_imageinfo (log file is located at [...]/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_image_complete.28557) ERROR: Task [...]/poky/meta/recipes-core/images/core-image-minimal.bb:do_image_complete ([...]/poky/meta/recipes-core/images/core-image-minimal.bb:do_image_complete) failed with exit code '1' yep, this is exactly what I was talking about. buildhistory expects roots directory and files to exist. Firstly, functions should be creating directories they write too, they shouldn't assume something else did it for them. Rather that os.makedirs, you can use the function [dirs] flag. Secondly, I think that commit being pointed too is missing a *do_image_* which is likely needed after the split of do_rootfs into separate tasks. If we do that, I suspect it would solve a lot of the issues mentioned here? I think the images shouldn't be rebuilt in the first place as there are no changes on the second run of "bitbake core-image-minimal". (In reply to comment #7) > I think the images shouldn't be rebuilt in the first place as there are no > changes on the second run of "bitbake core-image-minimal". A closer looks shows that rm_work.bbclass is removing the stamps for the following tasks: * do_bootimg (image-live.bbclass) * do_bootdirectdisk (image-vm.bbclass) * do_vmimg (image-vm.bbclass) The stamps being removed causes the tasks to always execute even when there are no changes to the image when rm_work is enabled. A quick workaround would be to exclude those from do_rm_work() in rm_work.bbclass just like we do for do_image. A better solution would be if we can refactor image-live.bbclass and image-vm.bbclass to use IMAGE_CMD and avoid manually adding tasks (e.g. http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/tree/classes/sdcard_image-rpi.bbclass). first fix has been merged to master: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=f019bb933f8016d33937d755887700f9a446408e > A quick workaround would be to exclude those from do_rm_work() in
> rm_work.bbclass just like we do for do_image. A better solution would be if
> we can refactor image-live.bbclass and image-vm.bbclass to use IMAGE_CMD and
> avoid manually adding tasks (e.g.
> http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/tree/classes/
> sdcard_image-rpi.bbclass).
Thank you for the investigation!
I'm for a quick fix for now. Feel free to create new bugs if you want refactoring work to be done.
Quick fix has been sent for review: http://lists.openembedded.org/pipermail/openembedded-core/2016-August/125456.html the fix has been merged to poky master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=1a620968b1775f5fde27fa513ba7ef0eed501785 |