Creating a new Layer
Revision as of 11:29, 15 February 2012 by PaulEggleton
How to create a new layer
Creating a layer is simple:
- Create a new directory (traditionally meta-<something>)
- Create a conf/layer.conf. You can simply copy meta-oe's one and just change "openembedded-layer" to something appropriate for your layer; you may also want to set the priority as appropriate.
- Create/copy in the recipes you need into recipes-* subdirectories of the layer directory. If you are bringing recipes across from OE-Classic see Migrating metadata to OE-Core.
To aid maintainability, the following recommendations are made for creating new layers:
- Avoid "overlaying" entire recipes from other layers in your configuration (i.e. copying the entire recipe into your layer and modifying it). Use .bbappend files to override the parts of the recipe you need to modify.
- Avoid duplicating include files - use .bbappends for each recipe that uses the inc file, or if you're introducing a new recipe that requires it, use the full path to refer to the original (e.g. require recipes-core/somepackage/somefile.inc instead of require somefile.inc). If you're finding you have to overlay the inc file it may indicate a deficiency in the inc file in the layer it originally belongs to, which should be addressed instead. An example here would be the way Qt 4 database support plugins are configured - OE-core doesn't have MySQL or PostgreSQL, however meta-oe does, so meta-oe uses .bbappends to modify a variable QT_SQL_DRIVER_FLAGS to enable the appropriate plugins. This variable was added to qt4.inc in OE-core specifically to allow meta-oe to be able to control which plugins are built.