Search code examples
linuxmariadbyoctorecipe

Configuration of existing Yocto recipes


I am currently looking for the best way to configure existing Yocto recipes for my use case. For example the MySQL server of mariadb - part of the meta-oe layer.

I “activate” PACKAGECONFIG variables using .bbappend files. However, mariadb also has a configuration file (as CONFFILES) my.cnf in the recipe. How do I sensibly change the settings there?

  • Can I overwrite CONFFILES? Do I overwrite the file in my recipe, or in a .bbappendfile?
  • Do I patch the file?
  • Do I put my own configuration file in /etc/my.cnf.d/ “next to it” and try to overwrite the options?

Of course I don't want to change the original sources of the recipe to minimize the effort for updates.

I have found a lot of good instructions and documentation on how to create my own layers and recipes, but nothing that describes how I can best adapt existing recipes to my needs.


Solution

  • my.cnf already exists in SRC_URI of the original mariadb.inc file of meta-oe.

    You just need to trick BitBake to search in your custom layer before reaching the actual meta-oe's mariadb recipe files.

    Your custom layer should have:

    recipes-support/
    └── mysql
        ├── files
        │   └── my.cnf
        └── mariadb_%.bbappend
    

    Then, in mariadb_%.bbappend just add:

    FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
    

    Now, the original mariadb recipe (NB: by original I mean the final recipe after expanding all bbappends) will look for the file://my.cnf file using FILESEXTRAPATHS, and since you have prepended your custom path, it will find it there first.

    NOTE: You don't have to add my.cnf to SRC_URI again in your bbappend.