Creating a new Layer

Revision as of 11:29, 15 February 2012 by PaulEggleton (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to create a new layer

Creating a layer is simple:

  1. Create a new directory (traditionally meta-<something>)
  2. 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.
  3. 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.

Best practices

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/ instead of require 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 in OE-core specifically to allow meta-oe to be able to control which plugins are built.
Personal tools

OE services