Andrew Geissler | f034379 | 2020-11-18 10:42:21 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: CC-BY-SA-2.0-UK |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2 | |
| 3 | ***************************** |
| 4 | Introducing the Yocto Project |
| 5 | ***************************** |
| 6 | |
| 7 | What is the Yocto Project? |
| 8 | ========================== |
| 9 | |
| 10 | The Yocto Project is an open source collaboration project that helps |
| 11 | developers create custom Linux-based systems that are designed for |
| 12 | embedded products regardless of the product's hardware architecture. |
| 13 | Yocto Project provides a flexible toolset and a development environment |
| 14 | that allows embedded device developers across the world to collaborate |
| 15 | through shared technologies, software stacks, configurations, and best |
| 16 | practices used to create these tailored Linux images. |
| 17 | |
| 18 | Thousands of developers worldwide have discovered that Yocto Project |
| 19 | provides advantages in both systems and applications development, |
| 20 | archival and management benefits, and customizations used for speed, |
| 21 | footprint, and memory utilization. The project is a standard when it |
| 22 | comes to delivering embedded software stacks. The project allows |
| 23 | software customizations and build interchange for multiple hardware |
| 24 | platforms as well as software stacks that can be maintained and scaled. |
| 25 | |
| 26 | .. image:: figures/key-dev-elements.png |
| 27 | :align: center |
| 28 | |
| 29 | For further introductory information on the Yocto Project, you might be |
| 30 | interested in this |
| 31 | `article <https://www.embedded.com/electronics-blogs/say-what-/4458600/Why-the-Yocto-Project-for-my-IoT-Project->`__ |
| 32 | by Drew Moseley and in this short introductory |
| 33 | `video <https://www.youtube.com/watch?v=utZpKM7i5Z4>`__. |
| 34 | |
| 35 | The remainder of this section overviews advantages and challenges tied |
| 36 | to the Yocto Project. |
| 37 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 38 | Features |
| 39 | -------- |
| 40 | |
| 41 | The following list describes features and advantages of the Yocto |
| 42 | Project: |
| 43 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 44 | - *Widely Adopted Across the Industry:* Many semiconductor, operating |
| 45 | system, software, and service vendors adopt and support the Yocto |
| 46 | Project in their products and services. For a look at the Yocto |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 47 | Project community and the companies involved with the Yocto Project, |
| 48 | see the "COMMUNITY" and "ECOSYSTEM" tabs on the |
| 49 | :yocto_home:`Yocto Project <>` home page. |
| 50 | |
| 51 | - *Architecture Agnostic:* Yocto Project supports Intel, ARM, MIPS, |
| 52 | AMD, PPC and other architectures. Most ODMs, OSVs, and chip vendors |
| 53 | create and supply BSPs that support their hardware. If you have |
| 54 | custom silicon, you can create a BSP that supports that architecture. |
| 55 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 56 | Aside from broad architecture support, the Yocto Project fully |
| 57 | supports a wide range of devices emulated by the Quick EMUlator |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 58 | (QEMU). |
| 59 | |
| 60 | - *Images and Code Transfer Easily:* Yocto Project output can easily |
| 61 | move between architectures without moving to new development |
| 62 | environments. Additionally, if you have used the Yocto Project to |
| 63 | create an image or application and you find yourself not able to |
| 64 | support it, commercial Linux vendors such as Wind River, Mentor |
| 65 | Graphics, Timesys, and ENEA could take it and provide ongoing |
| 66 | support. These vendors have offerings that are built using the Yocto |
| 67 | Project. |
| 68 | |
| 69 | - *Flexibility:* Corporations use the Yocto Project many different |
| 70 | ways. One example is to create an internal Linux distribution as a |
| 71 | code base the corporation can use across multiple product groups. |
| 72 | Through customization and layering, a project group can leverage the |
| 73 | base Linux distribution to create a distribution that works for their |
| 74 | product needs. |
| 75 | |
| 76 | - *Ideal for Constrained Embedded and IoT devices:* Unlike a full Linux |
| 77 | distribution, you can use the Yocto Project to create exactly what |
| 78 | you need for embedded devices. You only add the feature support or |
| 79 | packages that you absolutely need for the device. For devices that |
| 80 | have display hardware, you can use available system components such |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 81 | as X11, Wayland, GTK+, Qt, Clutter, and SDL (among others) to create |
| 82 | a rich user experience. For devices that do not have a display or |
| 83 | where you want to use alternative UI frameworks, you can choose to |
| 84 | not build these components. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 85 | |
| 86 | - *Comprehensive Toolchain Capabilities:* Toolchains for supported |
| 87 | architectures satisfy most use cases. However, if your hardware |
| 88 | supports features that are not part of a standard toolchain, you can |
| 89 | easily customize that toolchain through specification of |
| 90 | platform-specific tuning parameters. And, should you need to use a |
| 91 | third-party toolchain, mechanisms built into the Yocto Project allow |
| 92 | for that. |
| 93 | |
| 94 | - *Mechanism Rules Over Policy:* Focusing on mechanism rather than |
| 95 | policy ensures that you are free to set policies based on the needs |
| 96 | of your design instead of adopting decisions enforced by some system |
| 97 | software provider. |
| 98 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 99 | - *Uses a Layer Model:* The Yocto Project :ref:`layer |
| 100 | infrastructure <overview-manual/yp-intro:the yocto project layer model>` |
| 101 | groups related functionality into separate bundles. You can incrementally |
| 102 | add these grouped functionalities to your project as needed. Using layers to |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 103 | isolate and group functionality reduces project complexity and |
| 104 | redundancy, allows you to easily extend the system, make |
| 105 | customizations, and keep functionality organized. |
| 106 | |
| 107 | - *Supports Partial Builds:* You can build and rebuild individual |
| 108 | packages as needed. Yocto Project accomplishes this through its |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 109 | :ref:`overview-manual/concepts:shared state cache` (sstate) scheme. |
| 110 | Being able to build and debug components individually eases project |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 111 | development. |
| 112 | |
| 113 | - *Releases According to a Strict Schedule:* Major releases occur on a |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 114 | :doc:`six-month cycle </ref-manual/release-process>` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 115 | predictably in October and April. The most recent two releases |
| 116 | support point releases to address common vulnerabilities and |
| 117 | exposures. This predictability is crucial for projects based on the |
| 118 | Yocto Project and allows development teams to plan activities. |
| 119 | |
| 120 | - *Rich Ecosystem of Individuals and Organizations:* For open source |
| 121 | projects, the value of community is very important. Support forums, |
| 122 | expertise, and active developers who continue to push the Yocto |
| 123 | Project forward are readily available. |
| 124 | |
| 125 | - *Binary Reproducibility:* The Yocto Project allows you to be very |
| 126 | specific about dependencies and achieves very high percentages of |
| 127 | binary reproducibility (e.g. 99.8% for ``core-image-minimal``). When |
| 128 | distributions are not specific about which packages are pulled in and |
| 129 | in what order to support dependencies, other build systems can |
| 130 | arbitrarily include packages. |
| 131 | |
| 132 | - *License Manifest:* The Yocto Project provides a :ref:`license |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 133 | manifest <dev-manual/common-tasks:maintaining open source license compliance during your product's lifecycle>` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 134 | for review by people who need to track the use of open source |
| 135 | licenses (e.g. legal teams). |
| 136 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 137 | Challenges |
| 138 | ---------- |
| 139 | |
| 140 | The following list presents challenges you might encounter when |
| 141 | developing using the Yocto Project: |
| 142 | |
| 143 | - *Steep Learning Curve:* The Yocto Project has a steep learning curve |
| 144 | and has many different ways to accomplish similar tasks. It can be |
| 145 | difficult to choose how to proceed when varying methods exist by |
| 146 | which to accomplish a given task. |
| 147 | |
| 148 | - *Understanding What Changes You Need to Make For Your Design Requires |
| 149 | Some Research:* Beyond the simple tutorial stage, understanding what |
| 150 | changes need to be made for your particular design can require a |
| 151 | significant amount of research and investigation. For information |
| 152 | that helps you transition from trying out the Yocto Project to using |
| 153 | it for your project, see the ":ref:`what-i-wish-id-known:what i wish i'd known about yocto project`" and |
| 154 | ":ref:`transitioning-to-a-custom-environment:transitioning to a custom environment for systems development`" |
| 155 | documents on the Yocto Project website. |
| 156 | |
| 157 | - *Project Workflow Could Be Confusing:* The `Yocto Project |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 158 | workflow <overview-manual/development-environment:the yocto project development environment>` |
| 159 | could be confusing if you are used to traditional desktop and server |
| 160 | software development. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 161 | In a desktop development environment, mechanisms exist to easily pull |
| 162 | and install new packages, which are typically pre-compiled binaries |
| 163 | from servers accessible over the Internet. Using the Yocto Project, |
| 164 | you must modify your configuration and rebuild to add additional |
| 165 | packages. |
| 166 | |
| 167 | - *Working in a Cross-Build Environment Can Feel Unfamiliar:* When |
| 168 | developing code to run on a target, compilation, execution, and |
| 169 | testing done on the actual target can be faster than running a |
| 170 | BitBake build on a development host and then deploying binaries to |
| 171 | the target for test. While the Yocto Project does support development |
| 172 | tools on the target, the additional step of integrating your changes |
| 173 | back into the Yocto Project build environment would be required. |
| 174 | Yocto Project supports an intermediate approach that involves making |
| 175 | changes on the development system within the BitBake environment and |
| 176 | then deploying only the updated packages to the target. |
| 177 | |
| 178 | The Yocto Project :term:`OpenEmbedded Build System` |
| 179 | produces packages |
| 180 | in standard formats (i.e. RPM, DEB, IPK, and TAR). You can deploy |
| 181 | these packages into the running system on the target by using |
| 182 | utilities on the target such as ``rpm`` or ``ipk``. |
| 183 | |
| 184 | - *Initial Build Times Can be Significant:* Long initial build times |
| 185 | are unfortunately unavoidable due to the large number of packages |
| 186 | initially built from scratch for a fully functioning Linux system. |
| 187 | Once that initial build is completed, however, the shared-state |
| 188 | (sstate) cache mechanism Yocto Project uses keeps the system from |
| 189 | rebuilding packages that have not been "touched" since the last |
| 190 | build. The sstate mechanism significantly reduces times for |
| 191 | successive builds. |
| 192 | |
| 193 | The Yocto Project Layer Model |
| 194 | ============================= |
| 195 | |
| 196 | The Yocto Project's "Layer Model" is a development model for embedded |
| 197 | and IoT Linux creation that distinguishes the Yocto Project from other |
| 198 | simple build systems. The Layer Model simultaneously supports |
| 199 | collaboration and customization. Layers are repositories that contain |
| 200 | related sets of instructions that tell the :term:`OpenEmbedded Build System` |
| 201 | what to do. You can |
| 202 | collaborate, share, and reuse layers. |
| 203 | |
| 204 | Layers can contain changes to previous instructions or settings at any |
| 205 | time. This powerful override capability is what allows you to customize |
| 206 | previously supplied collaborative or community layers to suit your |
| 207 | product requirements. |
| 208 | |
| 209 | You use different layers to logically separate information in your |
| 210 | build. As an example, you could have BSP, GUI, distro configuration, |
| 211 | middleware, or application layers. Putting your entire build into one |
| 212 | layer limits and complicates future customization and reuse. Isolating |
| 213 | information into layers, on the other hand, helps simplify future |
| 214 | customizations and reuse. You might find it tempting to keep everything |
| 215 | in one layer when working on a single project. However, the more modular |
| 216 | your Metadata, the easier it is to cope with future changes. |
| 217 | |
| 218 | .. note:: |
| 219 | |
| 220 | - Use Board Support Package (BSP) layers from silicon vendors when |
| 221 | possible. |
| 222 | |
| 223 | - Familiarize yourself with the `Yocto Project curated layer |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 224 | index <https://www.yoctoproject.org/software-overview/layers/>`__ |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 225 | or the :oe_layerindex:`OpenEmbedded layer index <>`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 226 | The latter contains more layers but they are less universally |
| 227 | validated. |
| 228 | |
| 229 | - Layers support the inclusion of technologies, hardware components, |
| 230 | and software components. The :ref:`Yocto Project |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 231 | Compatible <dev-manual/common-tasks:making sure your layer is compatible with yocto project>` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 232 | designation provides a minimum level of standardization that |
| 233 | contributes to a strong ecosystem. "YP Compatible" is applied to |
| 234 | appropriate products and software components such as BSPs, other |
| 235 | OE-compatible layers, and related open-source projects, allowing |
| 236 | the producer to use Yocto Project badges and branding assets. |
| 237 | |
| 238 | To illustrate how layers are used to keep things modular, consider |
| 239 | machine customizations. These types of customizations typically reside |
| 240 | in a special layer, rather than a general layer, called a BSP Layer. |
| 241 | Furthermore, the machine customizations should be isolated from recipes |
| 242 | and Metadata that support a new GUI environment, for example. This |
| 243 | situation gives you a couple of layers: one for the machine |
| 244 | configurations, and one for the GUI environment. It is important to |
| 245 | understand, however, that the BSP layer can still make machine-specific |
| 246 | additions to recipes within the GUI environment layer without polluting |
| 247 | the GUI layer itself with those machine-specific changes. You can |
| 248 | accomplish this through a recipe that is a BitBake append |
| 249 | (``.bbappend``) file, which is described later in this section. |
| 250 | |
| 251 | .. note:: |
| 252 | |
| 253 | For general information on BSP layer structure, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 254 | :doc:`/bsp-guide/index` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 255 | . |
| 256 | |
| 257 | The :term:`Source Directory` |
| 258 | contains both general layers and BSP layers right out of the box. You |
| 259 | can easily identify layers that ship with a Yocto Project release in the |
| 260 | Source Directory by their names. Layers typically have names that begin |
| 261 | with the string ``meta-``. |
| 262 | |
| 263 | .. note:: |
| 264 | |
| 265 | It is not a requirement that a layer name begin with the prefix |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 266 | ``meta-``, but it is a commonly accepted standard in the Yocto Project |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 267 | community. |
| 268 | |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 269 | For example, if you were to examine the :yocto_git:`tree view </poky/tree/>` |
| 270 | of the ``poky`` repository, you will see several layers: ``meta``, |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 271 | ``meta-skeleton``, ``meta-selftest``, ``meta-poky``, and |
| 272 | ``meta-yocto-bsp``. Each of these repositories represents a distinct |
| 273 | layer. |
| 274 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 275 | For procedures on how to create layers, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 276 | ":ref:`dev-manual/common-tasks:understanding and creating layers`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 277 | section in the Yocto Project Development Tasks Manual. |
| 278 | |
| 279 | Components and Tools |
| 280 | ==================== |
| 281 | |
| 282 | The Yocto Project employs a collection of components and tools used by |
| 283 | the project itself, by project developers, and by those using the Yocto |
| 284 | Project. These components and tools are open source projects and |
| 285 | metadata that are separate from the reference distribution |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 286 | (:term:`Poky`) and the :term:`OpenEmbedded Build System`. Most of the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 287 | components and tools are downloaded separately. |
| 288 | |
| 289 | This section provides brief overviews of the components and tools |
| 290 | associated with the Yocto Project. |
| 291 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 292 | Development Tools |
| 293 | ----------------- |
| 294 | |
| 295 | The following list consists of tools that help you develop images and |
| 296 | applications using the Yocto Project: |
| 297 | |
| 298 | - *CROPS:* `CROPS <https://github.com/crops/poky-container/>`__ is an |
| 299 | open source, cross-platform development framework that leverages |
| 300 | `Docker Containers <https://www.docker.com/>`__. CROPS provides an |
| 301 | easily managed, extensible environment that allows you to build |
| 302 | binaries for a variety of architectures on Windows, Linux and Mac OS |
| 303 | X hosts. |
| 304 | |
| 305 | - *devtool:* This command-line tool is available as part of the |
| 306 | extensible SDK (eSDK) and is its cornerstone. You can use ``devtool`` |
| 307 | to help build, test, and package software within the eSDK. You can |
| 308 | use the tool to optionally integrate what you build into an image |
| 309 | built by the OpenEmbedded build system. |
| 310 | |
| 311 | The ``devtool`` command employs a number of sub-commands that allow |
| 312 | you to add, modify, and upgrade recipes. As with the OpenEmbedded |
| 313 | build system, "recipes" represent software packages within |
| 314 | ``devtool``. When you use ``devtool add``, a recipe is automatically |
| 315 | created. When you use ``devtool modify``, the specified existing |
| 316 | recipe is used in order to determine where to get the source code and |
| 317 | how to patch it. In both cases, an environment is set up so that when |
| 318 | you build the recipe a source tree that is under your control is used |
| 319 | in order to allow you to make changes to the source as desired. By |
| 320 | default, both new recipes and the source go into a "workspace" |
| 321 | directory under the eSDK. The ``devtool upgrade`` command updates an |
| 322 | existing recipe so that you can build it for an updated set of source |
| 323 | files. |
| 324 | |
| 325 | You can read about the ``devtool`` workflow in the Yocto Project |
| 326 | Application Development and Extensible Software Development Kit |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 327 | (eSDK) Manual in the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 328 | ":ref:`sdk-manual/extensible:using \`\`devtool\`\` in your sdk workflow`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 329 | section. |
| 330 | |
| 331 | - *Extensible Software Development Kit (eSDK):* The eSDK provides a |
| 332 | cross-development toolchain and libraries tailored to the contents of |
| 333 | a specific image. The eSDK makes it easy to add new applications and |
| 334 | libraries to an image, modify the source for an existing component, |
| 335 | test changes on the target hardware, and integrate into the rest of |
| 336 | the OpenEmbedded build system. The eSDK gives you a toolchain |
| 337 | experience supplemented with the powerful set of ``devtool`` commands |
| 338 | tailored for the Yocto Project environment. |
| 339 | |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 340 | For information on the eSDK, see the :doc:`/sdk-manual/index` Manual. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 341 | |
| 342 | - *Toaster:* Toaster is a web interface to the Yocto Project |
| 343 | OpenEmbedded build system. Toaster allows you to configure, run, and |
| 344 | view information about builds. For information on Toaster, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 345 | :doc:`/toaster-manual/index`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 346 | |
| 347 | Production Tools |
| 348 | ---------------- |
| 349 | |
| 350 | The following list consists of tools that help production related |
| 351 | activities using the Yocto Project: |
| 352 | |
| 353 | - *Auto Upgrade Helper:* This utility when used in conjunction with the |
| 354 | :term:`OpenEmbedded Build System` |
| 355 | (BitBake and |
| 356 | OE-Core) automatically generates upgrades for recipes that are based |
| 357 | on new versions of the recipes published upstream. See |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 358 | :ref:`dev-manual/common-tasks:using the auto upgrade helper (auh)` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 359 | for how to set it up. |
| 360 | |
| 361 | - *Recipe Reporting System:* The Recipe Reporting System tracks recipe |
| 362 | versions available for Yocto Project. The main purpose of the system |
| 363 | is to help you manage the recipes you maintain and to offer a dynamic |
| 364 | overview of the project. The Recipe Reporting System is built on top |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 365 | of the :oe_layerindex:`OpenEmbedded Layer Index <>`, which |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 366 | is a website that indexes OpenEmbedded-Core layers. |
| 367 | |
| 368 | - *Patchwork:* `Patchwork <http://jk.ozlabs.org/projects/patchwork/>`__ |
| 369 | is a fork of a project originally started by |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 370 | `OzLabs <https://ozlabs.org/>`__. The project is a web-based tracking |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 371 | system designed to streamline the process of bringing contributions |
| 372 | into a project. The Yocto Project uses Patchwork as an organizational |
| 373 | tool to handle patches, which number in the thousands for every |
| 374 | release. |
| 375 | |
| 376 | - *AutoBuilder:* AutoBuilder is a project that automates build tests |
| 377 | and quality assurance (QA). By using the public AutoBuilder, anyone |
| 378 | can determine the status of the current "master" branch of Poky. |
| 379 | |
| 380 | .. note:: |
| 381 | |
| 382 | AutoBuilder is based on buildbot. |
| 383 | |
| 384 | A goal of the Yocto Project is to lead the open source industry with |
| 385 | a project that automates testing and QA procedures. In doing so, the |
| 386 | project encourages a development community that publishes QA and test |
| 387 | plans, publicly demonstrates QA and test plans, and encourages |
| 388 | development of tools that automate and test and QA procedures for the |
| 389 | benefit of the development community. |
| 390 | |
| 391 | You can learn more about the AutoBuilder used by the Yocto Project |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 392 | Autobuilder :doc:`here </test-manual/understand-autobuilder>`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 393 | |
| 394 | - *Cross-Prelink:* Prelinking is the process of pre-computing the load |
| 395 | addresses and link tables generated by the dynamic linker as compared |
| 396 | to doing this at runtime. Doing this ahead of time results in |
| 397 | performance improvements when the application is launched and reduced |
| 398 | memory usage for libraries shared by many applications. |
| 399 | |
| 400 | Historically, cross-prelink is a variant of prelink, which was |
| 401 | conceived by `Jakub |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 402 | JelÃnek <https://people.redhat.com/jakub/prelink.pdf>`__ a number of |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 403 | years ago. Both prelink and cross-prelink are maintained in the same |
| 404 | repository albeit on separate branches. By providing an emulated |
| 405 | runtime dynamic linker (i.e. ``glibc``-derived ``ld.so`` emulation), |
| 406 | the cross-prelink project extends the prelink software's ability to |
| 407 | prelink a sysroot environment. Additionally, the cross-prelink |
| 408 | software enables the ability to work in sysroot style environments. |
| 409 | |
| 410 | The dynamic linker determines standard load address calculations |
| 411 | based on a variety of factors such as mapping addresses, library |
| 412 | usage, and library function conflicts. The prelink tool uses this |
| 413 | information, from the dynamic linker, to determine unique load |
| 414 | addresses for executable and linkable format (ELF) binaries that are |
| 415 | shared libraries and dynamically linked. The prelink tool modifies |
| 416 | these ELF binaries with the pre-computed information. The result is |
| 417 | faster loading and often lower memory consumption because more of the |
| 418 | library code can be re-used from shared Copy-On-Write (COW) pages. |
| 419 | |
| 420 | The original upstream prelink project only supports running prelink |
| 421 | on the end target device due to the reliance on the target device's |
| 422 | dynamic linker. This restriction causes issues when developing a |
| 423 | cross-compiled system. The cross-prelink adds a synthesized dynamic |
| 424 | loader that runs on the host, thus permitting cross-prelinking |
| 425 | without ever having to run on a read-write target filesystem. |
| 426 | |
| 427 | - *Pseudo:* Pseudo is the Yocto Project implementation of |
| 428 | `fakeroot <http://man.he.net/man1/fakeroot>`__, which is used to run |
| 429 | commands in an environment that seemingly has root privileges. |
| 430 | |
| 431 | During a build, it can be necessary to perform operations that |
| 432 | require system administrator privileges. For example, file ownership |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 433 | or permissions might need to be defined. Pseudo is a tool that you |
| 434 | can either use directly or through the environment variable |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 435 | ``LD_PRELOAD``. Either method allows these operations to succeed as |
| 436 | if system administrator privileges exist even when they do not. |
| 437 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 438 | Thanks to Pseudo, the Yocto Project never needs root privileges to |
| 439 | build images for your target system. |
| 440 | |
| 441 | You can read more about Pseudo in the |
| 442 | ":ref:`overview-manual/concepts:fakeroot and pseudo`" section. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 443 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 444 | Open-Embedded Build System Components |
| 445 | ------------------------------------- |
| 446 | |
| 447 | The following list consists of components associated with the |
| 448 | :term:`OpenEmbedded Build System`: |
| 449 | |
| 450 | - *BitBake:* BitBake is a core component of the Yocto Project and is |
| 451 | used by the OpenEmbedded build system to build images. While BitBake |
| 452 | is key to the build system, BitBake is maintained separately from the |
| 453 | Yocto Project. |
| 454 | |
| 455 | BitBake is a generic task execution engine that allows shell and |
| 456 | Python tasks to be run efficiently and in parallel while working |
| 457 | within complex inter-task dependency constraints. In short, BitBake |
| 458 | is a build engine that works through recipes written in a specific |
| 459 | format in order to perform sets of tasks. |
| 460 | |
| 461 | You can learn more about BitBake in the :doc:`BitBake User |
| 462 | Manual <bitbake:index>`. |
| 463 | |
| 464 | - *OpenEmbedded-Core:* OpenEmbedded-Core (OE-Core) is a common layer of |
| 465 | metadata (i.e. recipes, classes, and associated files) used by |
| 466 | OpenEmbedded-derived systems, which includes the Yocto Project. The |
| 467 | Yocto Project and the OpenEmbedded Project both maintain the |
| 468 | OpenEmbedded-Core. You can find the OE-Core metadata in the Yocto |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 469 | Project :yocto_git:`Source Repositories </poky/tree/meta>`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 470 | |
| 471 | Historically, the Yocto Project integrated the OE-Core metadata |
| 472 | throughout the Yocto Project source repository reference system |
| 473 | (Poky). After Yocto Project Version 1.0, the Yocto Project and |
| 474 | OpenEmbedded agreed to work together and share a common core set of |
| 475 | metadata (OE-Core), which contained much of the functionality |
| 476 | previously found in Poky. This collaboration achieved a long-standing |
| 477 | OpenEmbedded objective for having a more tightly controlled and |
| 478 | quality-assured core. The results also fit well with the Yocto |
| 479 | Project objective of achieving a smaller number of fully featured |
| 480 | tools as compared to many different ones. |
| 481 | |
| 482 | Sharing a core set of metadata results in Poky as an integration |
| 483 | layer on top of OE-Core. You can see that in this |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 484 | :ref:`figure <overview-manual/yp-intro:what is the yocto project?>`. |
| 485 | The Yocto Project combines various components such as BitBake, OE-Core, |
| 486 | script "glue", and documentation for its build system. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 487 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 488 | Reference Distribution (Poky) |
| 489 | ----------------------------- |
| 490 | |
| 491 | Poky is the Yocto Project reference distribution. It contains the |
| 492 | :term:`OpenEmbedded Build System` |
| 493 | (BitBake and OE-Core) as well as a set of metadata to get you started |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 494 | building your own distribution. See the figure in |
| 495 | ":ref:`overview-manual/yp-intro:what is the yocto project?`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 496 | section for an illustration that shows Poky and its relationship with |
| 497 | other parts of the Yocto Project. |
| 498 | |
| 499 | To use the Yocto Project tools and components, you can download |
| 500 | (``clone``) Poky and use it to bootstrap your own distribution. |
| 501 | |
| 502 | .. note:: |
| 503 | |
| 504 | Poky does not contain binary files. It is a working example of how to |
| 505 | build your own custom Linux distribution from source. |
| 506 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 507 | You can read more about Poky in the |
| 508 | ":ref:`overview-manual/yp-intro:reference embedded distribution (poky)`" |
| 509 | section. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 510 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 511 | Packages for Finished Targets |
| 512 | ----------------------------- |
| 513 | |
| 514 | The following lists components associated with packages for finished |
| 515 | targets: |
| 516 | |
| 517 | - *Matchbox:* Matchbox is an Open Source, base environment for the X |
| 518 | Window System running on non-desktop, embedded platforms such as |
| 519 | handhelds, set-top boxes, kiosks, and anything else for which screen |
| 520 | space, input mechanisms, or system resources are limited. |
| 521 | |
| 522 | Matchbox consists of a number of interchangeable and optional |
| 523 | applications that you can tailor to a specific, non-desktop platform |
| 524 | to enhance usability in constrained environments. |
| 525 | |
| 526 | You can find the Matchbox source in the Yocto Project |
| 527 | :yocto_git:`Source Repositories <>`. |
| 528 | |
| 529 | - *Opkg:* Open PacKaGe management (opkg) is a lightweight package |
| 530 | management system based on the itsy package (ipkg) management system. |
| 531 | Opkg is written in C and resembles Advanced Package Tool (APT) and |
| 532 | Debian Package (dpkg) in operation. |
| 533 | |
| 534 | Opkg is intended for use on embedded Linux devices and is used in |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 535 | this capacity in the :oe_home:`OpenEmbedded <>` and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 536 | `OpenWrt <https://openwrt.org/>`__ projects, as well as the Yocto |
| 537 | Project. |
| 538 | |
| 539 | .. note:: |
| 540 | |
| 541 | As best it can, opkg maintains backwards compatibility with ipkg |
| 542 | and conforms to a subset of Debian's policy manual regarding |
| 543 | control files. |
| 544 | |
| 545 | You can find the opkg source in the Yocto Project |
| 546 | :yocto_git:`Source Repositories <>`. |
| 547 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 548 | Archived Components |
| 549 | ------------------- |
| 550 | |
| 551 | The Build Appliance is a virtual machine image that enables you to build |
| 552 | and boot a custom embedded Linux image with the Yocto Project using a |
| 553 | non-Linux development system. |
| 554 | |
| 555 | Historically, the Build Appliance was the second of three methods by |
| 556 | which you could use the Yocto Project on a system that was not native to |
| 557 | Linux. |
| 558 | |
| 559 | 1. *Hob:* Hob, which is now deprecated and is no longer available since |
| 560 | the 2.1 release of the Yocto Project provided a rudimentary, |
| 561 | GUI-based interface to the Yocto Project. Toaster has fully replaced |
| 562 | Hob. |
| 563 | |
| 564 | 2. *Build Appliance:* Post Hob, the Build Appliance became available. It |
| 565 | was never recommended that you use the Build Appliance as a |
| 566 | day-to-day production development environment with the Yocto Project. |
| 567 | Build Appliance was useful as a way to try out development in the |
| 568 | Yocto Project environment. |
| 569 | |
| 570 | 3. *CROPS:* The final and best solution available now for developing |
| 571 | using the Yocto Project on a system not native to Linux is with |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 572 | :ref:`CROPS <overview-manual/yp-intro:development tools>`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 573 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 574 | Development Methods |
| 575 | =================== |
| 576 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 577 | The Yocto Project development environment usually involves a |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 578 | :term:`Build Host` and target |
| 579 | hardware. You use the Build Host to build images and develop |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 580 | applications, while you use the target hardware to execute deployed |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 581 | software. |
| 582 | |
| 583 | This section provides an introduction to the choices or development |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 584 | methods you have when setting up your Build Host. Depending on your |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 585 | particular workflow preference and the type of operating system your |
| 586 | Build Host runs, several choices exist that allow you to use the Yocto |
| 587 | Project. |
| 588 | |
| 589 | .. note:: |
| 590 | |
| 591 | For additional detail about the Yocto Project development |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 592 | environment, see the ":doc:`/overview-manual/development-environment`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 593 | chapter. |
| 594 | |
| 595 | - *Native Linux Host:* By far the best option for a Build Host. A |
| 596 | system running Linux as its native operating system allows you to |
| 597 | develop software by directly using the |
| 598 | :term:`BitBake` tool. You can |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 599 | accomplish all aspects of development from a regular shell in a |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 600 | supported Linux distribution. |
| 601 | |
| 602 | For information on how to set up a Build Host on a system running |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 603 | Linux as its native operating system, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 604 | ":ref:`dev-manual/start:setting up a native linux host`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 605 | section in the Yocto Project Development Tasks Manual. |
| 606 | |
| 607 | - *CROss PlatformS (CROPS):* Typically, you use |
| 608 | `CROPS <https://github.com/crops/poky-container/>`__, which leverages |
| 609 | `Docker Containers <https://www.docker.com/>`__, to set up a Build |
| 610 | Host that is not running Linux (e.g. Microsoft Windows or macOS). |
| 611 | |
| 612 | .. note:: |
| 613 | |
| 614 | You can, however, use CROPS on a Linux-based system. |
| 615 | |
| 616 | CROPS is an open source, cross-platform development framework that |
| 617 | provides an easily managed, extensible environment for building |
| 618 | binaries targeted for a variety of architectures on Windows, macOS, |
| 619 | or Linux hosts. Once the Build Host is set up using CROPS, you can |
| 620 | prepare a shell environment to mimic that of a shell being used on a |
| 621 | system natively running Linux. |
| 622 | |
| 623 | For information on how to set up a Build Host with CROPS, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 624 | ":ref:`dev-manual/start:setting up to use cross platforms (crops)`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 625 | section in the Yocto Project Development Tasks Manual. |
| 626 | |
| 627 | - *Windows Subsystem For Linux (WSLv2):* You may use Windows Subsystem |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 628 | For Linux v2 to set up a Build Host using Windows 10. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 629 | |
| 630 | .. note:: |
| 631 | |
| 632 | The Yocto Project is not compatible with WSLv1, it is compatible |
| 633 | but not officially supported nor validated with WSLv2, if you |
| 634 | still decide to use WSL please upgrade to WSLv2. |
| 635 | |
| 636 | The Windows Subsystem For Linux allows Windows 10 to run a real Linux |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 637 | kernel inside of a lightweight virtual machine (VM). |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 638 | |
| 639 | For information on how to set up a Build Host with WSLv2, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 640 | ":ref:`dev-manual/start:setting up to use windows subsystem for linux (wslv2)`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 641 | section in the Yocto Project Development Tasks Manual. |
| 642 | |
| 643 | - *Toaster:* Regardless of what your Build Host is running, you can use |
| 644 | Toaster to develop software using the Yocto Project. Toaster is a web |
| 645 | interface to the Yocto Project's :term:`OpenEmbedded Build System`. |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 646 | The interface allows you to configure and run your builds. Information |
| 647 | about builds is collected and stored in a database. You can use Toaster |
| 648 | to configure and start builds on multiple remote build servers. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 649 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 650 | For information about and how to use Toaster, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 651 | :doc:`/toaster-manual/index`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 652 | |
| 653 | Reference Embedded Distribution (Poky) |
| 654 | ====================================== |
| 655 | |
| 656 | "Poky", which is pronounced *Pock*-ee, is the name of the Yocto |
| 657 | Project's reference distribution or Reference OS Kit. Poky contains the |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 658 | :term:`OpenEmbedded Build System` (:term:`BitBake` and |
| 659 | :term:`OpenEmbedded-Core (OE-Core)`) as well as a set of |
| 660 | :term:`Metadata` to get you started building your own distro. In other |
| 661 | words, Poky is a base specification of the functionality needed for a |
| 662 | typical embedded system as well as the components from the Yocto Project |
| 663 | that allow you to build a distribution into a usable binary image. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 664 | |
| 665 | Poky is a combined repository of BitBake, OpenEmbedded-Core (which is |
| 666 | found in ``meta``), ``meta-poky``, ``meta-yocto-bsp``, and documentation |
| 667 | provided all together and known to work well together. You can view |
| 668 | these items that make up the Poky repository in the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 669 | :yocto_git:`Source Repositories </poky/tree/>`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 670 | |
| 671 | .. note:: |
| 672 | |
| 673 | If you are interested in all the contents of the |
| 674 | poky |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 675 | Git repository, see the ":ref:`ref-manual/structure:top-level core components`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 676 | section in the Yocto Project Reference Manual. |
| 677 | |
| 678 | The following figure illustrates what generally comprises Poky: |
| 679 | |
| 680 | .. image:: figures/poky-reference-distribution.png |
| 681 | :align: center |
| 682 | |
| 683 | - BitBake is a task executor and scheduler that is the heart of the |
| 684 | OpenEmbedded build system. |
| 685 | |
| 686 | - ``meta-poky``, which is Poky-specific metadata. |
| 687 | |
| 688 | - ``meta-yocto-bsp``, which are Yocto Project-specific Board Support |
| 689 | Packages (BSPs). |
| 690 | |
| 691 | - OpenEmbedded-Core (OE-Core) metadata, which includes shared |
| 692 | configurations, global variable definitions, shared classes, |
| 693 | packaging, and recipes. Classes define the encapsulation and |
| 694 | inheritance of build logic. Recipes are the logical units of software |
| 695 | and images to be built. |
| 696 | |
| 697 | - Documentation, which contains the Yocto Project source files used to |
| 698 | make the set of user manuals. |
| 699 | |
| 700 | .. note:: |
| 701 | |
| 702 | While Poky is a "complete" distribution specification and is tested |
| 703 | and put through QA, you cannot use it as a product "out of the box" |
| 704 | in its current form. |
| 705 | |
| 706 | To use the Yocto Project tools, you can use Git to clone (download) the |
| 707 | Poky repository then use your local copy of the reference distribution |
| 708 | to bootstrap your own distribution. |
| 709 | |
| 710 | .. note:: |
| 711 | |
| 712 | Poky does not contain binary files. It is a working example of how to |
| 713 | build your own custom Linux distribution from source. |
| 714 | |
| 715 | Poky has a regular, well established, six-month release cycle under its |
| 716 | own version. Major releases occur at the same time major releases (point |
| 717 | releases) occur for the Yocto Project, which are typically in the Spring |
| 718 | and Fall. For more information on the Yocto Project release schedule and |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 719 | cadence, see the ":doc:`/ref-manual/release-process`" chapter in the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 720 | Yocto Project Reference Manual. |
| 721 | |
| 722 | Much has been said about Poky being a "default configuration". A default |
| 723 | configuration provides a starting image footprint. You can use Poky out |
| 724 | of the box to create an image ranging from a shell-accessible minimal |
| 725 | image all the way up to a Linux Standard Base-compliant image that uses |
| 726 | a GNOME Mobile and Embedded (GMAE) based reference user interface called |
| 727 | Sato. |
| 728 | |
| 729 | One of the most powerful properties of Poky is that every aspect of a |
| 730 | build is controlled by the metadata. You can use metadata to augment |
| 731 | these base image types by adding metadata |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 732 | `layers <overview-manual/yp-intro:the yocto project layer model>` that extend |
| 733 | functionality. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 734 | These layers can provide, for example, an additional software stack for |
| 735 | an image type, add a board support package (BSP) for additional |
| 736 | hardware, or even create a new image type. |
| 737 | |
| 738 | Metadata is loosely grouped into configuration files or package recipes. |
| 739 | A recipe is a collection of non-executable metadata used by BitBake to |
| 740 | set variables or define additional build-time tasks. A recipe contains |
| 741 | fields such as the recipe description, the recipe version, the license |
| 742 | of the package and the upstream source repository. A recipe might also |
| 743 | indicate that the build process uses autotools, make, distutils or any |
| 744 | other build process, in which case the basic functionality can be |
| 745 | defined by the classes it inherits from the OE-Core layer's class |
| 746 | definitions in ``./meta/classes``. Within a recipe you can also define |
| 747 | additional tasks as well as task prerequisites. Recipe syntax through |
| 748 | BitBake also supports both ``_prepend`` and ``_append`` operators as a |
| 749 | method of extending task functionality. These operators inject code into |
| 750 | the beginning or end of a task. For information on these BitBake |
| 751 | operators, see the |
| 752 | ":ref:`bitbake:bitbake-user-manual/bitbake-user-manual-metadata:appending and prepending (override style syntax)`" |
| 753 | section in the BitBake User's Manual. |
| 754 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 755 | The OpenEmbedded Build System Workflow |
| 756 | ====================================== |
| 757 | |
| 758 | The :term:`OpenEmbedded Build System` uses a "workflow" to |
| 759 | accomplish image and SDK generation. The following figure overviews that |
| 760 | workflow: |
| 761 | |
| 762 | .. image:: figures/YP-flow-diagram.png |
| 763 | :align: center |
| 764 | |
| 765 | Following is a brief summary of the "workflow": |
| 766 | |
| 767 | 1. Developers specify architecture, policies, patches and configuration |
| 768 | details. |
| 769 | |
| 770 | 2. The build system fetches and downloads the source code from the |
| 771 | specified location. The build system supports standard methods such |
| 772 | as tarballs or source code repositories systems such as Git. |
| 773 | |
| 774 | 3. Once source code is downloaded, the build system extracts the sources |
| 775 | into a local work area where patches are applied and common steps for |
| 776 | configuring and compiling the software are run. |
| 777 | |
| 778 | 4. The build system then installs the software into a temporary staging |
| 779 | area where the binary package format you select (DEB, RPM, or IPK) is |
| 780 | used to roll up the software. |
| 781 | |
| 782 | 5. Different QA and sanity checks run throughout entire build process. |
| 783 | |
| 784 | 6. After the binaries are created, the build system generates a binary |
| 785 | package feed that is used to create the final root file image. |
| 786 | |
| 787 | 7. The build system generates the file system image and a customized |
| 788 | Extensible SDK (eSDK) for application development in parallel. |
| 789 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 790 | For a very detailed look at this workflow, see the |
| 791 | ":ref:`overview-manual/concepts:openembedded build system concepts`" section. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 792 | |
| 793 | Some Basic Terms |
| 794 | ================ |
| 795 | |
| 796 | It helps to understand some basic fundamental terms when learning the |
| 797 | Yocto Project. Although a list of terms exists in the ":doc:`Yocto Project |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 798 | Terms </ref-manual/terms>`" section of the Yocto Project |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 799 | Reference Manual, this section provides the definitions of some terms |
| 800 | helpful for getting started: |
| 801 | |
| 802 | - *Configuration Files:* Files that hold global definitions of |
| 803 | variables, user-defined variables, and hardware configuration |
| 804 | information. These files tell the :term:`OpenEmbedded Build System` |
| 805 | what to build and |
| 806 | what to put into the image to support a particular platform. |
| 807 | |
| 808 | - *Extensible Software Development Kit (eSDK):* A custom SDK for |
| 809 | application developers. This eSDK allows developers to incorporate |
| 810 | their library and programming changes back into the image to make |
| 811 | their code available to other application developers. For information |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 812 | on the eSDK, see the :doc:`/sdk-manual/index` manual. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 813 | |
| 814 | - *Layer:* A collection of related recipes. Layers allow you to |
| 815 | consolidate related metadata to customize your build. Layers also |
| 816 | isolate information used when building for multiple architectures. |
| 817 | Layers are hierarchical in their ability to override previous |
| 818 | specifications. You can include any number of available layers from |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 819 | the Yocto Project and customize the build by adding your own layers |
| 820 | after them. You can search the Layer Index for layers used within |
| 821 | Yocto Project. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 822 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 823 | For more detailed information on layers, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 824 | ":ref:`dev-manual/common-tasks:understanding and creating layers`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 825 | section in the Yocto Project Development Tasks Manual. For a |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 826 | discussion specifically on BSP Layers, see the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 827 | ":ref:`bsp-guide/bsp:bsp layers`" section in the Yocto |
| 828 | Project Board Support Packages (BSP) Developer's Guide. |
| 829 | |
| 830 | - *Metadata:* A key element of the Yocto Project is the Metadata that |
| 831 | is used to construct a Linux distribution and is contained in the |
| 832 | files that the OpenEmbedded build system parses when building an |
| 833 | image. In general, Metadata includes recipes, configuration files, |
| 834 | and other information that refers to the build instructions |
| 835 | themselves, as well as the data used to control what things get built |
| 836 | and the effects of the build. Metadata also includes commands and |
| 837 | data used to indicate what versions of software are used, from where |
| 838 | they are obtained, and changes or additions to the software itself |
| 839 | (patches or auxiliary files) that are used to fix bugs or customize |
| 840 | the software for use in a particular situation. OpenEmbedded-Core is |
| 841 | an important set of validated metadata. |
| 842 | |
| 843 | - *OpenEmbedded Build System:* The terms "BitBake" and "build system" |
| 844 | are sometimes used for the OpenEmbedded Build System. |
| 845 | |
| 846 | BitBake is a task scheduler and execution engine that parses |
| 847 | instructions (i.e. recipes) and configuration data. After a parsing |
| 848 | phase, BitBake creates a dependency tree to order the compilation, |
| 849 | schedules the compilation of the included code, and finally executes |
| 850 | the building of the specified custom Linux image (distribution). |
| 851 | BitBake is similar to the ``make`` tool. |
| 852 | |
| 853 | During a build process, the build system tracks dependencies and |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 854 | performs a native or cross-compilation of each package. As a first |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 855 | step in a cross-build setup, the framework attempts to create a |
| 856 | cross-compiler toolchain (i.e. Extensible SDK) suited for the target |
| 857 | platform. |
| 858 | |
| 859 | - *OpenEmbedded-Core (OE-Core):* OE-Core is metadata comprised of |
| 860 | foundation recipes, classes, and associated files that are meant to |
| 861 | be common among many different OpenEmbedded-derived systems, |
| 862 | including the Yocto Project. OE-Core is a curated subset of an |
| 863 | original repository developed by the OpenEmbedded community that has |
| 864 | been pared down into a smaller, core set of continuously validated |
| 865 | recipes. The result is a tightly controlled and quality-assured core |
| 866 | set of recipes. |
| 867 | |
| 868 | You can see the Metadata in the ``meta`` directory of the Yocto |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 869 | Project :yocto_git:`Source Repositories <>`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 870 | |
| 871 | - *Packages:* In the context of the Yocto Project, this term refers to |
| 872 | a recipe's packaged output produced by BitBake (i.e. a "baked |
| 873 | recipe"). A package is generally the compiled binaries produced from |
| 874 | the recipe's sources. You "bake" something by running it through |
| 875 | BitBake. |
| 876 | |
| 877 | It is worth noting that the term "package" can, in general, have |
| 878 | subtle meanings. For example, the packages referred to in the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 879 | ":ref:`ref-manual/system-requirements:required packages for the build host`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 880 | section in the Yocto Project Reference Manual are compiled binaries |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 881 | that, when installed, add functionality to your host Linux |
| 882 | distribution. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 883 | |
| 884 | Another point worth noting is that historically within the Yocto |
| 885 | Project, recipes were referred to as packages - thus, the existence |
| 886 | of several BitBake variables that are seemingly mis-named, (e.g. |
| 887 | :term:`PR`, |
| 888 | :term:`PV`, and |
| 889 | :term:`PE`). |
| 890 | |
| 891 | - *Poky:* Poky is a reference embedded distribution and a reference |
| 892 | test configuration. Poky provides the following: |
| 893 | |
| 894 | - A base-level functional distro used to illustrate how to customize |
| 895 | a distribution. |
| 896 | |
| 897 | - A means by which to test the Yocto Project components (i.e. Poky |
| 898 | is used to validate the Yocto Project). |
| 899 | |
| 900 | - A vehicle through which you can download the Yocto Project. |
| 901 | |
| 902 | Poky is not a product level distro. Rather, it is a good starting |
| 903 | point for customization. |
| 904 | |
| 905 | .. note:: |
| 906 | |
| 907 | Poky is an integration layer on top of OE-Core. |
| 908 | |
| 909 | - *Recipe:* The most common form of metadata. A recipe contains a list |
| 910 | of settings and tasks (i.e. instructions) for building packages that |
| 911 | are then used to build the binary image. A recipe describes where you |
| 912 | get source code and which patches to apply. Recipes describe |
| 913 | dependencies for libraries or for other recipes as well as |
| 914 | configuration and compilation options. Related recipes are |
| 915 | consolidated into a layer. |