summaryrefslogtreecommitdiffstats
path: root/documentation/dev-manual/custom-template-configuration-directory.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/dev-manual/custom-template-configuration-directory.rst')
-rw-r--r--documentation/dev-manual/custom-template-configuration-directory.rst72
1 files changed, 72 insertions, 0 deletions
diff --git a/documentation/dev-manual/custom-template-configuration-directory.rst b/documentation/dev-manual/custom-template-configuration-directory.rst
new file mode 100644
index 0000000000..90ed3ed92e
--- /dev/null
+++ b/documentation/dev-manual/custom-template-configuration-directory.rst
@@ -0,0 +1,72 @@
1.. 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 customize the message shown by the
8setup script or you might want to change the template configuration
9files (i.e. ``local.conf`` and ``bblayers.conf``) that are created in a
10new build directory.
11
12The OpenEmbedded build system uses the environment variable
13``TEMPLATECONF`` to locate the directory from which it gathers
14configuration information that ultimately ends up in the
15:term:`Build Directory` ``conf`` directory.
16By default, ``TEMPLATECONF`` is set as follows in the ``poky``
17repository::
18
19 TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf}
20
21This is the
22directory used by the build system to find templates from which to build
23some key configuration files. If you look at this directory, you will
24see the ``bblayers.conf.sample``, ``local.conf.sample``, and
25``conf-notes.txt`` files. The build system uses these files to form the
26respective ``bblayers.conf`` file, ``local.conf`` file, and display the
27list of BitBake targets when running the setup script.
28
29To override these default configuration files with configurations you
30want used within every new Build Directory, simply set the
31``TEMPLATECONF`` variable to your directory. The ``TEMPLATECONF``
32variable is set in the ``.templateconf`` file, which is in the top-level
33:term:`Source Directory` folder
34(e.g. ``poky``). Edit the ``.templateconf`` so that it can locate your
35directory.
36
37Best practices dictate that you should keep your template configuration
38directory in your custom distribution layer. For example, suppose you
39have a layer named ``meta-mylayer`` located in your home directory and
40you want your template configuration directory named ``myconf``.
41Changing the ``.templateconf`` as follows causes the OpenEmbedded build
42system to look in your directory and base its configuration files on the
43``*.sample`` configuration files it finds. The final configuration files
44(i.e. ``local.conf`` and ``bblayers.conf`` ultimately still end up in
45your Build Directory, but they are based on your ``*.sample`` files.
46::
47
48 TEMPLATECONF=${TEMPLATECONF:-meta-mylayer/myconf}
49
50Aside from the ``*.sample`` configuration files, the ``conf-notes.txt``
51also resides in the default ``meta-poky/conf`` directory. The script
52that sets up the build environment (i.e.
53:ref:`structure-core-script`) uses this file to
54display BitBake targets as part of the script output. Customizing this
55``conf-notes.txt`` file is a good way to make sure your list of custom
56targets appears as part of the script's output.
57
58Here is the default list of targets displayed as a result of running
59either of the setup scripts::
60
61 You can now run 'bitbake <target>'
62
63 Common targets are:
64 core-image-minimal
65 core-image-sato
66 meta-toolchain
67 meta-ide-support
68
69Changing the listed common targets is as easy as editing your version of
70``conf-notes.txt`` in your custom template configuration directory and
71making sure you have ``TEMPLATECONF`` set to your directory.
72