transitioning-to-a-custom-environment.rst 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. =============================================================
  3. Transitioning to a custom environment for systems development
  4. =============================================================
  5. |
  6. .. note::
  7. So you've finished the :doc:`brief-yoctoprojectqs/index` and
  8. glanced over the document :doc:`what-i-wish-id-known`, the latter contains
  9. important information learned from other users. You're well prepared. But
  10. now, as you are starting your own project, it isn't exactly straightforward what
  11. to do. And, the documentation is daunting. We've put together a few hints to
  12. get you started.
  13. #. **Make a list of the processor, target board, technologies, and capabilities
  14. that will be part of your project**.
  15. You will be finding layers with recipes and other metadata that support these
  16. things, and adding them to your configuration. (See #3)
  17. #. **Set up your board support**.
  18. Even if you're using custom hardware, it might be easier to start with an
  19. existing target board that uses the same processor or at least the same
  20. architecture as your custom hardware. Knowing the board already has a
  21. functioning Board Support Package (BSP) within the project makes it easier
  22. for you to get comfortable with project concepts.
  23. #. **Find and acquire the best BSP for your target**.
  24. Use the :yocto_home:`Yocto Project Compatible Layers
  25. </software-overview/layers/>` or even the :oe_layerindex:`OpenEmbedded
  26. Layer Index <>` to find and acquire the best BSP for your
  27. target board. The Yocto Project layer index BSPs are regularly validated. The
  28. best place to get your first BSP is from your silicon manufacturer or board
  29. vendor – they can point you to their most qualified efforts. In general, for
  30. Intel silicon use meta-intel, for Texas Instruments use meta-ti, and so
  31. forth. Choose a BSP that has been tested with the same Yocto Project release
  32. that you've downloaded. Be aware that some BSPs may not be immediately
  33. supported on the very latest release, but they will be eventually.
  34. You might want to start with the build specification that Poky provides
  35. (which is reference embedded distribution) and then add your newly chosen
  36. layers to that. Here is the information :ref:`about adding layers
  37. <dev-manual/layers:Understanding and Creating Layers>`.
  38. #. **Based on the layers you've chosen, make needed changes in your
  39. configuration**.
  40. For instance, you've chosen a machine type and added in the corresponding BSP
  41. layer. You'll then need to change the value of the :term:`MACHINE` variable in your
  42. configuration file (build/local.conf) to point to that same machine
  43. type. There could be other layer-specific settings you need to change as
  44. well. Each layer has a ``README`` document that you can look at for this type of
  45. usage information.
  46. #. **Add a new layer for any custom recipes and metadata you create**.
  47. Use the ``bitbake-layers create-layer`` tool for Yocto Project 2.4+
  48. releases. If you are using a Yocto Project release earlier than 2.4, use the
  49. ``yocto-layer create`` tool. The ``bitbake-layers`` tool also provides a number
  50. of other useful layer-related commands. See
  51. :ref:`dev-manual/layers:creating a general layer using the
  52. \`\`bitbake-layers\`\` script` section.
  53. #. **Create your own layer for the BSP you're going to use**.
  54. It is not common that you would need to create an entire BSP from scratch
  55. unless you have a *really* special device. Even if you are using an existing
  56. BSP, :ref:`create your own layer for the BSP <bsp-guide/bsp:creating a new
  57. bsp layer using the \`\`bitbake-layers\`\` script>`. For example, given a
  58. 64-bit x86-based machine, copy the conf/intel-corei7-64 definition and give
  59. the machine a relevant name (think board name, not product name). Make sure
  60. the layer configuration is dependent on the meta-intel layer (or at least,
  61. meta-intel remains in your bblayers.conf). Now you can put your custom BSP
  62. settings into your layer and you can re-use it for different applications.
  63. #. **Write your own recipe to build additional software support that isn't
  64. already available in the form of a recipe**.
  65. Creating your own recipe is especially important for custom application
  66. software that you want to run on your device. Writing new recipes is a
  67. process of refinement. Start by getting each step of the build process
  68. working beginning with fetching all the way through packaging. Next, run the
  69. software on your target and refine further as needed. See :ref:`Writing a New
  70. Recipe <dev-manual/new-recipe:writing a new recipe>` in the
  71. Yocto Project Development Tasks Manual for more information.
  72. #. **Now you're ready to create an image recipe**.
  73. There are a number of ways to do this. However, it is strongly recommended
  74. that you have your own image recipe --- don't try appending to existing image
  75. recipes. Recipes for images are trivial to create and you usually want to
  76. fully customize their contents.
  77. #. **Build your image and refine it**.
  78. Add what's missing and fix anything that's broken using your knowledge of the
  79. :ref:`workflow <sdk-manual/extensible:using \`\`devtool\`\` in your sdk
  80. workflow>` to identify where issues might be occurring.
  81. #. **Consider creating your own distribution**.
  82. When you get to a certain level of customization, consider creating your own
  83. distribution rather than using the default reference distribution.
  84. Distribution settings define the packaging back-end (e.g. rpm or other) as
  85. well as the package feed and possibly the update solution. You would create
  86. your own distribution in a new layer inheriting from Poky but overriding what
  87. needs to change for your distribution. If you find yourself adding a lot of
  88. configuration to your local.conf file aside from paths and other typical
  89. local settings, it's time to :ref:`consider creating your own distribution
  90. <dev-manual/custom-distribution:creating your own distribution>`.
  91. You can add product specifications that can customize the distribution if
  92. needed in other layers. You can also add other functionality specific to the
  93. product. But to update the distribution, not individual products, you update
  94. the distribution feature through that layer.
  95. #. **Congratulations! You're well on your way.**
  96. Welcome to the Yocto Project community.
  97. .. include:: /boilerplate.rst