What is the recommended way to include config files depending on the presence of another package or recipe in an image?
For example, if the python3-supervisor
recipe is included in a target image, what is the best way to write a custom recipe so that, in this case, the recipe installs a foo.conf
file into /etc/supervisor/conf.d/
directory, and if the python3-supervisor
recipe is not installed, then it does not do that?
I was looking at DISTRO_FEATURES
as that is sometimes used for installing systemd
unit files, but there's also IMAGE_FEATURES
which might work too if the .conf
files are put in their own packages - e.g. foo-conf
installs /etc/supervisor/conf.d/foo.conf
but only if, say, IMAGE_FEATURES_append = " supervisor-conf"
.
I wasn't able to find any recommendations in the bitbake manual on how to do this properly. Is there a good example in any of the OpenEmbedded layers?
In my case I'm writing my own recipes for my own applications, that would install their own .conf
files into /etc/supervisor/conf.d/
if the python3-supervisor
recipe is installed, and fall back to something else (or nothing) if it isn't, but the problem can be thought of as a more general "how do I gate the installation of certain files based on what's going into the image?"