summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2022-09-11 19:26:08 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-24 17:44:56 +0100
commitcec7d36a8ab1f2f1fe13a8d01074f2ff27ad8564 (patch)
tree4eb98cba7e05560574e33fc88a044389d9be4c98
parentc66e7b9479c66b2ea1a174e124eb3b9d4e3fa094 (diff)
downloadpoky-cec7d36a8ab1f2f1fe13a8d01074f2ff27ad8564.tar.gz
dev-manual: common-tasks.rst: rewrite the section about configuration templates
This now includes a description about how to create a template with the newly added tooling, and drops the description of .templateconf as a way to point to a custom template (which is not correct: .templateconf is used only to point to a default template in poky or core when TEMPLATECONF is not specified). (From yocto-docs rev: d8e43d4ff4d6a0a4557d5dcedf11c1e45a223e72) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--documentation/dev-manual/common-tasks.rst92
1 files changed, 36 insertions, 56 deletions
diff --git a/documentation/dev-manual/common-tasks.rst b/documentation/dev-manual/common-tasks.rst
index 837824be38..cfbd0bef02 100644
--- a/documentation/dev-manual/common-tasks.rst
+++ b/documentation/dev-manual/common-tasks.rst
@@ -6466,71 +6466,51 @@ Creating a Custom Template Configuration Directory
6466================================================== 6466==================================================
6467 6467
6468If you are producing your own customized version of the build system for 6468If you are producing your own customized version of the build system for
6469use by other users, you might want to customize the message shown by the 6469use by other users, you might want to provide a custom build configuration
6470setup script or you might want to change the template configuration 6470that includes all the necessary settings and layers (i.e. ``local.conf`` and
6471files (i.e. ``local.conf`` and ``bblayers.conf``) that are created in a 6471``bblayers.conf`` that are created in a new build directory) and a custom
6472new build directory. 6472message that is shown when setting up the build. This can be done by
6473creating one or more template configuration directories in your
6474custom distribution layer.
6473 6475
6474The OpenEmbedded build system uses the environment variable 6476This can be done by using ``bitbake-layers save-build-conf``::
6475:term:`TEMPLATECONF` to locate the directory from which it gathers
6476configuration information that ultimately ends up in the
6477:term:`Build Directory` ``conf`` directory.
6478By default, :term:`TEMPLATECONF` is set as follows in the ``poky``
6479repository::
6480 6477
6481 TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf} 6478 $ bitbake-layers save-build-conf ../../meta-alex/ test-1
6482 6479 NOTE: Starting bitbake server...
6483This is the 6480 NOTE: Configuration template placed into /srv/work/alex/meta-alex/conf/templates/test-1
6484directory used by the build system to find templates from which to build 6481 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
6485some key configuration files. If you look at this directory, you will 6482 You can try out the configuration with
6486see the ``bblayers.conf.sample``, ``local.conf.sample``, and 6483 TEMPLATECONF=/srv/work/alex/meta-alex/conf/templates/test-1 . /srv/work/alex/poky/oe-init-build-env build-try-test-1
6487``conf-notes.txt`` files. The build system uses these files to form the
6488respective ``bblayers.conf`` file, ``local.conf`` file, and display the
6489list of BitBake targets when running the setup script.
6490
6491To override these default configuration files with configurations you
6492want used within every new Build Directory, simply set the
6493:term:`TEMPLATECONF` variable to your directory. The :term:`TEMPLATECONF`
6494variable is set in the ``.templateconf`` file, which is in the top-level
6495:term:`Source Directory` folder
6496(e.g. ``poky``). Edit the ``.templateconf`` so that it can locate your
6497directory.
6498 6484
6499Best practices dictate that you should keep your template configuration 6485The above command takes the config files from the currently active build directory under ``conf``,
6500directory in your custom distribution layer. For example, suppose you 6486replaces site-specific paths in ``bblayers.conf`` with ``##OECORE##``-relative paths, and copies
6501have a layer named ``meta-mylayer`` located in your home directory and 6487the config files into a specified layer under a specified template name.
6502you want your template configuration directory named ``myconf``.
6503Changing the ``.templateconf`` as follows causes the OpenEmbedded build
6504system to look in your directory and base its configuration files on the
6505``*.sample`` configuration files it finds. The final configuration files
6506(i.e. ``local.conf`` and ``bblayers.conf`` ultimately still end up in
6507your Build Directory, but they are based on your ``*.sample`` files.
6508::
6509 6488
6510 TEMPLATECONF=${TEMPLATECONF:-meta-mylayer/myconf} 6489To use those saved templates as a starting point for a build, users should point
6490to one of them with :term:`TEMPLATECONF` environment variable::
6511 6491
6512Aside from the ``*.sample`` configuration files, the ``conf-notes.txt`` 6492 TEMPLATECONF=/srv/work/alex/meta-alex/conf/templates/test-1 . /srv/work/alex/poky/oe-init-build-env build-try-test-1
6513also resides in the default ``meta-poky/conf`` directory. The script
6514that sets up the build environment (i.e.
6515:ref:`structure-core-script`) uses this file to
6516display BitBake targets as part of the script output. Customizing this
6517``conf-notes.txt`` file is a good way to make sure your list of custom
6518targets appears as part of the script's output.
6519 6493
6520Here is the default list of targets displayed as a result of running 6494The OpenEmbedded build system uses the environment variable
6521either of the setup scripts:: 6495:term:`TEMPLATECONF` to locate the directory from which it gathers
6496configuration information that ultimately ends up in the
6497:term:`Build Directory` ``conf`` directory.
6522 6498
6523 You can now run 'bitbake <target>' 6499If :term:`TEMPLATECONF` is not set, the default value is obtained
6500from ``.templateconf`` file that is read from the same directory as
6501``oe-init-build-env`` script. For the Poky reference distribution this
6502would be::
6524 6503
6525 Common targets are: 6504 TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf/templates/default}
6526 core-image-minimal
6527 core-image-sato
6528 meta-toolchain
6529 meta-ide-support
6530 6505
6531Changing the listed common targets is as easy as editing your version of 6506If you look at a configuration template directory, you will
6532``conf-notes.txt`` in your custom template configuration directory and 6507see the ``bblayers.conf.sample``, ``local.conf.sample``, and
6533making sure you have :term:`TEMPLATECONF` set to your directory. 6508``conf-notes.txt`` files. The build system uses these files to form the
6509respective ``bblayers.conf`` file, ``local.conf`` file, and show
6510users a note about the build they're setting up
6511when running the ``oe-init-build-env`` setup script. These can be
6512edited further if needed to improve or change the build configurations
6513available to the users.
6534 6514
6535Conserving Disk Space 6515Conserving Disk Space
6536===================== 6516=====================