summaryrefslogtreecommitdiffstats
path: root/bitbake/doc
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2024-12-11 14:46:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-12-13 10:44:35 +0000
commitadebd9f9bca496510bf5631f62eb16d283f1d728 (patch)
tree4852ec5f18dbcb495967352cc39da4f267906114 /bitbake/doc
parente0e6124d9adbd7a407b332535c1a3a6434cb157d (diff)
downloadpoky-adebd9f9bca496510bf5631f62eb16d283f1d728.tar.gz
bitbake: bitbake-user-manual-metadata: add a section about 'addfragments`
(Bitbake rev: 47e4645da582daa8f3e818ba98e9652c2dcf202f) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/doc')
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst48
1 files changed, 47 insertions, 1 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
index 40a0c6f02d..75930fef82 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
@@ -754,7 +754,9 @@ share the task.
754This section presents the mechanisms BitBake provides to allow you to 754This section presents the mechanisms BitBake provides to allow you to
755share functionality between recipes. Specifically, the mechanisms 755share functionality between recipes. Specifically, the mechanisms
756include ``include``, ``inherit``, :term:`INHERIT`, and ``require`` 756include ``include``, ``inherit``, :term:`INHERIT`, and ``require``
757directives. 757directives. There is also a higher-level abstraction called
758``configuration fragments`` that is enabled with ``addfragments``
759directive.
758 760
759Locating Include and Class Files 761Locating Include and Class Files
760-------------------------------- 762--------------------------------
@@ -962,6 +964,50 @@ the ``autotools`` and ``pkgconfig`` classes::
962 964
963 INHERIT += "autotools pkgconfig" 965 INHERIT += "autotools pkgconfig"
964 966
967``addfragments`` Directive
968--------------------------
969
970This directive allows fine-tuning local configurations with configuration
971snippets contained in layers in a structured, controlled way. Typically it would
972go into ``bitbake.conf``, for example::
973
974 addfragments conf/fragments OE_FRAGMENTS OE_FRAGMENTS_METADATA_VARS
975
976``addfragments`` takes three parameters:
977
978- path prefix for fragment files inside the layer file tree that bitbake
979uses to construct full paths to the fragment files
980
981- name of variable that holds the list of enabled fragments in an
982active build
983
984- name of variable that contains a list of variable names containing
985fragment-specific metadata (such as descriptions)
986
987This allows listing enabled configuration fragments in ``OE_FRAGMENTS``
988variable like this::
989
990 OE_FRAGMENTS = "core/domain/somefragment core/someotherfragment anotherlayer/anotherdomain/anotherfragment"
991
992Fragment names listed in this variable must be prefixed by the layer name
993where a fragment file is located, defined by :term:`BBFILE_COLLECTIONS` in ``layer.conf``.
994
995The implementation then expands this list into
996:ref:`require <bitbake-user-manual/bitbake-user-manual-metadata:\`\`require\`\` directive>`
997directives with full paths to respective layers::
998
999 require /path/to/core-layer/conf/fragments/domain/somefragment.conf
1000 require /path/to/core-layer/conf/fragments/someotherfragment.conf
1001 require /path/to/another-layer/conf/fragments/anotherdomain/anotherfragment.conf
1002
1003The variable containing a list of fragment metadata variables could look like this::
1004
1005 OE_FRAGMENTS_METADATA_VARS = "BB_CONF_FRAGMENT_SUMMARY BB_CONF_FRAGMENT_DESCRIPTION"
1006
1007The implementation will add a flag containing the fragment name to each of those variables
1008when parsing fragments, so that the variables are namespaced by fragment name, and do not override
1009each other when several fragments are enabled.
1010
965Functions 1011Functions
966========= 1012=========
967 1013