diff options
author | Alexander Kanavin <alex@linutronix.de> | 2024-12-11 14:46:15 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-12-13 10:44:35 +0000 |
commit | adebd9f9bca496510bf5631f62eb16d283f1d728 (patch) | |
tree | 4852ec5f18dbcb495967352cc39da4f267906114 /bitbake/doc | |
parent | e0e6124d9adbd7a407b332535c1a3a6434cb157d (diff) | |
download | poky-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.rst | 48 |
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. | |||
754 | This section presents the mechanisms BitBake provides to allow you to | 754 | This section presents the mechanisms BitBake provides to allow you to |
755 | share functionality between recipes. Specifically, the mechanisms | 755 | share functionality between recipes. Specifically, the mechanisms |
756 | include ``include``, ``inherit``, :term:`INHERIT`, and ``require`` | 756 | include ``include``, ``inherit``, :term:`INHERIT`, and ``require`` |
757 | directives. | 757 | directives. There is also a higher-level abstraction called |
758 | ``configuration fragments`` that is enabled with ``addfragments`` | ||
759 | directive. | ||
758 | 760 | ||
759 | Locating Include and Class Files | 761 | Locating 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 | |||
970 | This directive allows fine-tuning local configurations with configuration | ||
971 | snippets contained in layers in a structured, controlled way. Typically it would | ||
972 | go 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 | ||
979 | uses to construct full paths to the fragment files | ||
980 | |||
981 | - name of variable that holds the list of enabled fragments in an | ||
982 | active build | ||
983 | |||
984 | - name of variable that contains a list of variable names containing | ||
985 | fragment-specific metadata (such as descriptions) | ||
986 | |||
987 | This allows listing enabled configuration fragments in ``OE_FRAGMENTS`` | ||
988 | variable like this:: | ||
989 | |||
990 | OE_FRAGMENTS = "core/domain/somefragment core/someotherfragment anotherlayer/anotherdomain/anotherfragment" | ||
991 | |||
992 | Fragment names listed in this variable must be prefixed by the layer name | ||
993 | where a fragment file is located, defined by :term:`BBFILE_COLLECTIONS` in ``layer.conf``. | ||
994 | |||
995 | The implementation then expands this list into | ||
996 | :ref:`require <bitbake-user-manual/bitbake-user-manual-metadata:\`\`require\`\` directive>` | ||
997 | directives 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 | |||
1003 | The 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 | |||
1007 | The implementation will add a flag containing the fragment name to each of those variables | ||
1008 | when parsing fragments, so that the variables are namespaced by fragment name, and do not override | ||
1009 | each other when several fragments are enabled. | ||
1010 | |||
965 | Functions | 1011 | Functions |
966 | ========= | 1012 | ========= |
967 | 1013 | ||