blob: fca02e4cec2e1bdcedb4add6b4e1a05a0c93a55d [file] [log] [blame]
Andrew Geisslerf0343792020-11-18 10:42:21 -06001.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002
3*****************************
4Introducing the Yocto Project
5*****************************
6
7What is the Yocto Project?
8==========================
9
10The Yocto Project is an open source collaboration project that helps
11developers create custom Linux-based systems that are designed for
12embedded products regardless of the product's hardware architecture.
13Yocto Project provides a flexible toolset and a development environment
14that allows embedded device developers across the world to collaborate
15through shared technologies, software stacks, configurations, and best
16practices used to create these tailored Linux images.
17
18Thousands of developers worldwide have discovered that Yocto Project
19provides advantages in both systems and applications development,
20archival and management benefits, and customizations used for speed,
21footprint, and memory utilization. The project is a standard when it
22comes to delivering embedded software stacks. The project allows
23software customizations and build interchange for multiple hardware
24platforms as well as software stacks that can be maintained and scaled.
25
26.. image:: figures/key-dev-elements.png
27 :align: center
28
29For further introductory information on the Yocto Project, you might be
30interested in this
31`article <https://www.embedded.com/electronics-blogs/say-what-/4458600/Why-the-Yocto-Project-for-my-IoT-Project->`__
32by Drew Moseley and in this short introductory
33`video <https://www.youtube.com/watch?v=utZpKM7i5Z4>`__.
34
35The remainder of this section overviews advantages and challenges tied
36to the Yocto Project.
37
Andrew Geisslerc9f78652020-09-18 14:11:35 -050038Features
39--------
40
41The following list describes features and advantages of the Yocto
42Project:
43
Andrew Geissler3b8a17c2021-04-15 15:55:55 -050044- *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 Geisslerc9f78652020-09-18 14:11:35 -050047 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 Geissler3b8a17c2021-04-15 15:55:55 -050056 Aside from broad architecture support, the Yocto Project fully
57 supports a wide range of devices emulated by the Quick EMUlator
Andrew Geisslerc9f78652020-09-18 14:11:35 -050058 (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 Geissler3b8a17c2021-04-15 15:55:55 -050081 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 Geisslerc9f78652020-09-18 14:11:35 -050085
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 Geissler3b8a17c2021-04-15 15:55:55 -050099- *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 Geisslerc9f78652020-09-18 14:11:35 -0500103 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 Geissler3b8a17c2021-04-15 15:55:55 -0500109 :ref:`overview-manual/concepts:shared state cache` (sstate) scheme.
110 Being able to build and debug components individually eases project
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500111 development.
112
113- *Releases According to a Strict Schedule:* Major releases occur on a
Andrew Geissler09209ee2020-12-13 08:44:15 -0600114 :doc:`six-month cycle </ref-manual/release-process>`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500115 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 Geissler09209ee2020-12-13 08:44:15 -0600133 manifest <dev-manual/common-tasks:maintaining open source license compliance during your product's lifecycle>`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500134 for review by people who need to track the use of open source
135 licenses (e.g. legal teams).
136
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500137Challenges
138----------
139
140The following list presents challenges you might encounter when
141developing 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 Geissler3b8a17c2021-04-15 15:55:55 -0500158 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 Geisslerc9f78652020-09-18 14:11:35 -0500161 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
193The Yocto Project Layer Model
194=============================
195
196The Yocto Project's "Layer Model" is a development model for embedded
197and IoT Linux creation that distinguishes the Yocto Project from other
198simple build systems. The Layer Model simultaneously supports
199collaboration and customization. Layers are repositories that contain
200related sets of instructions that tell the :term:`OpenEmbedded Build System`
201what to do. You can
202collaborate, share, and reuse layers.
203
204Layers can contain changes to previous instructions or settings at any
205time. This powerful override capability is what allows you to customize
206previously supplied collaborative or community layers to suit your
207product requirements.
208
209You use different layers to logically separate information in your
210build. As an example, you could have BSP, GUI, distro configuration,
211middleware, or application layers. Putting your entire build into one
212layer limits and complicates future customization and reuse. Isolating
213information into layers, on the other hand, helps simplify future
214customizations and reuse. You might find it tempting to keep everything
215in one layer when working on a single project. However, the more modular
216your 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 Geisslerc3d88e42020-10-02 09:45:00 -0500224 index <https://www.yoctoproject.org/software-overview/layers/>`__
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600225 or the :oe_layerindex:`OpenEmbedded layer index <>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500226 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 Geissler09209ee2020-12-13 08:44:15 -0600231 Compatible <dev-manual/common-tasks:making sure your layer is compatible with yocto project>`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500232 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
238To illustrate how layers are used to keep things modular, consider
239machine customizations. These types of customizations typically reside
240in a special layer, rather than a general layer, called a BSP Layer.
241Furthermore, the machine customizations should be isolated from recipes
242and Metadata that support a new GUI environment, for example. This
243situation gives you a couple of layers: one for the machine
244configurations, and one for the GUI environment. It is important to
245understand, however, that the BSP layer can still make machine-specific
246additions to recipes within the GUI environment layer without polluting
247the GUI layer itself with those machine-specific changes. You can
248accomplish 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 Geissler09209ee2020-12-13 08:44:15 -0600254 :doc:`/bsp-guide/index`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500255 .
256
257The :term:`Source Directory`
258contains both general layers and BSP layers right out of the box. You
259can easily identify layers that ship with a Yocto Project release in the
260Source Directory by their names. Layers typically have names that begin
261with the string ``meta-``.
262
263.. note::
264
265 It is not a requirement that a layer name begin with the prefix
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500266 ``meta-``, but it is a commonly accepted standard in the Yocto Project
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500267 community.
268
Andrew Geissler09209ee2020-12-13 08:44:15 -0600269For example, if you were to examine the :yocto_git:`tree view </poky/tree/>`
270of the ``poky`` repository, you will see several layers: ``meta``,
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500271``meta-skeleton``, ``meta-selftest``, ``meta-poky``, and
272``meta-yocto-bsp``. Each of these repositories represents a distinct
273layer.
274
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500275For procedures on how to create layers, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600276":ref:`dev-manual/common-tasks:understanding and creating layers`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500277section in the Yocto Project Development Tasks Manual.
278
279Components and Tools
280====================
281
282The Yocto Project employs a collection of components and tools used by
283the project itself, by project developers, and by those using the Yocto
284Project. These components and tools are open source projects and
285metadata that are separate from the reference distribution
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500286(:term:`Poky`) and the :term:`OpenEmbedded Build System`. Most of the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500287components and tools are downloaded separately.
288
289This section provides brief overviews of the components and tools
290associated with the Yocto Project.
291
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500292Development Tools
293-----------------
294
295The following list consists of tools that help you develop images and
296applications 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 Geissler3b8a17c2021-04-15 15:55:55 -0500327 (eSDK) Manual in the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600328 ":ref:`sdk-manual/extensible:using \`\`devtool\`\` in your sdk workflow`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500329 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 Geissler09209ee2020-12-13 08:44:15 -0600340 For information on the eSDK, see the :doc:`/sdk-manual/index` Manual.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500341
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 Geissler09209ee2020-12-13 08:44:15 -0600345 :doc:`/toaster-manual/index`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500346
347Production Tools
348----------------
349
350The following list consists of tools that help production related
351activities 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 Geissler09209ee2020-12-13 08:44:15 -0600358 :ref:`dev-manual/common-tasks:using the auto upgrade helper (auh)`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500359 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 Geisslerd1e89492021-02-12 15:35:20 -0600365 of the :oe_layerindex:`OpenEmbedded Layer Index <>`, which
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500366 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 Geisslerd1e89492021-02-12 15:35:20 -0600370 `OzLabs <https://ozlabs.org/>`__. The project is a web-based tracking
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500371 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 Geissler09209ee2020-12-13 08:44:15 -0600392 Autobuilder :doc:`here </test-manual/understand-autobuilder>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500393
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 Geisslerd1e89492021-02-12 15:35:20 -0600402 Jelínek <https://people.redhat.com/jakub/prelink.pdf>`__ a number of
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500403 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 Geissler3b8a17c2021-04-15 15:55:55 -0500433 or permissions might need to be defined. Pseudo is a tool that you
434 can either use directly or through the environment variable
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500435 ``LD_PRELOAD``. Either method allows these operations to succeed as
436 if system administrator privileges exist even when they do not.
437
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500438 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 Geisslerc9f78652020-09-18 14:11:35 -0500443
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500444Open-Embedded Build System Components
445-------------------------------------
446
447The 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 Geissler09209ee2020-12-13 08:44:15 -0600469 Project :yocto_git:`Source Repositories </poky/tree/meta>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500470
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 Geissler3b8a17c2021-04-15 15:55:55 -0500484 :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 Geisslerc9f78652020-09-18 14:11:35 -0500487
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500488Reference Distribution (Poky)
489-----------------------------
490
491Poky 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 Geissler3b8a17c2021-04-15 15:55:55 -0500494building your own distribution. See the figure in
495":ref:`overview-manual/yp-intro:what is the yocto project?`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500496section for an illustration that shows Poky and its relationship with
497other parts of the Yocto Project.
498
499To 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 Geissler3b8a17c2021-04-15 15:55:55 -0500507You can read more about Poky in the
508":ref:`overview-manual/yp-intro:reference embedded distribution (poky)`"
509section.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500510
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500511Packages for Finished Targets
512-----------------------------
513
514The following lists components associated with packages for finished
515targets:
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 Geisslerd1e89492021-02-12 15:35:20 -0600535 this capacity in the :oe_home:`OpenEmbedded <>` and
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500536 `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 Geisslerc9f78652020-09-18 14:11:35 -0500548Archived Components
549-------------------
550
551The Build Appliance is a virtual machine image that enables you to build
552and boot a custom embedded Linux image with the Yocto Project using a
553non-Linux development system.
554
555Historically, the Build Appliance was the second of three methods by
556which you could use the Yocto Project on a system that was not native to
557Linux.
558
5591. *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
5642. *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
5703. *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 Geissler3b8a17c2021-04-15 15:55:55 -0500572 :ref:`CROPS <overview-manual/yp-intro:development tools>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500573
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500574Development Methods
575===================
576
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500577The Yocto Project development environment usually involves a
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500578:term:`Build Host` and target
579hardware. You use the Build Host to build images and develop
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500580applications, while you use the target hardware to execute deployed
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500581software.
582
583This section provides an introduction to the choices or development
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500584methods you have when setting up your Build Host. Depending on your
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500585particular workflow preference and the type of operating system your
586Build Host runs, several choices exist that allow you to use the Yocto
587Project.
588
589.. note::
590
591 For additional detail about the Yocto Project development
Andrew Geissler09209ee2020-12-13 08:44:15 -0600592 environment, see the ":doc:`/overview-manual/development-environment`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500593 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 Geissler3b8a17c2021-04-15 15:55:55 -0500599 accomplish all aspects of development from a regular shell in a
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500600 supported Linux distribution.
601
602 For information on how to set up a Build Host on a system running
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500603 Linux as its native operating system, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600604 ":ref:`dev-manual/start:setting up a native linux host`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500605 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 Geissler09209ee2020-12-13 08:44:15 -0600624 ":ref:`dev-manual/start:setting up to use cross platforms (crops)`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500625 section in the Yocto Project Development Tasks Manual.
626
627- *Windows Subsystem For Linux (WSLv2):* You may use Windows Subsystem
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500628 For Linux v2 to set up a Build Host using Windows 10.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500629
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 Geissler3b8a17c2021-04-15 15:55:55 -0500637 kernel inside of a lightweight virtual machine (VM).
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500638
639 For information on how to set up a Build Host with WSLv2, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600640 ":ref:`dev-manual/start:setting up to use windows subsystem for linux (wslv2)`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500641 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 Geissler3b8a17c2021-04-15 15:55:55 -0500646 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 Geisslerc9f78652020-09-18 14:11:35 -0500649
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500650 For information about and how to use Toaster, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600651 :doc:`/toaster-manual/index`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500652
653Reference Embedded Distribution (Poky)
654======================================
655
656"Poky", which is pronounced *Pock*-ee, is the name of the Yocto
657Project's reference distribution or Reference OS Kit. Poky contains the
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500658: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
661words, Poky is a base specification of the functionality needed for a
662typical embedded system as well as the components from the Yocto Project
663that allow you to build a distribution into a usable binary image.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500664
665Poky is a combined repository of BitBake, OpenEmbedded-Core (which is
666found in ``meta``), ``meta-poky``, ``meta-yocto-bsp``, and documentation
667provided all together and known to work well together. You can view
668these items that make up the Poky repository in the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600669:yocto_git:`Source Repositories </poky/tree/>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500670
671.. note::
672
673 If you are interested in all the contents of the
674 poky
Andrew Geissler09209ee2020-12-13 08:44:15 -0600675 Git repository, see the ":ref:`ref-manual/structure:top-level core components`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500676 section in the Yocto Project Reference Manual.
677
678The 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
706To use the Yocto Project tools, you can use Git to clone (download) the
707Poky repository then use your local copy of the reference distribution
708to 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
715Poky has a regular, well established, six-month release cycle under its
716own version. Major releases occur at the same time major releases (point
717releases) occur for the Yocto Project, which are typically in the Spring
718and Fall. For more information on the Yocto Project release schedule and
Andrew Geissler09209ee2020-12-13 08:44:15 -0600719cadence, see the ":doc:`/ref-manual/release-process`" chapter in the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500720Yocto Project Reference Manual.
721
722Much has been said about Poky being a "default configuration". A default
723configuration provides a starting image footprint. You can use Poky out
724of the box to create an image ranging from a shell-accessible minimal
725image all the way up to a Linux Standard Base-compliant image that uses
726a GNOME Mobile and Embedded (GMAE) based reference user interface called
727Sato.
728
729One of the most powerful properties of Poky is that every aspect of a
730build is controlled by the metadata. You can use metadata to augment
731these base image types by adding metadata
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500732`layers <overview-manual/yp-intro:the yocto project layer model>` that extend
733functionality.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500734These layers can provide, for example, an additional software stack for
735an image type, add a board support package (BSP) for additional
736hardware, or even create a new image type.
737
738Metadata is loosely grouped into configuration files or package recipes.
739A recipe is a collection of non-executable metadata used by BitBake to
740set variables or define additional build-time tasks. A recipe contains
741fields such as the recipe description, the recipe version, the license
742of the package and the upstream source repository. A recipe might also
743indicate that the build process uses autotools, make, distutils or any
744other build process, in which case the basic functionality can be
745defined by the classes it inherits from the OE-Core layer's class
746definitions in ``./meta/classes``. Within a recipe you can also define
747additional tasks as well as task prerequisites. Recipe syntax through
748BitBake also supports both ``_prepend`` and ``_append`` operators as a
749method of extending task functionality. These operators inject code into
750the beginning or end of a task. For information on these BitBake
751operators, see the
752":ref:`bitbake:bitbake-user-manual/bitbake-user-manual-metadata:appending and prepending (override style syntax)`"
753section in the BitBake User's Manual.
754
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500755The OpenEmbedded Build System Workflow
756======================================
757
758The :term:`OpenEmbedded Build System` uses a "workflow" to
759accomplish image and SDK generation. The following figure overviews that
760workflow:
761
762.. image:: figures/YP-flow-diagram.png
763 :align: center
764
765Following is a brief summary of the "workflow":
766
7671. Developers specify architecture, policies, patches and configuration
768 details.
769
7702. 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
7743. 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
7784. 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
7825. Different QA and sanity checks run throughout entire build process.
783
7846. 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
7877. The build system generates the file system image and a customized
788 Extensible SDK (eSDK) for application development in parallel.
789
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500790For a very detailed look at this workflow, see the
791":ref:`overview-manual/concepts:openembedded build system concepts`" section.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500792
793Some Basic Terms
794================
795
796It helps to understand some basic fundamental terms when learning the
797Yocto Project. Although a list of terms exists in the ":doc:`Yocto Project
Andrew Geissler09209ee2020-12-13 08:44:15 -0600798Terms </ref-manual/terms>`" section of the Yocto Project
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500799Reference Manual, this section provides the definitions of some terms
800helpful 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 Geissler09209ee2020-12-13 08:44:15 -0600812 on the eSDK, see the :doc:`/sdk-manual/index` manual.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500813
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 Geissler3b8a17c2021-04-15 15:55:55 -0500819 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 Geisslerc9f78652020-09-18 14:11:35 -0500822
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500823 For more detailed information on layers, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600824 ":ref:`dev-manual/common-tasks:understanding and creating layers`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500825 section in the Yocto Project Development Tasks Manual. For a
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500826 discussion specifically on BSP Layers, see the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500827 ":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 Geissler3b8a17c2021-04-15 15:55:55 -0500854 performs a native or cross-compilation of each package. As a first
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500855 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 Geissler09209ee2020-12-13 08:44:15 -0600869 Project :yocto_git:`Source Repositories <>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500870
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 Geissler09209ee2020-12-13 08:44:15 -0600879 ":ref:`ref-manual/system-requirements:required packages for the build host`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500880 section in the Yocto Project Reference Manual are compiled binaries
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500881 that, when installed, add functionality to your host Linux
882 distribution.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500883
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.