blob: 0ec7e2b961d9297eeb3e88740a163b2f8c8df686 [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
44- *Widely Adopted Across the Industry:* Semiconductor, operating
45 system, software, and service vendors exist whose products and
46 services adopt and support the Yocto Project. For a look at the Yocto
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
56 Aside from lots of architecture support, the Yocto Project fully
57 supports a wide range of device emulation through the Quick EMUlator
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
81 as X11, GTK+, Qt, Clutter, and SDL (among others) to create a rich
82 user experience. For devices that do not have a display or where you
83 want to use alternative UI frameworks, you can choose to not install
84 these components.
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
99- *Uses a Layer Model:* The Yocto Project `layer
100 infrastructure <#the-yocto-project-layer-model>`__ groups related
101 functionality into separate bundles. You can incrementally add these
102 grouped functionalities to your project as needed. Using layers to
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
109 `shared-state cache <#shared-state-cache>`__ (sstate) scheme. Being
110 able to build and debug components individually eases project
111 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
158 workflow <#overview-development-environment>`__ could be confusing if
159 you are used to traditional desktop and server software development.
160 In a desktop development environment, mechanisms exist to easily pull
161 and install new packages, which are typically pre-compiled binaries
162 from servers accessible over the Internet. Using the Yocto Project,
163 you must modify your configuration and rebuild to add additional
164 packages.
165
166- *Working in a Cross-Build Environment Can Feel Unfamiliar:* When
167 developing code to run on a target, compilation, execution, and
168 testing done on the actual target can be faster than running a
169 BitBake build on a development host and then deploying binaries to
170 the target for test. While the Yocto Project does support development
171 tools on the target, the additional step of integrating your changes
172 back into the Yocto Project build environment would be required.
173 Yocto Project supports an intermediate approach that involves making
174 changes on the development system within the BitBake environment and
175 then deploying only the updated packages to the target.
176
177 The Yocto Project :term:`OpenEmbedded Build System`
178 produces packages
179 in standard formats (i.e. RPM, DEB, IPK, and TAR). You can deploy
180 these packages into the running system on the target by using
181 utilities on the target such as ``rpm`` or ``ipk``.
182
183- *Initial Build Times Can be Significant:* Long initial build times
184 are unfortunately unavoidable due to the large number of packages
185 initially built from scratch for a fully functioning Linux system.
186 Once that initial build is completed, however, the shared-state
187 (sstate) cache mechanism Yocto Project uses keeps the system from
188 rebuilding packages that have not been "touched" since the last
189 build. The sstate mechanism significantly reduces times for
190 successive builds.
191
192The Yocto Project Layer Model
193=============================
194
195The Yocto Project's "Layer Model" is a development model for embedded
196and IoT Linux creation that distinguishes the Yocto Project from other
197simple build systems. The Layer Model simultaneously supports
198collaboration and customization. Layers are repositories that contain
199related sets of instructions that tell the :term:`OpenEmbedded Build System`
200what to do. You can
201collaborate, share, and reuse layers.
202
203Layers can contain changes to previous instructions or settings at any
204time. This powerful override capability is what allows you to customize
205previously supplied collaborative or community layers to suit your
206product requirements.
207
208You use different layers to logically separate information in your
209build. As an example, you could have BSP, GUI, distro configuration,
210middleware, or application layers. Putting your entire build into one
211layer limits and complicates future customization and reuse. Isolating
212information into layers, on the other hand, helps simplify future
213customizations and reuse. You might find it tempting to keep everything
214in one layer when working on a single project. However, the more modular
215your Metadata, the easier it is to cope with future changes.
216
217.. note::
218
219 - Use Board Support Package (BSP) layers from silicon vendors when
220 possible.
221
222 - Familiarize yourself with the `Yocto Project curated layer
Andrew Geisslerc3d88e42020-10-02 09:45:00 -0500223 index <https://www.yoctoproject.org/software-overview/layers/>`__
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600224 or the :oe_layerindex:`OpenEmbedded layer index <>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500225 The latter contains more layers but they are less universally
226 validated.
227
228 - Layers support the inclusion of technologies, hardware components,
229 and software components. The :ref:`Yocto Project
Andrew Geissler09209ee2020-12-13 08:44:15 -0600230 Compatible <dev-manual/common-tasks:making sure your layer is compatible with yocto project>`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500231 designation provides a minimum level of standardization that
232 contributes to a strong ecosystem. "YP Compatible" is applied to
233 appropriate products and software components such as BSPs, other
234 OE-compatible layers, and related open-source projects, allowing
235 the producer to use Yocto Project badges and branding assets.
236
237To illustrate how layers are used to keep things modular, consider
238machine customizations. These types of customizations typically reside
239in a special layer, rather than a general layer, called a BSP Layer.
240Furthermore, the machine customizations should be isolated from recipes
241and Metadata that support a new GUI environment, for example. This
242situation gives you a couple of layers: one for the machine
243configurations, and one for the GUI environment. It is important to
244understand, however, that the BSP layer can still make machine-specific
245additions to recipes within the GUI environment layer without polluting
246the GUI layer itself with those machine-specific changes. You can
247accomplish this through a recipe that is a BitBake append
248(``.bbappend``) file, which is described later in this section.
249
250.. note::
251
252 For general information on BSP layer structure, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600253 :doc:`/bsp-guide/index`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500254 .
255
256The :term:`Source Directory`
257contains both general layers and BSP layers right out of the box. You
258can easily identify layers that ship with a Yocto Project release in the
259Source Directory by their names. Layers typically have names that begin
260with the string ``meta-``.
261
262.. note::
263
264 It is not a requirement that a layer name begin with the prefix
265 meta-
266 , but it is a commonly accepted standard in the Yocto Project
267 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
275For 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
286(:term:`Poky`) and the
287:term:`OpenEmbedded Build System`. Most of the
288components and tools are downloaded separately.
289
290This section provides brief overviews of the components and tools
291associated with the Yocto Project.
292
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500293Development Tools
294-----------------
295
296The following list consists of tools that help you develop images and
297applications using the Yocto Project:
298
299- *CROPS:* `CROPS <https://github.com/crops/poky-container/>`__ is an
300 open source, cross-platform development framework that leverages
301 `Docker Containers <https://www.docker.com/>`__. CROPS provides an
302 easily managed, extensible environment that allows you to build
303 binaries for a variety of architectures on Windows, Linux and Mac OS
304 X hosts.
305
306- *devtool:* This command-line tool is available as part of the
307 extensible SDK (eSDK) and is its cornerstone. You can use ``devtool``
308 to help build, test, and package software within the eSDK. You can
309 use the tool to optionally integrate what you build into an image
310 built by the OpenEmbedded build system.
311
312 The ``devtool`` command employs a number of sub-commands that allow
313 you to add, modify, and upgrade recipes. As with the OpenEmbedded
314 build system, "recipes" represent software packages within
315 ``devtool``. When you use ``devtool add``, a recipe is automatically
316 created. When you use ``devtool modify``, the specified existing
317 recipe is used in order to determine where to get the source code and
318 how to patch it. In both cases, an environment is set up so that when
319 you build the recipe a source tree that is under your control is used
320 in order to allow you to make changes to the source as desired. By
321 default, both new recipes and the source go into a "workspace"
322 directory under the eSDK. The ``devtool upgrade`` command updates an
323 existing recipe so that you can build it for an updated set of source
324 files.
325
326 You can read about the ``devtool`` workflow in the Yocto Project
327 Application Development and Extensible Software Development Kit
328 (eSDK) Manual in the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600329 ":ref:`sdk-manual/extensible:using \`\`devtool\`\` in your sdk workflow`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500330 section.
331
332- *Extensible Software Development Kit (eSDK):* The eSDK provides a
333 cross-development toolchain and libraries tailored to the contents of
334 a specific image. The eSDK makes it easy to add new applications and
335 libraries to an image, modify the source for an existing component,
336 test changes on the target hardware, and integrate into the rest of
337 the OpenEmbedded build system. The eSDK gives you a toolchain
338 experience supplemented with the powerful set of ``devtool`` commands
339 tailored for the Yocto Project environment.
340
Andrew Geissler09209ee2020-12-13 08:44:15 -0600341 For information on the eSDK, see the :doc:`/sdk-manual/index` Manual.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500342
343- *Toaster:* Toaster is a web interface to the Yocto Project
344 OpenEmbedded build system. Toaster allows you to configure, run, and
345 view information about builds. For information on Toaster, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600346 :doc:`/toaster-manual/index`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500347
348Production Tools
349----------------
350
351The following list consists of tools that help production related
352activities using the Yocto Project:
353
354- *Auto Upgrade Helper:* This utility when used in conjunction with the
355 :term:`OpenEmbedded Build System`
356 (BitBake and
357 OE-Core) automatically generates upgrades for recipes that are based
358 on new versions of the recipes published upstream. See
Andrew Geissler09209ee2020-12-13 08:44:15 -0600359 :ref:`dev-manual/common-tasks:using the auto upgrade helper (auh)`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500360 for how to set it up.
361
362- *Recipe Reporting System:* The Recipe Reporting System tracks recipe
363 versions available for Yocto Project. The main purpose of the system
364 is to help you manage the recipes you maintain and to offer a dynamic
365 overview of the project. The Recipe Reporting System is built on top
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600366 of the :oe_layerindex:`OpenEmbedded Layer Index <>`, which
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500367 is a website that indexes OpenEmbedded-Core layers.
368
369- *Patchwork:* `Patchwork <http://jk.ozlabs.org/projects/patchwork/>`__
370 is a fork of a project originally started by
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600371 `OzLabs <https://ozlabs.org/>`__. The project is a web-based tracking
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500372 system designed to streamline the process of bringing contributions
373 into a project. The Yocto Project uses Patchwork as an organizational
374 tool to handle patches, which number in the thousands for every
375 release.
376
377- *AutoBuilder:* AutoBuilder is a project that automates build tests
378 and quality assurance (QA). By using the public AutoBuilder, anyone
379 can determine the status of the current "master" branch of Poky.
380
381 .. note::
382
383 AutoBuilder is based on buildbot.
384
385 A goal of the Yocto Project is to lead the open source industry with
386 a project that automates testing and QA procedures. In doing so, the
387 project encourages a development community that publishes QA and test
388 plans, publicly demonstrates QA and test plans, and encourages
389 development of tools that automate and test and QA procedures for the
390 benefit of the development community.
391
392 You can learn more about the AutoBuilder used by the Yocto Project
Andrew Geissler09209ee2020-12-13 08:44:15 -0600393 Autobuilder :doc:`here </test-manual/understand-autobuilder>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500394
395- *Cross-Prelink:* Prelinking is the process of pre-computing the load
396 addresses and link tables generated by the dynamic linker as compared
397 to doing this at runtime. Doing this ahead of time results in
398 performance improvements when the application is launched and reduced
399 memory usage for libraries shared by many applications.
400
401 Historically, cross-prelink is a variant of prelink, which was
402 conceived by `Jakub
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600403 Jelínek <https://people.redhat.com/jakub/prelink.pdf>`__ a number of
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500404 years ago. Both prelink and cross-prelink are maintained in the same
405 repository albeit on separate branches. By providing an emulated
406 runtime dynamic linker (i.e. ``glibc``-derived ``ld.so`` emulation),
407 the cross-prelink project extends the prelink software's ability to
408 prelink a sysroot environment. Additionally, the cross-prelink
409 software enables the ability to work in sysroot style environments.
410
411 The dynamic linker determines standard load address calculations
412 based on a variety of factors such as mapping addresses, library
413 usage, and library function conflicts. The prelink tool uses this
414 information, from the dynamic linker, to determine unique load
415 addresses for executable and linkable format (ELF) binaries that are
416 shared libraries and dynamically linked. The prelink tool modifies
417 these ELF binaries with the pre-computed information. The result is
418 faster loading and often lower memory consumption because more of the
419 library code can be re-used from shared Copy-On-Write (COW) pages.
420
421 The original upstream prelink project only supports running prelink
422 on the end target device due to the reliance on the target device's
423 dynamic linker. This restriction causes issues when developing a
424 cross-compiled system. The cross-prelink adds a synthesized dynamic
425 loader that runs on the host, thus permitting cross-prelinking
426 without ever having to run on a read-write target filesystem.
427
428- *Pseudo:* Pseudo is the Yocto Project implementation of
429 `fakeroot <http://man.he.net/man1/fakeroot>`__, which is used to run
430 commands in an environment that seemingly has root privileges.
431
432 During a build, it can be necessary to perform operations that
433 require system administrator privileges. For example, file ownership
434 or permissions might need definition. Pseudo is a tool that you can
435 either use directly or through the environment variable
436 ``LD_PRELOAD``. Either method allows these operations to succeed as
437 if system administrator privileges exist even when they do not.
438
439 You can read more about Pseudo in the "`Fakeroot and
440 Pseudo <#fakeroot-and-pseudo>`__" section.
441
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500442Open-Embedded Build System Components
443-------------------------------------
444
445The following list consists of components associated with the
446:term:`OpenEmbedded Build System`:
447
448- *BitBake:* BitBake is a core component of the Yocto Project and is
449 used by the OpenEmbedded build system to build images. While BitBake
450 is key to the build system, BitBake is maintained separately from the
451 Yocto Project.
452
453 BitBake is a generic task execution engine that allows shell and
454 Python tasks to be run efficiently and in parallel while working
455 within complex inter-task dependency constraints. In short, BitBake
456 is a build engine that works through recipes written in a specific
457 format in order to perform sets of tasks.
458
459 You can learn more about BitBake in the :doc:`BitBake User
460 Manual <bitbake:index>`.
461
462- *OpenEmbedded-Core:* OpenEmbedded-Core (OE-Core) is a common layer of
463 metadata (i.e. recipes, classes, and associated files) used by
464 OpenEmbedded-derived systems, which includes the Yocto Project. The
465 Yocto Project and the OpenEmbedded Project both maintain the
466 OpenEmbedded-Core. You can find the OE-Core metadata in the Yocto
Andrew Geissler09209ee2020-12-13 08:44:15 -0600467 Project :yocto_git:`Source Repositories </poky/tree/meta>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500468
469 Historically, the Yocto Project integrated the OE-Core metadata
470 throughout the Yocto Project source repository reference system
471 (Poky). After Yocto Project Version 1.0, the Yocto Project and
472 OpenEmbedded agreed to work together and share a common core set of
473 metadata (OE-Core), which contained much of the functionality
474 previously found in Poky. This collaboration achieved a long-standing
475 OpenEmbedded objective for having a more tightly controlled and
476 quality-assured core. The results also fit well with the Yocto
477 Project objective of achieving a smaller number of fully featured
478 tools as compared to many different ones.
479
480 Sharing a core set of metadata results in Poky as an integration
481 layer on top of OE-Core. You can see that in this
482 `figure <#yp-key-dev-elements>`__. The Yocto Project combines various
483 components such as BitBake, OE-Core, script "glue", and documentation
484 for its build system.
485
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500486Reference Distribution (Poky)
487-----------------------------
488
489Poky is the Yocto Project reference distribution. It contains the
490:term:`OpenEmbedded Build System`
491(BitBake and OE-Core) as well as a set of metadata to get you started
492building your own distribution. See the
493`figure <#what-is-the-yocto-project>`__ in "What is the Yocto Project?"
494section for an illustration that shows Poky and its relationship with
495other parts of the Yocto Project.
496
497To use the Yocto Project tools and components, you can download
498(``clone``) Poky and use it to bootstrap your own distribution.
499
500.. note::
501
502 Poky does not contain binary files. It is a working example of how to
503 build your own custom Linux distribution from source.
504
505You can read more about Poky in the "`Reference Embedded Distribution
506(Poky) <#reference-embedded-distribution>`__" section.
507
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500508Packages for Finished Targets
509-----------------------------
510
511The following lists components associated with packages for finished
512targets:
513
514- *Matchbox:* Matchbox is an Open Source, base environment for the X
515 Window System running on non-desktop, embedded platforms such as
516 handhelds, set-top boxes, kiosks, and anything else for which screen
517 space, input mechanisms, or system resources are limited.
518
519 Matchbox consists of a number of interchangeable and optional
520 applications that you can tailor to a specific, non-desktop platform
521 to enhance usability in constrained environments.
522
523 You can find the Matchbox source in the Yocto Project
524 :yocto_git:`Source Repositories <>`.
525
526- *Opkg:* Open PacKaGe management (opkg) is a lightweight package
527 management system based on the itsy package (ipkg) management system.
528 Opkg is written in C and resembles Advanced Package Tool (APT) and
529 Debian Package (dpkg) in operation.
530
531 Opkg is intended for use on embedded Linux devices and is used in
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600532 this capacity in the :oe_home:`OpenEmbedded <>` and
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500533 `OpenWrt <https://openwrt.org/>`__ projects, as well as the Yocto
534 Project.
535
536 .. note::
537
538 As best it can, opkg maintains backwards compatibility with ipkg
539 and conforms to a subset of Debian's policy manual regarding
540 control files.
541
542 You can find the opkg source in the Yocto Project
543 :yocto_git:`Source Repositories <>`.
544
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500545Archived Components
546-------------------
547
548The Build Appliance is a virtual machine image that enables you to build
549and boot a custom embedded Linux image with the Yocto Project using a
550non-Linux development system.
551
552Historically, the Build Appliance was the second of three methods by
553which you could use the Yocto Project on a system that was not native to
554Linux.
555
5561. *Hob:* Hob, which is now deprecated and is no longer available since
557 the 2.1 release of the Yocto Project provided a rudimentary,
558 GUI-based interface to the Yocto Project. Toaster has fully replaced
559 Hob.
560
5612. *Build Appliance:* Post Hob, the Build Appliance became available. It
562 was never recommended that you use the Build Appliance as a
563 day-to-day production development environment with the Yocto Project.
564 Build Appliance was useful as a way to try out development in the
565 Yocto Project environment.
566
5673. *CROPS:* The final and best solution available now for developing
568 using the Yocto Project on a system not native to Linux is with
569 `CROPS <#gs-crops-overview>`__.
570
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500571Development Methods
572===================
573
574The Yocto Project development environment usually involves a
575:term:`Build Host` and target
576hardware. You use the Build Host to build images and develop
577applications, while you use the target hardware to test deployed
578software.
579
580This section provides an introduction to the choices or development
581methods you have when setting up your Build Host. Depending on the your
582particular workflow preference and the type of operating system your
583Build Host runs, several choices exist that allow you to use the Yocto
584Project.
585
586.. note::
587
588 For additional detail about the Yocto Project development
Andrew Geissler09209ee2020-12-13 08:44:15 -0600589 environment, see the ":doc:`/overview-manual/development-environment`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500590 chapter.
591
592- *Native Linux Host:* By far the best option for a Build Host. A
593 system running Linux as its native operating system allows you to
594 develop software by directly using the
595 :term:`BitBake` tool. You can
596 accomplish all aspects of development from a familiar shell of a
597 supported Linux distribution.
598
599 For information on how to set up a Build Host on a system running
600 Linux as its native operating system, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600601 ":ref:`dev-manual/start:setting up a native linux host`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500602 section in the Yocto Project Development Tasks Manual.
603
604- *CROss PlatformS (CROPS):* Typically, you use
605 `CROPS <https://github.com/crops/poky-container/>`__, which leverages
606 `Docker Containers <https://www.docker.com/>`__, to set up a Build
607 Host that is not running Linux (e.g. Microsoft Windows or macOS).
608
609 .. note::
610
611 You can, however, use CROPS on a Linux-based system.
612
613 CROPS is an open source, cross-platform development framework that
614 provides an easily managed, extensible environment for building
615 binaries targeted for a variety of architectures on Windows, macOS,
616 or Linux hosts. Once the Build Host is set up using CROPS, you can
617 prepare a shell environment to mimic that of a shell being used on a
618 system natively running Linux.
619
620 For information on how to set up a Build Host with CROPS, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600621 ":ref:`dev-manual/start:setting up to use cross platforms (crops)`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500622 section in the Yocto Project Development Tasks Manual.
623
624- *Windows Subsystem For Linux (WSLv2):* You may use Windows Subsystem
625 For Linux v2 to set up a build host using Windows 10.
626
627 .. note::
628
629 The Yocto Project is not compatible with WSLv1, it is compatible
630 but not officially supported nor validated with WSLv2, if you
631 still decide to use WSL please upgrade to WSLv2.
632
633 The Windows Subsystem For Linux allows Windows 10 to run a real Linux
634 kernel inside of a lightweight utility virtual machine (VM) using
635 virtualization technology.
636
637 For information on how to set up a Build Host with WSLv2, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600638 ":ref:`dev-manual/start:setting up to use windows subsystem for linux (wslv2)`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500639 section in the Yocto Project Development Tasks Manual.
640
641- *Toaster:* Regardless of what your Build Host is running, you can use
642 Toaster to develop software using the Yocto Project. Toaster is a web
643 interface to the Yocto Project's :term:`OpenEmbedded Build System`.
644 The interface
645 enables you to configure and run your builds. Information about
646 builds is collected and stored in a database. You can use Toaster to
647 configure and start builds on multiple remote build servers.
648
649 For information about and how to use Toaster, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600650 :doc:`/toaster-manual/index`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500651
652Reference Embedded Distribution (Poky)
653======================================
654
655"Poky", which is pronounced *Pock*-ee, is the name of the Yocto
656Project's reference distribution or Reference OS Kit. Poky contains the
657:term:`OpenEmbedded Build System`
658(:term:`BitBake` and
659:term:`OpenEmbedded-Core (OE-Core)`) as well as a set
660of :term:`Metadata` to get you started
661building your own distro. In other words, Poky is a base specification
662of the functionality needed for a typical embedded system as well as the
663components from the Yocto Project that allow you to build a distribution
664into a usable binary image.
665
666Poky is a combined repository of BitBake, OpenEmbedded-Core (which is
667found in ``meta``), ``meta-poky``, ``meta-yocto-bsp``, and documentation
668provided all together and known to work well together. You can view
669these items that make up the Poky repository in the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600670:yocto_git:`Source Repositories </poky/tree/>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500671
672.. note::
673
674 If you are interested in all the contents of the
675 poky
Andrew Geissler09209ee2020-12-13 08:44:15 -0600676 Git repository, see the ":ref:`ref-manual/structure:top-level core components`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500677 section in the Yocto Project Reference Manual.
678
679The following figure illustrates what generally comprises Poky:
680
681.. image:: figures/poky-reference-distribution.png
682 :align: center
683
684- BitBake is a task executor and scheduler that is the heart of the
685 OpenEmbedded build system.
686
687- ``meta-poky``, which is Poky-specific metadata.
688
689- ``meta-yocto-bsp``, which are Yocto Project-specific Board Support
690 Packages (BSPs).
691
692- OpenEmbedded-Core (OE-Core) metadata, which includes shared
693 configurations, global variable definitions, shared classes,
694 packaging, and recipes. Classes define the encapsulation and
695 inheritance of build logic. Recipes are the logical units of software
696 and images to be built.
697
698- Documentation, which contains the Yocto Project source files used to
699 make the set of user manuals.
700
701.. note::
702
703 While Poky is a "complete" distribution specification and is tested
704 and put through QA, you cannot use it as a product "out of the box"
705 in its current form.
706
707To use the Yocto Project tools, you can use Git to clone (download) the
708Poky repository then use your local copy of the reference distribution
709to bootstrap your own distribution.
710
711.. note::
712
713 Poky does not contain binary files. It is a working example of how to
714 build your own custom Linux distribution from source.
715
716Poky has a regular, well established, six-month release cycle under its
717own version. Major releases occur at the same time major releases (point
718releases) occur for the Yocto Project, which are typically in the Spring
719and Fall. For more information on the Yocto Project release schedule and
Andrew Geissler09209ee2020-12-13 08:44:15 -0600720cadence, see the ":doc:`/ref-manual/release-process`" chapter in the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500721Yocto Project Reference Manual.
722
723Much has been said about Poky being a "default configuration". A default
724configuration provides a starting image footprint. You can use Poky out
725of the box to create an image ranging from a shell-accessible minimal
726image all the way up to a Linux Standard Base-compliant image that uses
727a GNOME Mobile and Embedded (GMAE) based reference user interface called
728Sato.
729
730One of the most powerful properties of Poky is that every aspect of a
731build is controlled by the metadata. You can use metadata to augment
732these base image types by adding metadata
733`layers <#the-yocto-project-layer-model>`__ that extend functionality.
734These 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
790For a very detailed look at this workflow, see the "`OpenEmbedded Build
791System Concepts <#openembedded-build-system-build-concepts>`__" section.
792
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
819 the Yocto Project and customize the build by adding your layers after
820 them. You can search the Layer Index for layers used within Yocto
821 Project.
822
823 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
826 discussion specifically on BSP Layers, see the
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
854 performs a native or cross-compilation of the package. As a first
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 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
881 that, when installed, add functionality to your Linux distribution.
882
883 Another point worth noting is that historically within the Yocto
884 Project, recipes were referred to as packages - thus, the existence
885 of several BitBake variables that are seemingly mis-named, (e.g.
886 :term:`PR`,
887 :term:`PV`, and
888 :term:`PE`).
889
890- *Poky:* Poky is a reference embedded distribution and a reference
891 test configuration. Poky provides the following:
892
893 - A base-level functional distro used to illustrate how to customize
894 a distribution.
895
896 - A means by which to test the Yocto Project components (i.e. Poky
897 is used to validate the Yocto Project).
898
899 - A vehicle through which you can download the Yocto Project.
900
901 Poky is not a product level distro. Rather, it is a good starting
902 point for customization.
903
904 .. note::
905
906 Poky is an integration layer on top of OE-Core.
907
908- *Recipe:* The most common form of metadata. A recipe contains a list
909 of settings and tasks (i.e. instructions) for building packages that
910 are then used to build the binary image. A recipe describes where you
911 get source code and which patches to apply. Recipes describe
912 dependencies for libraries or for other recipes as well as
913 configuration and compilation options. Related recipes are
914 consolidated into a layer.