@@ -30,6 +30,98 @@ GNU/Linux distributions:
See :ref:`all supported distributions <system-requirements-supported-distros>`.
+New layer configuration file format
+-----------------------------------
+
+With |yocto-codename|, the :term:`layer` configuration file has a new format for
+which all layers should adapt. This file is the ``conf/layer.conf`` file found
+in any layer.
+
+This section goes through the consequences of these changes and what is required
+to do to update your configuration file accordingly.
+
+#. This file should now contain a minimal number of variables::
+
+ LAYERNAME = "<layer name>"
+ LAYERVERSION = "1"
+ LAYERDEPENDS = "oe-core ..."
+ LAYERSERIES_COMPAT = "garburn"
+
+ These four variables (:term:`LAYERNAME`, :term:`LAYERVERSION`,
+ :term:`LAYERDEPENDS` and :term:`LAYERSERIES_COMPAT`) are sufficient for a
+ layer to function correctly.
+
+ Let's take a look at the previous default definition for a layer
+ configuration file::
+
+ # We have a conf and classes directory, add to BBPATH
+ BBPATH .= ":${LAYERDIR}"
+
+ # We have recipes-* directories, add to BBFILES
+ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+ BBFILE_COLLECTIONS += "<layer name>"
+ BBFILE_PATTERN_<layer name> = "^${LAYERDIR}/"
+ BBFILE_PRIORITY_<layer name> = "100"
+
+ LAYERDEPENDS_<layer name> = "core"
+ LAYERSERIES_COMPAT_<layer name> = "garburn"
+
+ Some variables *no longer need to be set*: :term:`BBPATH`, :term:`BBFILES`,
+ ``BBFILE_COLLECTIONS``, ``BBFILE_PATTERN``, and
+ ``BBFILE_PRIORITY``. These variables are all either automatically
+ determined by :term:`BitBake`, or obsolete. The priority removal is detailed
+ below.
+
+ The following table recapitulates the conversions from one format to the other:
+
+ .. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - Before
+ - After
+ * - ``BBPATH .= ":${LAYERDIR}"``
+ - *No longer needed*
+ * - ``BBFILES += "..."``
+ - *No longer needed*
+ * - ``BBFILE_COLLECTIONS += "<layer name>"``
+ - ``LAYERNAME = "<layer name>"``
+ * - ``BBFILE_PATTERN_<layer name> = "^${LAYERDIR}/"``
+ - *No longer needed*
+ * - ``BBFILE_PRIORITY_<layer name> = "100"``
+ - *No longer needed* (see explanation below)
+ * - ``LAYERDEPENDS_<layer name> = "core"``
+ - ``LAYERDEPENDS = "oe-core"``
+ * - ``LAYERSERIES_COMPAT_<layer name> = "garburn"``
+ - ``LAYERSERIES_COMPAT = "garburn"``
+ * - ``LAYERVERSION_<layer name> = "1"``
+ - ``LAYERVERSION = "1"``
+
+#. The list of variables allowed to be set from the
+ :ref:`structure-conf-layer.conf` file is limited to the variable prefixes
+ part of the :term:`LAYER_PASSTHROUGH_VARS_PREFIXES` variable. See the
+ :ref:`structure-conf-layer.conf` for more information.
+
+ A layer can also set variables that apply to the layer's :term:`metadata`
+ only with the :ref:`structure-conf-layervars.conf` file. It is otherwise
+ recommended to provide your own distro :term:`configuration file`, or your
+ own :term:`configuration fragments <Configuration Fragment>` (which you can
+ recommend with :term:`LAYER_FRAGMENT_RECOMMENDS_ANY`).
+
+#. Layers no longer have a concept of numbered priority, which was represented
+ by the ``BBFILE_PRIORITY`` variable.
+
+ Priorities were mainly used in situations where two layers provided the same
+ recipe: the layer with the higher priority won, and its recipe was selected.
+
+ Now, users are expected to set the :term:`PREFERRED_VERSION` variable from a
+ :term:`configuration file` in order to select which version they prefer to
+ select for the build.
+
+ Otherwise, a recipe can set the :term:`DEFAULT_PREFERENCE` variable.
+
Removed recipes
---------------
Document a migration guide on the new layer configuration file format, what it implies and how to convert a previous layer.conf file. Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> --- documentation/migration-guides/migration-6.2.rst | 92 ++++++++++++++++++++++++ 1 file changed, 92 insertions(+)