custom-template-configuration-directory.rst 2.7 KB

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