From patchwork Wed Dec 2 14:55:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Antonin Godard X-Patchwork-Id: 107009 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.37898.1796223349997582050 for ; Wed, 02 Dec 2026 06:55:50 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=UVdXzLDe; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: antonin.godard@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 668691A18E1 for ; Wed, 2 Dec 2026 14:55:48 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 342936075F for ; Wed, 2 Dec 2026 14:55:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8E89B11EA1BCF; Wed, 02 Dec 2026 15:55:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796223347; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=DymtbjGTPcB7Jr3uLVc/v0hRyXjvEVLaeGj2VZR+hIg=; b=UVdXzLDeJoZqoTOArhGRIokHsnKRtZu4+MnmwQcHcBEXCR6JUWfTVu0sPeLL2xJt253yd7 M4hvqbiQdvBCH+1LEUripRsFSsPZnWvQ0idpAgfJuWl2raAdzgaDfH22dvfmv6ulkI37xU Yvm/2BLrhbg6ZV343AeDeDCp9c9Fl+Dv2HmAsPw6MhA3sngT+FdOk0nt5cUDtfbEbv7/GQ UMRQJ3lfzK8TTcm/SGxn6JAkzFliko7Woq3TmBYG6A3jVn+84Ffwpbsx2TGjIvtHNyJbfX xWA81bgtA0RmEZOsAYK6STlmblsPEHuBCFklOrZJORKL4nTORaNJbfHU88BkOA== From: Antonin Godard Date: Wed, 02 Dec 2026 15:55:36 +0100 Subject: [PATCH 01/18] ref-manual/layers.rst: add document MIME-Version: 1.0 Message-Id: <20261202-layer-conf-changes-v1-1-da34d4c770c6@bootlin.com> References: <20261202-layer-conf-changes-v1-0-da34d4c770c6@bootlin.com> In-Reply-To: <20261202-layer-conf-changes-v1-0-da34d4c770c6@bootlin.com> To: docs@lists.yoctoproject.org Cc: Thomas Petazzoni , Antonin Godard X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=6819; i=antonin.godard@bootlin.com; h=from:subject:message-id; bh=3i3rz4aOCzLFWZgPL8bKXOdlWsiOiMIuieNCqHXsDwY=; b=owEBbQKS/ZANAwAKAdGAQUApo6g2AcsmYgBrEDFsjT9Z+T4xlCe0ziRSS4v7cN/xZYEt4dUzO 0TY1ZlJfUKJAjMEAAEKAB0WIQSGSHJRiN1AG7mg0//RgEFAKaOoNgUCaxAxbAAKCRDRgEFAKaOo NvtWD/4rkM8egG3s2fDRvXERzDejIBkRDFxy19sAWfHkfX+iuvnp1WR+EDm6BlrxVdmrpVOgjiC lSjI+j0VrkD8p9t2u5vcX3pdE6xqJwXQM+z4C++kY7Zsjj3vy2SmUPj17SyGN2xzG1O4R3cI6IQ hZO2VVeT6+3UrVN6DkntI0z7NjfoKHvlIzoxQ+S4Z8Q/BeDSFPHb58vzJUaCUk+meCq8zmCnmYI 428Lx342lRxavML+gZdyaUE3AMWl1jMcGDDCxMnrFBh+gu1NfU09TpnfvQfi8pB4qX1CyrqMqmq pe+CzXa6lKsjkOSaBqsRWeoHKTnImdBTiGksd+nRrMpgXeijaSut523Iqtg2NXtaMKOhV9eoE2r Mff/nvM2ClvTaE/swpyzDS8tzN4mCfq+3IIzSGUDVKPlyHW1JVhmlrwdDW601es+W5xzm5v2uev xm5d60z9qzEw/ZSdexgT7X6BJAubthSQiUaDxI3dx5OLBkvA4X35m8pm9HjkPV6LxscJcLGiXiT J71Gv05G73Ou9CSUGN4u/fs2M2N0fbuwCOo39edUTOz89GKE5v53Ar4tp4aOCf7470wmDsR2WdU 8SW1PztdiKb5I75UgCBDzJzS8AR7KQdx9xCZ6np6n9UzjaQgC7hE3piqNrmX8jO1iPsXoj9521C GhjKHbSSmc+lbjw== X-Developer-Key: i=antonin.godard@bootlin.com; a=openpgp; fpr=8648725188DD401BB9A0D3FFD180414029A3A836 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Wed, 02 Dec 2026 14:55:52 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/10888 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 --- 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 `, 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 `, :doc:`classes +`, recipes, bbappends, or :term:`configuration fragments +`. + +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 +` 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 ` 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 `, +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 `: 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`.