From: Antonin Godard <antonin.godard@bootlin.com>
To: docs@lists.yoctoproject.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Antonin Godard <antonin.godard@bootlin.com>
Subject: [PATCH 01/18] ref-manual/layers.rst: add document
Date: Wed, 02 Dec 2026 15:55:36 +0100 [thread overview]
Message-ID: <20261202-layer-conf-changes-v1-1-da34d4c770c6@bootlin.com> (raw)
In-Reply-To: <20261202-layer-conf-changes-v1-0-da34d4c770c6@bootlin.com>
This document aims to hold basic, but concept information about what a
layer is and how it is supposed to be organized.
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
documentation/ref-manual/index.rst | 1 +
documentation/ref-manual/layers.rst | 148 ++++++++++++++++++++++++++++++++++++
2 files changed, 149 insertions(+)
diff --git a/documentation/ref-manual/index.rst b/documentation/ref-manual/index.rst
index 6f02b0fc9..c0dbbe457 100644
--- a/documentation/ref-manual/index.rst
+++ b/documentation/ref-manual/index.rst
@@ -15,6 +15,7 @@ Yocto Project Reference Manual
terms
release-process
structure
+ layers
classes
tasks
library-functions
diff --git a/documentation/ref-manual/layers.rst b/documentation/ref-manual/layers.rst
new file mode 100644
index 000000000..100f96598
--- /dev/null
+++ b/documentation/ref-manual/layers.rst
@@ -0,0 +1,148 @@
+.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
+
+******
+Layers
+******
+
+This section of the Yocto Project Reference Manual contains reference
+documentation about :term:`Layers <layer>`, a core component of the
+:term:`OpenEmbedded Build System`.
+
+Layer Configuration Files
+=========================
+
+A :term:`layer` is a collection of :term:`metadata`, which can be
+:term:`configuration files <Configuration File>`, :doc:`classes
+</ref-manual/classes>`, recipes, bbappends, or :term:`configuration fragments
+<Configuration Fragment>`.
+
+This collection is represented as a directory, and its structure should at a
+minimum contain a ``conf/`` directory and a ``layer.conf`` configuration
+file:
+
+.. code-block:: text
+
+ meta-foo/
+ └── conf/
+ └── layer.conf
+
+A :term:`layer` directory name is prefixed with ``meta-`` by convention, such as
+``meta-example`` in the snippet above.
+
+.. _structure-conf-layer.conf:
+
+``conf/layer.conf``
+-------------------
+
+The :ref:`structure-conf-layer.conf` file is what :term:`BitBake` looks for when
+a :term:`layer` is included in the :ref:`structure-build-conf-bblayers.conf`
+file (located in the :term:`Build Directory`). It declares basic information
+about the layer and its dependencies.
+
+At a minimum, this file should contain the following variable assignments::
+
+ LAYERNAME = "meta-example"
+ LAYERVERSION = "1"
+ LAYERDEPENDS = "oe-core ..."
+ LAYERSERIES_COMPAT = "garburn"
+
+See each variable's definition in the :doc:`variable glossary
+</ref-manual/variables>` for more information.
+
+In addition to these variables:
+
+- Only the variable prefixes listed in :term:`LAYER_PASSTHROUGH_VARS_PREFIXES`
+ are allowed to be set from the :ref:`structure-conf-layer.conf` file. The
+ :term:`OpenEmbedded-Core (OE-Core)` layer sets this variable.
+
+ .. note::
+
+ While not recommended, a layer can override the
+ :term:`LAYER_PASSTHROUGH_VARS_PREFIXES` variable to allow other variables
+ to be set from the :ref:`structure-conf-layer.conf` file.
+
+ This layer must set *the entire list* of prefixes with a regular ``=``
+ assignment. It also must be the first one setting the
+ :term:`LAYER_PASSTHROUGH_VARS_PREFIXES` variable in the :term:`BBLAYERS`
+ list. As a consequence, any other statement made by another layer setting
+ or appending the :term:`LAYER_PASSTHROUGH_VARS_PREFIXES` variable is
+ ignored.
+
+ If setting a global variable is required, it is recommended to do so from
+ a distro :term:`configuration file` or from a :term:`configuration
+ fragment`.
+
+ .. warning::
+
+ Any other variables set in this file will have no effect! To set a
+ variable from a layer configuration file, which only affects the scope of
+ the :term:`metadata` part of the layer, see the
+ :ref:`structure-conf-layervars.conf` file definition.
+
+- The :ref:`addpylib <bitbake-user-manual/bitbake-user-manual-metadata:Extending
+ Python Library Code>` directive can be used to make an internal Python
+ library available to the :term:`metadata`.
+
+.. _structure-conf-layervars.conf:
+
+``conf/layervars.conf``
+-----------------------
+
+The :ref:`structure-conf-layervars.conf` is, like
+:ref:`structure-conf-layer.conf`, part of the layer's ``conf/`` directory, and
+can contain variable assignments. Those assignments only affect the
+:term:`metadata` part of the layer itself *without affecting the global scope*.
+
+For example, if a layer provides a global :doc:`class </ref-manual/classes>`,
+but this class only makes sense for the recipes part of the layer, then one
+could write the following in :ref:`structure-conf-layervars.conf`::
+
+ INHERIT += "myclass"
+
+This class would be inherited only by the recipes part of the layer containing
+the file, but other recipes *not* part of the layer would not inherit that
+class.
+
+Layer Metadata
+==============
+
+A layer can contain various forms of :term:`metadata`. The aim of this section
+is not to explain what each of these types of :term:`metadata` do, but rather
+enumerate and link to each part of the documentation associated with them:
+
+- Recipes: see the :ref:`bitbake-user-manual/bitbake-user-manual-intro:Recipes`
+ section for more information.
+
+- Append files (bbappends): see the :ref:`bitbake:append-bbappend-files`
+ section for information.
+
+- Configuration files:
+
+ - Machine configuration files, see the :ref:`bsp-manual/bsp:Hardware
+ Configuration Options` section for more information.
+
+ - Distro configuration files, see the :doc:`/dev-manual/custom-distribution`
+ section for more information.
+
+ - Configuration Fragments: see the :doc:`/dev-manual/creating-fragments`
+ section for more information.
+
+- :doc:`classes </ref-manual/classes>`: expected to be found by
+ :term:`BitBake` in any of the ``classes/``, ``classes-global/``, and
+ ``classes-recipe/`` directories at the root of the layer.
+
+ See the :doc:`/ref-manual/classes` section for more information on classes.
+
+- Internal Python libraries: see the
+ :ref:`bitbake-user-manual/bitbake-user-manual-metadata:Extending
+ Python Library Code` section for more information.
+
+Additional Information on Layers
+================================
+
+The BitBake User Manual contains additional information on layers which can be
+found here:
+
+- :ref:`bitbake-user-manual/bitbake-user-manual-execution:Locating and Parsing Recipes`.
+- :ref:`bitbake-user-manual/bitbake-user-manual-execution:Dynamic Recipes and Append Files`.
+- :ref:`bitbake-user-manual/bitbake-user-manual-execution:Parsing Order And Priorities`.
--
2.56.0
next prev parent reply other threads:[~2026-12-02 14:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 14:55 [PATCH 00/18] docs: refresh after layer configuration format changes Antonin Godard
2026-12-02 14:55 ` Antonin Godard [this message]
2026-12-02 14:55 ` [PATCH 02/18] ref-manual/variables.rst: BBFILES: refresh the definition Antonin Godard
2026-12-02 14:55 ` [PATCH 03/18] ref-manual/variables.rst: drop obsolete BBFILE* variables Antonin Godard
2026-12-02 14:55 ` [PATCH 04/18] ref-manual/variables.rst: drop LAYERDIR_RE Antonin Godard
2026-12-02 14:55 ` [PATCH 05/18] ref-manual/variables.rst: link bitbake-specific to the bitbake manual Antonin Godard
2026-12-02 14:55 ` [PATCH 06/18] ref-manual/variables.rst: document LAYER_FRAGMENTS_OPTED_OUT/LAYER_FRAGMENT_RECOMMENDS_ANY Antonin Godard
2026-12-02 14:55 ` [PATCH 07/18] migration-guides/migration-6.2.rst: add section on now layer format Antonin Godard
2026-12-02 14:55 ` [PATCH 08/18] migration-guides/migration-6.2.rst: add a section on the new core layer names Antonin Godard
2026-12-02 14:55 ` [PATCH 09/18] dev-manual/layers.rst: remove a leftover poky repo reference Antonin Godard
2026-12-02 14:55 ` [PATCH 10/18] dev-manual/layers.rst: refresh after layer configuration format changes Antonin Godard
2026-12-02 14:55 ` [PATCH 11/18] bsp-manual/bsp.rst: remove obsolete layer.conf references Antonin Godard
2026-12-02 14:55 ` [PATCH 12/18] kernel-dev/common.rst: " Antonin Godard
2026-12-02 14:55 ` [PATCH 13/18] docs-wide: rename core/* fragments to oe-core/* Antonin Godard
2026-12-02 14:55 ` [PATCH 14/18] dev-manual/creating-fragments.rst: remove obsolete BBFILE_COLLECTIONS reference Antonin Godard
2026-12-02 14:55 ` [PATCH 15/18] dev-manual/licenses.rst: refresh obsolete bblayers.conf.sample example Antonin Godard
2026-12-02 14:55 ` [PATCH 16/18] dev-manual/new-recipe.rst: remove obsolete BBFILES statement Antonin Godard
2026-12-02 14:55 ` [PATCH 17/18] security-manual/vulnerabilities.rst: rename core -> oe-core in JSON snippet Antonin Godard
2026-12-02 14:55 ` [PATCH 18/18] test-manual/runtime-testing.rst: fix wrong BBPATH statements Antonin Godard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261202-layer-conf-changes-v1-1-da34d4c770c6@bootlin.com \
--to=antonin.godard@bootlin.com \
--cc=docs@lists.yoctoproject.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox