diff options
Diffstat (limited to 'documentation/dev-manual/custom-template-configuration-directory.rst')
| -rw-r--r-- | documentation/dev-manual/custom-template-configuration-directory.rst | 72 |
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 | |||
| 3 | Creating a Custom Template Configuration Directory | ||
| 4 | ************************************************** | ||
| 5 | |||
| 6 | If you are producing your own customized version of the build system for | ||
| 7 | use by other users, you might want to customize the message shown by the | ||
| 8 | setup script or you might want to change the template configuration | ||
| 9 | files (i.e. ``local.conf`` and ``bblayers.conf``) that are created in a | ||
| 10 | new build directory. | ||
| 11 | |||
| 12 | The OpenEmbedded build system uses the environment variable | ||
| 13 | ``TEMPLATECONF`` to locate the directory from which it gathers | ||
| 14 | configuration information that ultimately ends up in the | ||
| 15 | :term:`Build Directory` ``conf`` directory. | ||
| 16 | By default, ``TEMPLATECONF`` is set as follows in the ``poky`` | ||
| 17 | repository:: | ||
| 18 | |||
| 19 | TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf} | ||
| 20 | |||
| 21 | This is the | ||
| 22 | directory used by the build system to find templates from which to build | ||
| 23 | some key configuration files. If you look at this directory, you will | ||
| 24 | see the ``bblayers.conf.sample``, ``local.conf.sample``, and | ||
| 25 | ``conf-notes.txt`` files. The build system uses these files to form the | ||
| 26 | respective ``bblayers.conf`` file, ``local.conf`` file, and display the | ||
| 27 | list of BitBake targets when running the setup script. | ||
| 28 | |||
| 29 | To override these default configuration files with configurations you | ||
| 30 | want used within every new Build Directory, simply set the | ||
| 31 | ``TEMPLATECONF`` variable to your directory. The ``TEMPLATECONF`` | ||
| 32 | variable 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 | ||
| 35 | directory. | ||
| 36 | |||
| 37 | Best practices dictate that you should keep your template configuration | ||
| 38 | directory in your custom distribution layer. For example, suppose you | ||
| 39 | have a layer named ``meta-mylayer`` located in your home directory and | ||
| 40 | you want your template configuration directory named ``myconf``. | ||
| 41 | Changing the ``.templateconf`` as follows causes the OpenEmbedded build | ||
| 42 | system 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 | ||
| 45 | your Build Directory, but they are based on your ``*.sample`` files. | ||
| 46 | :: | ||
| 47 | |||
| 48 | TEMPLATECONF=${TEMPLATECONF:-meta-mylayer/myconf} | ||
| 49 | |||
| 50 | Aside from the ``*.sample`` configuration files, the ``conf-notes.txt`` | ||
| 51 | also resides in the default ``meta-poky/conf`` directory. The script | ||
| 52 | that sets up the build environment (i.e. | ||
| 53 | :ref:`structure-core-script`) uses this file to | ||
| 54 | display 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 | ||
| 56 | targets appears as part of the script's output. | ||
| 57 | |||
| 58 | Here is the default list of targets displayed as a result of running | ||
| 59 | either 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 | |||
| 69 | Changing the listed common targets is as easy as editing your version of | ||
| 70 | ``conf-notes.txt`` in your custom template configuration directory and | ||
| 71 | making sure you have ``TEMPLATECONF`` set to your directory. | ||
| 72 | |||
