Bug 9784

Summary: Building with -c rootfs fails if toaster and buildhistory are inherited
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Peter Kjellerstedt <peter.kjellerstedt>
Component: coreAssignee: Elliot Smith <elliot.smith>
Status: VERIFIED FIXED QA Contact: Jose Perez C <jose.perez.carranza>
Severity: normal    
Priority: Medium+ CC: jose.perez.carranza, meta.mr.watcher, meta.watcher
Version: 2.1   
Target Milestone: 2.2 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on: 8556    
Bug Blocks: 9856, 9893    

Description Peter Kjellerstedt 2016-06-16 12:54:56 UTC
If one inherits toaster and buildhistory and the build an image with -c rootfs (without having built an image before), the build fails. This is because the code in toaster.bbclass assumes that buildhistory/images/${MACHINE_ARCH}/${TCLIBC}/<target> (if it exists) contains a files-in-image.txt file. This, however, is not true until an image has been created, but the directory exists already after rootfs has been created.

Another consequence of this is that if one first builds an image, then do some changes, and then build only the rootfs, toaster.bbclass will still find the old files-in-image.txt file from the previous image...

Steps to reproduce:
* git clone http://git.yoctoproject.org/git/poky poky
* cd poky
* . ./oe-init-build-env
* echo 'INHERIT += "buildhistory toaster"' >>conf/local.conf
* echo 'BUILDHISTORY_COMMIT = "1"' >>conf/local.conf
* bitbake core-image-minimal -c rootfs
Comment 1 Elliot Smith 2016-06-22 08:13:54 UTC
After discussion, the solution may be to link creation of files-in-image.txt to do_rootfs. This should ensure that the file is updated whenever rootfs runs (which is when the list of files in files-in-image.txt changes).
Comment 2 Elliot Smith 2016-06-30 11:10:54 UTC
Depends on bug 8556, as that reworks toaster.bbclass and buildinfohelper significantly. Any work done here will clash with those changes, so wait until fixes for bug 8556 are in before approaching this.
Comment 3 Elliot Smith 2016-07-14 09:06:34 UTC
Submitted as part of the patchset for 8556:
https://lists.yoctoproject.org/pipermail/toaster/2016-June/004899.html

The commit which is relevant here is:
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=elliot/toaster/8556-image_fstypes&id=2db715753e81eb5a25e30a040ade190b383b7c79

Brian is currently in the process of upstreaming this.
Comment 4 Jose Perez C 2016-08-12 20:00:16 UTC
Verified on master commit : 6b66e9317f4ec3a69f98f29836aafa35b52f3fc7