Bug 6447

Summary: Add ability to find a target file and create a bbappend to replace it
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Eggleton <bluelightning>
Component: configurationAssignee: Paul Eggleton <bluelightning>
Status: VERIFIED FIXED QA Contact: Daniel Istrate <daniel.alexandrux.istrate>
Severity: enhancement    
Priority: Medium CC: bogdanx.a.voiculescu, kergoth
Version: 1.7   
Target Milestone: 1.9   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Paul Eggleton 2014-06-13 13:27:10 UTC
Locating which recipe provides a file in an image that you want to modify can be a tedious process. We should create a tool that finds which recipe a particular config file (or other file I want to replace) comes from, and then automatically creates a bbappend to substitute my version.

As long as we assume a build has completed already, we have the part that tracks down the recipe from a file - albeit in a not-very-easy-to-use form - in scripts/oe-pkgdata-util (with its "find-path" command). Toaster has the functionality to do this as well. We'd need to use the build system to tell us the right recipe to pick if there are multiple providers.

For creating the bbappend, this is also moderately challenging since:

* The original file may be directly in SRC_URI (in which case we don't need to add it) or provided as part of a source tree (e.g. upstream tarball, in which case we do). We'll also have to interpret install lines in do_install as a way of mapping back files installed by the package to entries in SRC_URI.

* There might already be a bbappend in the current configuration which provides its own version of the file. (Perhaps we ignore this part of the problem initially.)
Comment 2 Daniel Istrate 2015-10-09 13:11:25 UTC
Verified on master: eac61f37e36099f74485dab398b57f3812826d17

Functionality testing is covered in oe-selftest testcases from devtool and recipetool.