In OpenEmbedded, a layer is just a collection of recipes and/or configuration that can be used on top of [[OpenEmbedded-Core|OE-Core]]. Typically each layer is organised around a specific theme, e.g. adding recipes for building web browser software.

In OpenEmbedded, a layer is just a collection of recipes and/or configuration that can be used on top of [[OpenEmbedded-Core|OE-Core]]. Typically each layer is organised around a specific theme, e.g. adding recipes for building web browser software.

−

== Where do I find existing layers? ==

+

=== Where do I find existing layers? ===

−

See [[LayerIndex]].

+

See [http://layers.openembedded.org layers.openembedded.org].

−

== How do I make use of a layer? ==

+

=== How do I make use of a layer? ===

−

Clone / extract it somewhere (typically next to or within your OE-Core base directory) and then add the full path to it to the value of <code>BBLAYERS</code> in your <code>conf/bblayers.conf</code> in your build directory. Note that some layers depend on other layers; it is recommended that you consult the README file within the layer if one is included.

+

Clone / extract it somewhere (typically next to or within your OE-Core base directory, but the exact location is not critical) and then add the full path to it to the value of <code>BBLAYERS</code> in your <code>conf/bblayers.conf</code> in your build directory. Note that some layers depend on other layers; it is recommended that you consult the README file within the layer if one is included. Additionally, note that some layer repositories contain multiple layers - in this case there will be subdirectories in the repository corresponding to each layer.

−

== How do I create a new layer? ==

+

=== How do I create a new layer? ===

See [[Creating a new Layer]].

See [[Creating a new Layer]].

−

== Is there any other documentation on layers? ==

+

=== Is there any other documentation on layers? ===

Yes - the Yocto Project provides a set of manuals that cover layers in some detail.

Yes - the Yocto Project provides a set of manuals that cover layers in some detail.

−

* For general information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#understanding-and-creating-layers "Understanding and Creating Layers"] in the Reference Manual.

+

* For general information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#understanding-and-creating-layers "Understanding and Creating Layers"] in the Yocto Project Development Manual.

−

* For creating a layer for supporting a machine, see the [http://www.yoctoproject.org/docs/current/bsp-guide/bsp-guide.html BSP Developer's Guide].

+

* For creating a layer for supporting a machine, see the [http://www.yoctoproject.org/docs/current/bsp-guide/bsp-guide.html Yocto Project BSP Developer's Guide].

−

== How do I include an inc file from another layer? ==

+

=== How do I include an inc file from another layer? ===

You need to specify the path from the base of the other layer to where the inc file is located; e.g:

You need to specify the path from the base of the other layer to where the inc file is located; e.g:

Line 27:

Line 29:

require recipes-graphics/xorg-driver/xorg-driver-input.inc

require recipes-graphics/xorg-driver/xorg-driver-input.inc

−

== I've bbappended a recipe in my layer to replace a file with my own version but it's not being picked up - why not? ==

+

=== I've bbappended a recipe in my layer to replace a file with my own version but it's not being picked up - why not? ===

Assuming your bbappend is extending FILESEXTRAPATHS (which it must do), the probable cause is that the directory you have added to FILESEXTRAPATHS and the directory in which you have placed the file aren't the same. For example, if you have the following in your bbappend:

Assuming your bbappend is extending FILESEXTRAPATHS (which it must do), the probable cause is that the directory you have added to FILESEXTRAPATHS and the directory in which you have placed the file aren't the same. For example, if you have the following in your bbappend:

Line 33:

Line 35:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

−

then your file must be placed in a directory named ${PN} - i.e. if your recipe file is called "magicrecipe_1.0.bb then the directory would need to be named "magicrecipe". If you prefer, you can adjust the directory name added to FILESEXTRAPATHS as shown above to something else.

+

then your file must be placed in a directory named ${PN} - i.e. if your recipe file is called "magicrecipe_1.0.bb" then the directory would need to be named "magicrecipe". If you prefer, you can adjust the directory name added to FILESEXTRAPATHS as shown above to something else.

−

== I've added a layer to my bblayers.conf and now the system is building an older version of some recipe - why? ==

+

=== I've added a layer to my bblayers.conf and now the system is building an older version of some recipe - why? ===

The added layer likely has a higher layer priority than the one that contains the existing newer recipe. You can use PREFERRED_VERSION_recipename in your distro or local configuration to override the default selection and select the newer recipe.

The added layer likely has a higher layer priority than the one that contains the existing newer recipe. You can use PREFERRED_VERSION_recipename in your distro or local configuration to override the default selection and select the newer recipe.

−

== Can I overlay/append an inc file from another layer in my layer? ==

+

=== Can I overlay/append an inc file from another layer in my layer? ===

+

+

No, you can't; inc files aren't handled in the same manner as .bb and .bbappend files. The best way to handle this is to bbappend each recipe that includes the inc file.

+

+

=== I've just created a new layer and would like to publish it for the community. What should I do? ===

+

+

There are a few important steps you should take in order to publish a layer for the community:

+

+

# '''Existing layers:''' Ideally, ensure your layer does not overlap with other layers. If there must be an overlap and it is not practical to resolve it with the maintainer of the existing layer(s), document what the overlap is and why it is there.

+

# '''Maintainer:''' If you are publishing the layer as a repository, ensure there is a commitment from at least one person to be the maintainer for the layer. The maintainer's role is to accept, review and (if satisfactory) merge patches from the community.

+

# '''README:''' Ensure the layer has a README text file in the root which describes briefly what the layer is for, how to use it (if there are any special instructions), the other layers it depends upon, who it is maintained by, and most importantly where and how people should submit patches for it.

+

# '''Publish:''' Publish the layer in a place where it can be easily accessed. [http://git.yoctoproject.org/cgit/cgit.cgi/ git.yoctoproject.org] and [http://cgit.openembedded.org/cgit.cgi/ openembedded.org] can provide hosting, otherwise it is common to host layers on sites such as [http://github.org github] or [http://gitorious.org gitorious].

Questions relating to the layer index at [http://layers.openembedded.org layers.openembedded.org].

+

+

=== How do I submit a new layer to the index? ===

+

+

Click on "Submit layer" at the right of the top bar of the page, fill in the fields and then click on Submit.

+

+

=== How can I edit the entry for my layer? ===

+

+

If you're already listed as one of the maintainers for the layer, you can create an account using the same email address as the maintainer entry, and once you log in you'll automatically be able to edit the entry (using the "Edit layer" button in the top right hand corner of the layer details page for the layer).

+

+

Alternatively if you're not able to do this, please send an email to paul.eggleton@linux.intel.com with your request.

+

+

=== How do I choose the appropriate "layer type" for my layer? ===

+

+

* Base: this is really only for oe-core and meta-oe, i.e. the base metadata for the build system.

+

* Machine (BSP): if your layer primarily exists to add support for additional machine(s), use this type.

+

* Software: if your layer primarily provides recipes for building additional software, use this type.

+

* Distribution: if your layer primarily provides policy configuration for a distribution (conf/distro/*), which may include customised/additional recipes for the distribution, then choose this type.

+

* Miscellaneous: if your layer doesn't fall into any other category you can choose this type; however there shouldn't be too many miscellaneous layers and it may be an indication that the purpose isn't well defined or that you should consider splitting the layer.

+

+

=== I can't find a recipe I'm looking for. What can I do? ===

+

+

Assuming you have searched the [http://layers.openembedded.org layer index] and haven't found anything, there are a few different avenues you can explore:

+

+

* You may be able to find an older version of the recipe in the [http://cgit.openembedded.org/cgit.cgi/openembedded OE-Classic git repository] which you can bring up-to-date by following [[Migrating metadata to OE-Core]].

+

* Try the <code>create-recipe</code> tool (scripts/create-recipe). It's not particularly sophisticated but at the very least it can give you a skeleton you can start from.

+

* Create your own recipe - it's usually not too difficult. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-addpkg Adding a Package] in the Yocto Project Development Manual for some instructions and examples. You may also find it useful to start by copying another recipe.

+

* Ask the community on the mailing list if anyone has/is planning on writing the recipe.

+

+

=== How often is the recipe/machine information updated in the index? ===

−

No, you can't; inc files aren't handled in the same manner as .bb and .bbappend files. The best way to handle this is to append each recipe that includes the inc file.

+

Currently, the update script runs once every three hours, fetching the latest version of every repository and updating the index for any changes.

General layer questions

What is a layer?

In OpenEmbedded, a layer is just a collection of recipes and/or configuration that can be used on top of OE-Core. Typically each layer is organised around a specific theme, e.g. adding recipes for building web browser software.

Where do I find existing layers?

How do I make use of a layer?

Clone / extract it somewhere (typically next to or within your OE-Core base directory, but the exact location is not critical) and then add the full path to it to the value of BBLAYERS in your conf/bblayers.conf in your build directory. Note that some layers depend on other layers; it is recommended that you consult the README file within the layer if one is included. Additionally, note that some layer repositories contain multiple layers - in this case there will be subdirectories in the repository corresponding to each layer.

How do I include an inc file from another layer?

You need to specify the path from the base of the other layer to where the inc file is located; e.g:

require recipes-graphics/xorg-driver/xorg-driver-input.inc

I've bbappended a recipe in my layer to replace a file with my own version but it's not being picked up - why not?

Assuming your bbappend is extending FILESEXTRAPATHS (which it must do), the probable cause is that the directory you have added to FILESEXTRAPATHS and the directory in which you have placed the file aren't the same. For example, if you have the following in your bbappend:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

then your file must be placed in a directory named ${PN} - i.e. if your recipe file is called "magicrecipe_1.0.bb" then the directory would need to be named "magicrecipe". If you prefer, you can adjust the directory name added to FILESEXTRAPATHS as shown above to something else.

I've added a layer to my bblayers.conf and now the system is building an older version of some recipe - why?

The added layer likely has a higher layer priority than the one that contains the existing newer recipe. You can use PREFERRED_VERSION_recipename in your distro or local configuration to override the default selection and select the newer recipe.

Can I overlay/append an inc file from another layer in my layer?

No, you can't; inc files aren't handled in the same manner as .bb and .bbappend files. The best way to handle this is to bbappend each recipe that includes the inc file.

I've just created a new layer and would like to publish it for the community. What should I do?

There are a few important steps you should take in order to publish a layer for the community:

Existing layers: Ideally, ensure your layer does not overlap with other layers. If there must be an overlap and it is not practical to resolve it with the maintainer of the existing layer(s), document what the overlap is and why it is there.

Maintainer: If you are publishing the layer as a repository, ensure there is a commitment from at least one person to be the maintainer for the layer. The maintainer's role is to accept, review and (if satisfactory) merge patches from the community.

README: Ensure the layer has a README text file in the root which describes briefly what the layer is for, how to use it (if there are any special instructions), the other layers it depends upon, who it is maintained by, and most importantly where and how people should submit patches for it.

Layer index

How do I submit a new layer to the index?

Click on "Submit layer" at the right of the top bar of the page, fill in the fields and then click on Submit.

How can I edit the entry for my layer?

If you're already listed as one of the maintainers for the layer, you can create an account using the same email address as the maintainer entry, and once you log in you'll automatically be able to edit the entry (using the "Edit layer" button in the top right hand corner of the layer details page for the layer).

Alternatively if you're not able to do this, please send an email to paul.eggleton@linux.intel.com with your request.

How do I choose the appropriate "layer type" for my layer?

Base: this is really only for oe-core and meta-oe, i.e. the base metadata for the build system.

Machine (BSP): if your layer primarily exists to add support for additional machine(s), use this type.

Software: if your layer primarily provides recipes for building additional software, use this type.

Distribution: if your layer primarily provides policy configuration for a distribution (conf/distro/*), which may include customised/additional recipes for the distribution, then choose this type.

Miscellaneous: if your layer doesn't fall into any other category you can choose this type; however there shouldn't be too many miscellaneous layers and it may be an indication that the purpose isn't well defined or that you should consider splitting the layer.

I can't find a recipe I'm looking for. What can I do?

Assuming you have searched the layer index and haven't found anything, there are a few different avenues you can explore:

Try the create-recipe tool (scripts/create-recipe). It's not particularly sophisticated but at the very least it can give you a skeleton you can start from.

Create your own recipe - it's usually not too difficult. See Adding a Package in the Yocto Project Development Manual for some instructions and examples. You may also find it useful to start by copying another recipe.

Ask the community on the mailing list if anyone has/is planning on writing the recipe.

How often is the recipe/machine information updated in the index?

Currently, the update script runs once every three hours, fetching the latest version of every repository and updating the index for any changes.