I have a layer that I am writing for Yocto. I want to have two configurations for the hardware. One would be a standard generic config, one would be a use case specific config, and I can't figure out how to do this.

Here is an example of what I want. let's say in the generic-image recipe, I want network interfaces to be configured for DHCP. And in the use-case-image recipe I want it configured for a static IP.

I could write a bbappend to override the standard the file for init-ifupdown recipe, but that would change the file for all instances that use the init-ifupdown recipe. I only want the file changed when building a use-case-image recipe and not generic-image.

And to take this 1 step further. I have about a dozen files that I want to replace in the rootfs. I don't want to have to write a bbappend for each and every one.

Any idea how to write a recipe that will replace a few files without getting the " that file is already provided by package" error? And not have to write a dozen bbappend files?

I know in buildroot this is easily done with an overlay, unfortunately I am stuck with yocto.



The solution is that this can not happen.

My research led me to discover that this has been called "flavoring" of a build. And Yocto is not created in such a way to allow this to happen at this time. And as far as I can tell it is not going to happen in the near future.

There have been some independent efforts to do this using a single '.inc' file that is included in any affected recipes that will allow the recipe to choose it path to completing its package, but the data inside this ".inc" file needs to be manipulated manually using tools outside the yocto system.

here is a thread I found on the topic in the yocto mail list: https://lists.yoctoproject.org/pipermail/yocto/2014-June/020249.html

As for the multiple file replacements in one recipe, I have also found that this is also not possible, unless I believe there is a disabling of the "insanity check" perhaps, either way I have not figured this out and am dropping work on it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.