blob: 9bffef35b466abed1eb9b23aede40613a37e7f98 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3Creating a Custom Template Configuration Directory
4**************************************************
5
6If you are producing your own customized version of the build system for
7use by other users, you might want to provide a custom build configuration
8that includes all the necessary settings and layers (i.e. ``local.conf`` and
9``bblayers.conf`` that are created in a new :term:`Build Directory`) and a custom
10message that is shown when setting up the build. This can be done by
11creating one or more template configuration directories in your
12custom distribution layer.
13
14This can be done by using ``bitbake-layers save-build-conf``::
15
16 $ bitbake-layers save-build-conf ../../meta-alex/ test-1
17 NOTE: Starting bitbake server...
18 NOTE: Configuration template placed into /srv/work/alex/meta-alex/conf/templates/test-1
19 Please review the files in there, and particularly provide a configuration description in /srv/work/alex/meta-alex/conf/templates/test-1/conf-notes.txt
20 You can try out the configuration with
21 TEMPLATECONF=/srv/work/alex/meta-alex/conf/templates/test-1 . /srv/work/alex/poky/oe-init-build-env build-try-test-1
22
23The above command takes the config files from the currently active :term:`Build Directory` under ``conf``,
24replaces site-specific paths in ``bblayers.conf`` with ``##OECORE##``-relative paths, and copies
25the config files into a specified layer under a specified template name.
26
27To use those saved templates as a starting point for a build, users should point
28to one of them with :term:`TEMPLATECONF` environment variable::
29
30 TEMPLATECONF=/srv/work/alex/meta-alex/conf/templates/test-1 . /srv/work/alex/poky/oe-init-build-env build-try-test-1
31
32The OpenEmbedded build system uses the environment variable
33:term:`TEMPLATECONF` to locate the directory from which it gathers
34configuration information that ultimately ends up in the
35:term:`Build Directory` ``conf`` directory.
36
37If :term:`TEMPLATECONF` is not set, the default value is obtained
38from ``.templateconf`` file that is read from the same directory as
39``oe-init-build-env`` script. For the Poky reference distribution this
40would be::
41
42 TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf/templates/default}
43
44If you look at a configuration template directory, you will
45see the ``bblayers.conf.sample``, ``local.conf.sample``, and
46``conf-notes.txt`` files. The build system uses these files to form the
47respective ``bblayers.conf`` file, ``local.conf`` file, and show
48users a note about the build they're setting up
49when running the ``oe-init-build-env`` setup script. These can be
50edited further if needed to improve or change the build configurations
51available to the users.
52