[yocto] How to customize a file coming from another recipe?
Paul Eggleton
paul.eggleton at linux.intel.com
Thu Sep 12 03:16:11 PDT 2013
Hi Brad,
On Wednesday 11 September 2013 20:30:47 Brad Litterell wrote:
> I'm building w/the Arago distribution which contains lighttpd for a web
> server. I include this in my image as follows:
>
> IMAGE_INSTALL = "packagegroup-core-boot \
> ...
> lighttpd lighttpd-module-cgi lighttpd-module-compress lighttpd-module-expire
> \ ...
> "
>
> This installs a default configuration file for the service which I now want
> to customize. What is the recommended way to overwrite or customize files
> in another package?
>
> Is the best course to create a recipe bbappend for the lighttpd_1.4.31.bb
> file that is being used? And can I just include a new file with the same
> name in my append and will it overwrite the old one, or do I need to create
> an actual patch file?
So, since this config file is provided along with the original recipe, and is
already mentioned in SRC_URI and installed within do_install, you only need to
extend FILESEXTRAPATHS in your bbappend so that the system can pick up your
version of the file. Outright replacing the file is the easiest way here rather
than trying to patch it.
So in your bbappend you would have:
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
and then next to the bbappend you would have a directory called "lighttpd" (to
match ${PN} in the above line) containing your replacement lighttpd.conf file.
If you prefer you could replace "${PN}" with "files" and name the directory the
same; it's up to you.
> Or is it better to create a new separate recipe that just ships my version
> of the configuration file? How are conflicts handled when two recipes
> attempt to install the same file?
This won't work because the package manager will refuse to install packages
that install the same file (unless it is forced). bbappending the existing
recipe is the way to go.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
More information about the yocto
mailing list