blob: 29ef2d55035e95800a0adb66a91a65cb19679893 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4
5<chapter id='ref-manual-intro'>
6<title>Introduction</title>
7
Brad Bishopd7bf8c12018-02-25 22:55:05 -05008<section id='ref-welcome'>
9 <title>Welcome</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010
11 <para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012 Welcome to the Yocto Project Reference Manual.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050013 This manual provides reference information for the current release
14 of the Yocto Project.
Brad Bishopd7bf8c12018-02-25 22:55:05 -050015 This manual is best used after you have an understanding
16 of the basics of the Yocto Project.
17 The manual is neither meant to be read as a starting point to the
18 Yocto Project nor read from start to finish.
19 Use this manual to find concepts, variable definitions, class
20 descriptions, and so forth as needed during the course of using
21 the Yocto Project.
22 </para>
23
24 <para>
25 For introductory information on the Yocto Project, see the
26 <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> and the
27 "<link linkend='yp-intro'>Introducing the Yocto Project Development Environment</link>"
28 section.
29 </para>
30
31 <para>
32 If you want to use the Yocto Project to test run building an image
33 without having to understand concepts, work through the
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034 <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>.
Brad Bishopd7bf8c12018-02-25 22:55:05 -050035 You can find "how-to" information in the
36 <ulink url='&YOCTO_DOCS_DEV_URL;'>Yocto Project Development Tasks Manual</ulink>.
37 <note><title>Tip</title>
38 For more information about the Yocto Project Documentation set,
39 see the
40 "<link linkend='resources-links-and-related-documentation'>Links and Related Documentation</link>"
41 section.
42 </note>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043 </para>
44</section>
45
Brad Bishopd7bf8c12018-02-25 22:55:05 -050046<section id='yp-intro'>
47 <title>Introducing the Yocto Project Development Environment</title>
48
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049 <para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050050 The Yocto Project is an open-source collaboration project whose
51 focus is for developers of embedded Linux systems.
52 Among other things, the Yocto Project uses an
53 <link linkend='build-system-term'>OpenEmbedded build system</link>.
54 The build system, which is based on the OpenEmbedded (OE) project and
55 uses the
56 <link linkend='bitbake-term'>BitBake</link> tool, constructs complete
57 Linux images for architectures based on ARM, MIPS, PowerPC, x86 and
58 x86-64.
59 <note>
60 Historically, the OpenEmbedded build system, which is the
61 combination of BitBake and OE components, formed a reference
62 build host that was known as
63 "<link linkend='poky'>Poky</link>" (<emphasis>Pah</emphasis>-kee).
64 The term "Poky", as used throughout the Yocto Project Documentation
65 set, can have different meanings.
66 </note>
67 The Yocto Project provides various ancillary tools for the embedded
68 developer and also features the Sato reference User Interface, which
69 is optimized for stylus-driven, low-resolution screens.
70 </para>
71
72 <mediaobject>
73 <imageobject>
74 <imagedata fileref="figures/YP-flow-diagram.png"
75 format="PNG" align='center' width="8in"/>
76 </imageobject>
77 </mediaobject>
78
79 <para>
80 Here are some highlights for the Yocto Project:
81 </para>
82
83 <itemizedlist>
84 <listitem><para>
85 Provides a recent Linux kernel along with a set of system
86 commands and libraries suitable for the embedded
87 environment.
88 </para></listitem>
89 <listitem><para>
90 Makes available system components such as X11, GTK+, Qt,
91 Clutter, and SDL (among others) so you can create a rich user
92 experience on devices that have display hardware.
93 For devices that do not have a display or where you wish to
94 use alternative UI frameworks, these components need not be
95 installed.
96 </para></listitem>
97 <listitem><para>
98 Creates a focused and stable core compatible with the
99 OpenEmbedded project with which you can easily and reliably
100 build and develop.
101 </para></listitem>
102 <listitem><para>
103 Fully supports a wide range of hardware and device emulation
104 through the Quick EMUlator (QEMU).
105 </para></listitem>
106 <listitem><para>
107 Provides a layer mechanism that allows you to easily extend
108 the system, make customizations, and keep them organized.
109 </para></listitem>
110 </itemizedlist>
111
112 <para>
113 You can use the Yocto Project to generate images for many kinds
114 of devices.
115 As mentioned earlier, the Yocto Project supports creation of
116 reference images that you can boot within and emulate using QEMU.
117 The standard example machines target QEMU full-system
118 emulation for 32-bit and 64-bit variants of x86, ARM, MIPS, and
119 PowerPC architectures.
120 Beyond emulation, you can use the layer mechanism to extend
121 support to just about any platform that Linux can run on and that
122 a toolchain can target.
123 </para>
124
125 <para>
126 Another Yocto Project feature is the Sato reference User
127 Interface.
128 This optional UI that is based on GTK+ is intended for devices with
129 restricted screen sizes and is included as part of the
130 OpenEmbedded Core layer so that developers can test parts of the
131 software stack.
132 </para>
133
134 <para>
135 While the Yocto Project does not provide a strict testing framework,
136 it does provide or generate for you artifacts that let you perform
137 target-level and emulated testing and debugging.
138 Additionally, if you are an
139 <trademark class='trade'>Eclipse</trademark> IDE user, you can
140 install an Eclipse Yocto Plug-in to allow you to develop within that
141 familiar environment.
142 </para>
143
144 <para>
145 By default, using the Yocto Project to build an image creates a Poky
146 distribution.
147 However, you can create your own distribution by providing key
148 <link link='metadata'>Metadata</link>.
149 A good example is Angstrom, which has had a distribution
150 based on the Yocto Project since its inception.
151 Other examples include commercial distributions like
152 <ulink url='https://www.yoctoproject.org/organization/wind-river-systems'>Wind River Linux</ulink>,
153 <ulink url='https://www.yoctoproject.org/organization/mentor-graphics'>Mentor Embedded Linux</ulink>,
154 <ulink url='https://www.yoctoproject.org/organization/enea-ab'>ENEA Linux</ulink>
155 and <ulink url='https://www.yoctoproject.org/ecosystem/member-organizations'>others</ulink>.
156 See the "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-your-own-distribution'>Creating Your Own Distribution</ulink>"
157 section in the Yocto Project Development Tasks Manual for more
158 information.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500159 </para>
160</section>
161
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500162<section id='intro-requirements'>
163<title>System Requirements</title>
164 <para>
165 For general Yocto Project system requirements, see the
166 "<ulink url='&YOCTO_DOCS_QS_URL;#yp-resources'>Setting Up to Use the Yocto Project</ulink>" section
167 in the Yocto Project Quick Start.
168 The remainder of this section provides details on system requirements
169 not covered in the Yocto Project Quick Start.
170 </para>
171
172 <section id='detailed-supported-distros'>
173 <title>Supported Linux Distributions</title>
174
175 <para>
176 Currently, the Yocto Project is supported on the following
177 distributions:
178 <note>
179 <para>
180 Yocto Project releases are tested against the stable Linux
181 distributions in the following list.
182 The Yocto Project should work on other distributions but
183 validation is not performed against them.
184 </para>
185
186 <para>
187 In particular, the Yocto Project does not support
188 and currently has no plans to support
189 rolling-releases or development distributions due to their
190 constantly changing nature.
191 We welcome patches and bug reports, but keep in mind that
192 our priority is on the supported platforms listed below.
193 </para>
194
195 <para>
196 If you encounter problems, please go to
197 <ulink url='&YOCTO_BUGZILLA_URL;'>Yocto Project Bugzilla</ulink>
198 and submit a bug.
199 We are interested in hearing about your experience.
200 </para>
201 </note>
202 <itemizedlist>
203<!--
204 <listitem><para>Ubuntu 10.04</para></listitem>
205 <listitem><para>Ubuntu 11.10</para></listitem>
206 <listitem><para>Ubuntu 12.04 (LTS)</para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500207 <listitem><para>Ubuntu 13.10</para></listitem>
208 <listitem><para>Ubuntu 14.04 (LTS)</para></listitem> -->
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500209 <listitem><para>Ubuntu 14.10</para></listitem>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500210 <listitem><para>Ubuntu 15.04</para></listitem>
211 <listitem><para>Ubuntu 15.10</para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500212 <listitem><para>Ubuntu 16.04 (LTS)</para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500213<!-- <listitem><para>Fedora 16 (Verne)</para></listitem>
214 <listitem><para>Fedora 17 (Spherical)</para></listitem>
215 <listitem><para>Fedora release 19 (Schrödinger's Cat)</para></listitem>
216 <listitem><para>Fedora release 20 (Heisenbug)</para></listitem> -->
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500217 <listitem><para>Fedora release 22</para></listitem>
Brad Bishop37a0e4d2017-12-04 01:01:44 -0500218 <listitem><para>Fedora release 23</para></listitem>
219 <listitem><para>Fedora release 24</para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500220<!-- <listitem><para>CentOS release 5.6 (Final)</para></listitem>
221 <listitem><para>CentOS release 5.7 (Final)</para></listitem>
222 <listitem><para>CentOS release 5.8 (Final)</para></listitem>
Brad Bishop37a0e4d2017-12-04 01:01:44 -0500223 <listitem><para>CentOS release 6.3 (Final)</para></listitem>
224 <listitem><para>CentOS release 6.x</para></listitem> -->
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500225 <listitem><para>CentOS release 7.x</para></listitem>
Brad Bishop37a0e4d2017-12-04 01:01:44 -0500226<!-- <listitem><para>Debian GNU/Linux 6.0 (Squeeze)</para></listitem>
227 <listitem><para>Debian GNU/Linux 7.x (Wheezy)</para></listitem> -->
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500228 <listitem><para>Debian GNU/Linux 8.x (Jessie)</para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500229 <listitem><para>Debian GNU/Linux 9.x (Stretch)</para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500230<!-- <listitem><para>Debian GNU/Linux 7.1 (Wheezy)</para></listitem>
231 <listitem><para>Debian GNU/Linux 7.2 (Wheezy)</para></listitem>
232 <listitem><para>Debian GNU/Linux 7.3 (Wheezy)</para></listitem>
233 <listitem><para>Debian GNU/Linux 7.4 (Wheezy)</para></listitem>
234 <listitem><para>Debian GNU/Linux 7.5 (Wheezy)</para></listitem>
235 <listitem><para>Debian GNU/Linux 7.6 (Wheezy)</para></listitem> -->
236<!-- <listitem><para>openSUSE 11.4</para></listitem>
237 <listitem><para>openSUSE 12.1</para></listitem>
238 <listitem><para>openSUSE 12.2</para></listitem>
239 <listitem><para>openSUSE 12.3</para></listitem>
240 <listitem><para>openSUSE 13.1</para></listitem> -->
241 <listitem><para>openSUSE 13.2</para></listitem>
Brad Bishop37a0e4d2017-12-04 01:01:44 -0500242 <listitem><para>openSUSE 42.1</para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500243 </itemizedlist>
244 </para>
245
246 <note>
247 While the Yocto Project Team attempts to ensure all Yocto Project
248 releases are one hundred percent compatible with each officially
249 supported Linux distribution, instances might exist where you
250 encounter a problem while using the Yocto Project on a specific
251 distribution.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500252 </note>
253 </section>
254
255 <section id='required-packages-for-the-host-development-system'>
256 <title>Required Packages for the Host Development System</title>
257
258 <para>
259 The list of packages you need on the host development system can
260 be large when covering all build scenarios using the Yocto Project.
261 This section provides required packages according to
262 Linux distribution and function.
263 </para>
264
265 <section id='ubuntu-packages'>
266 <title>Ubuntu and Debian</title>
267
268 <para>
269 The following list shows the required packages by function
270 given a supported Ubuntu or Debian Linux distribution:
271 <note>
272 If your build system has the
273 <filename>oss4-dev</filename> package installed, you
274 might experience QEMU build failures due to the package
275 installing its own custom
276 <filename>/usr/include/linux/soundcard.h</filename> on
277 the Debian system.
278 If you run into this situation, either of the following
279 solutions exist:
280 <literallayout class='monospaced'>
281 $ sudo apt-get build-dep qemu
282 $ sudo apt-get remove oss4-dev
283 </literallayout>
284 </note>
285 <itemizedlist>
286 <listitem><para><emphasis>Essentials:</emphasis>
287 Packages needed to build an image on a headless
288 system:
289 <literallayout class='monospaced'>
290 $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL;
291 </literallayout></para></listitem>
292 <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
293 Packages recommended if the host system has graphics
294 support or if you are going to use the Eclipse
295 IDE:
296 <literallayout class='monospaced'>
297 $ sudo apt-get install libsdl1.2-dev xterm
298 </literallayout></para></listitem>
299 <listitem><para><emphasis>Documentation:</emphasis>
300 Packages needed if you are going to build out the
301 Yocto Project documentation manuals:
302 <literallayout class='monospaced'>
303 $ sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto
304 </literallayout></para></listitem>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500305 <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
306 Packages needed if you are going to run
307 <filename>oe-selftest</filename>:
308 <literallayout class='monospaced'>
309 $ sudo apt-get install python-git
310 </literallayout>
311 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500312 </itemizedlist>
313 </para>
314 </section>
315
316 <section id='fedora-packages'>
317 <title>Fedora Packages</title>
318
319 <para>
320 The following list shows the required packages by function
321 given a supported Fedora Linux distribution:
322 <itemizedlist>
323 <listitem><para><emphasis>Essentials:</emphasis>
324 Packages needed to build an image for a headless
325 system:
326 <literallayout class='monospaced'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500327 $ sudo dnf install &FEDORA_HOST_PACKAGES_ESSENTIAL;
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500328 </literallayout></para></listitem>
329 <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
330 Packages recommended if the host system has graphics
331 support or if you are going to use the Eclipse
332 IDE:
333 <literallayout class='monospaced'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500334 $ sudo dnf install SDL-devel xterm
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500335 </literallayout></para></listitem>
336 <listitem><para><emphasis>Documentation:</emphasis>
337 Packages needed if you are going to build out the
338 Yocto Project documentation manuals:
339 <literallayout class='monospaced'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500340 $ sudo dnf install make docbook-style-dsssl docbook-style-xsl \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500341 docbook-dtds docbook-utils fop libxslt dblatex xmlto
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500342 </literallayout></para></listitem>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500343 <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
344 Packages needed if you are going to run
345 <filename>oe-selftest</filename>:
346 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600347 $ sudo dnf install python3-GitPython
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500348 </literallayout>
349 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500350 </itemizedlist>
351 </para>
352 </section>
353
354 <section id='opensuse-packages'>
355 <title>openSUSE Packages</title>
356
357 <para>
358 The following list shows the required packages by function
359 given a supported openSUSE Linux distribution:
360 <itemizedlist>
361 <listitem><para><emphasis>Essentials:</emphasis>
362 Packages needed to build an image for a headless
363 system:
364 <literallayout class='monospaced'>
365 $ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL;
366 </literallayout></para></listitem>
367 <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
368 Packages recommended if the host system has graphics
369 support or if you are going to use the Eclipse
370 IDE:
371 <literallayout class='monospaced'>
372 $ sudo zypper install libSDL-devel xterm
373 </literallayout></para></listitem>
374 <listitem><para><emphasis>Documentation:</emphasis>
375 Packages needed if you are going to build out the
376 Yocto Project documentation manuals:
377 <literallayout class='monospaced'>
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500378 $ sudo zypper install make dblatex xmlto
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500379 </literallayout></para></listitem>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500380 <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
381 Packages needed if you are going to run
382 <filename>oe-selftest</filename>:
383 <literallayout class='monospaced'>
384 $ sudo zypper install python-GitPython
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500385 </literallayout></para></listitem>
386 </itemizedlist>
387 </para>
388 </section>
389
390 <section id='centos-packages'>
391 <title>CentOS Packages</title>
392
393 <para>
394 The following list shows the required packages by function
395 given a supported CentOS Linux distribution:
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500396 <itemizedlist>
397 <listitem><para><emphasis>Essentials:</emphasis>
398 Packages needed to build an image for a headless
399 system:
400 <literallayout class='monospaced'>
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500401 $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
402 </literallayout>
403 <note><title>Notes</title>
404 <itemizedlist>
405 <listitem><para>
406 Extra Packages for Enterprise Linux
407 (i.e. <filename>epel-release</filename>)
408 is a collection of packages from Fedora
409 built on RHEL/CentOS for easy installation
410 of packages not included in enterprise
411 Linux by default.
412 You need to install these packages
413 separately.
414 </para></listitem>
415 <listitem><para>
416 The <filename>makecache</filename> command
417 consumes additional Metadata from
418 <filename>epel-release</filename>.
419 </para></listitem>
420 </itemizedlist>
421 </note>
422 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500423 <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
424 Packages recommended if the host system has graphics
425 support or if you are going to use the Eclipse
426 IDE:
427 <literallayout class='monospaced'>
428 $ sudo yum install SDL-devel xterm
429 </literallayout></para></listitem>
430 <listitem><para><emphasis>Documentation:</emphasis>
431 Packages needed if you are going to build out the
432 Yocto Project documentation manuals:
433 <literallayout class='monospaced'>
434 $ sudo yum install make docbook-style-dsssl docbook-style-xsl \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500435 docbook-dtds docbook-utils fop libxslt dblatex xmlto
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500436 </literallayout></para></listitem>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500437 <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
438 Packages needed if you are going to run
439 <filename>oe-selftest</filename>:
440 <literallayout class='monospaced'>
441 $ sudo yum install GitPython
442 </literallayout>
443 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500444 </itemizedlist>
445 </para>
446 </section>
447 </section>
448
449 <section id='required-git-tar-and-python-versions'>
450 <title>Required Git, tar, and Python Versions</title>
451
452 <para>
453 In order to use the build system, your host development system
454 must meet the following version requirements for Git, tar, and
455 Python:
456 <itemizedlist>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500457 <listitem><para>Git 1.8.3.1 or greater</para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500458 <listitem><para>tar 1.27 or greater</para></listitem>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600459 <listitem><para>Python 3.4.0 or greater</para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500460 </itemizedlist>
461 </para>
462
463 <para>
464 If your host development system does not meet all these requirements,
465 you can resolve this by installing a <filename>buildtools</filename>
466 tarball that contains these tools.
467 You can get the tarball one of two ways: download a pre-built
468 tarball or use BitBake to build the tarball.
469 </para>
470
471 <section id='downloading-a-pre-built-buildtools-tarball'>
472 <title>Downloading a Pre-Built <filename>buildtools</filename> Tarball</title>
473
474 <para>
475 Downloading and running a pre-built buildtools installer is
476 the easiest of the two methods by which you can get these tools:
477 <orderedlist>
478 <listitem><para>
479 Locate and download the <filename>*.sh</filename> at
480 <ulink url='&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;/buildtools/'></ulink>.
481 </para></listitem>
482 <listitem><para>
483 Execute the installation script.
484 Here is an example:
485 <literallayout class='monospaced'>
486 $ sh poky-glibc-x86_64-buildtools-tarball-x86_64-buildtools-nativesdk-standalone-&DISTRO;.sh
487 </literallayout>
488 During execution, a prompt appears that allows you to
489 choose the installation directory.
490 For example, you could choose the following:
491 <literallayout class='monospaced'>
492 /home/<replaceable>your-username</replaceable>/buildtools
493 </literallayout>
494 </para></listitem>
495 <listitem><para>
496 Source the tools environment setup script by using a
497 command like the following:
498 <literallayout class='monospaced'>
499 $ source /home/<replaceable>your_username</replaceable>/buildtools/environment-setup-i586-poky-linux
500 </literallayout>
501 Of course, you need to supply your installation directory and be
502 sure to use the right file (i.e. i585 or x86-64).
503 </para>
504 <para>
505 After you have sourced the setup script,
506 the tools are added to <filename>PATH</filename>
507 and any other environment variables required to run the
508 tools are initialized.
509 The results are working versions versions of Git, tar,
510 Python and <filename>chrpath</filename>.
511 </para></listitem>
512 </orderedlist>
513 </para>
514 </section>
515
516 <section id='building-your-own-buildtools-tarball'>
517 <title>Building Your Own <filename>buildtools</filename> Tarball</title>
518
519 <para>
520 Building and running your own buildtools installer applies
521 only when you have a build host that can already run BitBake.
522 In this case, you use that machine to build the
523 <filename>.sh</filename> file and then
524 take steps to transfer and run it on a
525 machine that does not meet the minimal Git, tar, and Python
526 requirements.
527 </para>
528
529 <para>
530 Here are the steps to take to build and run your own
531 buildtools installer:
532 <orderedlist>
533 <listitem><para>
534 On the machine that is able to run BitBake,
535 be sure you have set up your build environment with
536 the setup script
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500537 (<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>).
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500538 </para></listitem>
539 <listitem><para>
540 Run the BitBake command to build the tarball:
541 <literallayout class='monospaced'>
542 $ bitbake buildtools-tarball
543 </literallayout>
544 <note>
545 The
546 <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>
547 variable in your <filename>local.conf</filename> file
548 determines whether you build tools for a 32-bit
549 or 64-bit system.
550 </note>
551 Once the build completes, you can find the
552 <filename>.sh</filename> file that installs
553 the tools in the <filename>tmp/deploy/sdk</filename>
554 subdirectory of the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500555 <link linkend='build-directory'>Build Directory</link>.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500556 The installer file has the string "buildtools"
557 in the name.
558 </para></listitem>
559 <listitem><para>
560 Transfer the <filename>.sh</filename> file from the
561 build host to the machine that does not meet the
562 Git, tar, or Python requirements.
563 </para></listitem>
564 <listitem><para>
565 On the machine that does not meet the requirements,
566 run the <filename>.sh</filename> file
567 to install the tools.
568 Here is an example:
569 <literallayout class='monospaced'>
570 $ sh poky-glibc-x86_64-buildtools-tarball-x86_64-buildtools-nativesdk-standalone-&DISTRO;.sh
571 </literallayout>
572 During execution, a prompt appears that allows you to
573 choose the installation directory.
574 For example, you could choose the following:
575 <literallayout class='monospaced'>
576 /home/<replaceable>your_username</replaceable>/buildtools
577 </literallayout>
578 </para></listitem>
579 <listitem><para>
580 Source the tools environment setup script by using a
581 command like the following:
582 <literallayout class='monospaced'>
583 $ source /home/<replaceable>your_username</replaceable>/buildtools/environment-setup-i586-poky-linux
584 </literallayout>
585 Of course, you need to supply your installation directory and be
586 sure to use the right file (i.e. i585 or x86-64).
587 </para>
588 <para>
589 After you have sourced the setup script,
590 the tools are added to <filename>PATH</filename>
591 and any other environment variables required to run the
592 tools are initialized.
593 The results are working versions versions of Git, tar,
594 Python and <filename>chrpath</filename>.
595 </para></listitem>
596 </orderedlist>
597 </para>
598 </section>
599 </section>
600</section>
601
602<section id='intro-getit'>
603 <title>Obtaining the Yocto Project</title>
604 <para>
605 The Yocto Project development team makes the Yocto Project available through a number
606 of methods:
607 <itemizedlist>
608 <listitem><para><emphasis>Source Repositories:</emphasis>
609 Working from a copy of the upstream
610 <filename>poky</filename> repository is the
611 preferred method for obtaining and using a Yocto Project
612 release.
613 You can view the Yocto Project Source Repositories at
614 <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.
615 In particular, you can find the
616 <filename>poky</filename> repository at
617 <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/'></ulink>.
618 </para></listitem>
619 <listitem><para><emphasis>Releases:</emphasis> Stable, tested
620 releases are available as tarballs through
621 <ulink url='&YOCTO_DL_URL;/releases/yocto/'/>.</para></listitem>
622 <listitem><para><emphasis>Nightly Builds:</emphasis> These
623 tarball releases are available at
624 <ulink url='&YOCTO_AB_NIGHTLY_URL;'/>.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500625 These builds include Yocto Project releases, SDK installation
626 scripts, and experimental builds.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500627 </para></listitem>
628 <listitem><para><emphasis>Yocto Project Website:</emphasis> You can
629 find tarball releases of the Yocto Project and supported BSPs
630 at the
631 <ulink url='&YOCTO_HOME_URL;'>Yocto Project website</ulink>.
632 Along with these downloads, you can find lots of other
633 information at this site.
634 </para></listitem>
635 </itemizedlist>
636 </para>
637</section>
638
639<section id='intro-getit-dev'>
640 <title>Development Checkouts</title>
641 <para>
642 Development using the Yocto Project requires a local
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500643 <link linkend='source-directory'>Source Directory</link>.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500644 You can set up the Source Directory by cloning a copy of the upstream
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500645 <link linkend='poky'>poky</link> Git repository.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500646 For information on how to do this, see the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500647 "<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-yocto-project-source-files'>Working With Yocto Project Source Files</ulink>"
648 section in the Yocto Project Development Tasks Manual.
649 </para>
650</section>
651
652<section id='yocto-project-terms'>
653 <title>Yocto Project Terms</title>
654
655 <para>
656 Following is a list of terms and definitions users new to the Yocto
657 Project development environment might find helpful.
658 While some of these terms are universal, the list includes them
659 just in case:
660 <itemizedlist>
661 <listitem><para>
662 <emphasis>Append Files:</emphasis>
663 Files that append build information to a recipe file.
664 Append files are known as BitBake append files and
665 <filename>.bbappend</filename> files.
666 The OpenEmbedded build system expects every append file to have
667 a corresponding recipe (<filename>.bb</filename>) file.
668 Furthermore, the append file and corresponding recipe file
669 must use the same root filename.
670 The filenames can differ only in the file type suffix used
671 (e.g.
672 <filename>formfactor_0.0.bb</filename> and
673 <filename>formfactor_0.0.bbappend</filename>).</para>
674
675 <para>Information in append files extends or overrides the
676 information in the similarly-named recipe file.
677 For an example of an append file in use, see the
678 "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>"
679 section in the Yocto Project Development Tasks Manual.
680 <note>
681 Append files can also use wildcard patterns in their
682 version numbers so they can be applied to more than one
683 version of the underlying recipe file.
684 </note>
685 </para></listitem>
686 <listitem><para id='bitbake-term'>
687 <emphasis>BitBake:</emphasis>
688 The task executor and scheduler used by the OpenEmbedded build
689 system to build images.
690 For more information on BitBake, see the
691 <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
692 </para></listitem>
693 <listitem><para id='board-support-package-bsp-term'>
694 <emphasis>Board Support Package (BSP):</emphasis>
695 A group of drivers, definitions, and other components that
696 provide support for a specific hardware configuration.
697 For more information on BSPs, see the
698 <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
699 </para></listitem>
700 <listitem>
701 <para id='build-directory'>
702 <emphasis>Build Directory:</emphasis>
703 This term refers to the area used by the OpenEmbedded build
704 system for builds.
705 The area is created when you <filename>source</filename> the
706 setup environment script that is found in the Source Directory
707 (i.e. <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>).
708 The
709 <link linkend='var-TOPDIR'><filename>TOPDIR</filename></link>
710 variable points to the Build Directory.</para>
711
712 <para>You have a lot of flexibility when creating the Build
713 Directory.
714 Following are some examples that show how to create the
715 directory.
716 The examples assume your
717 <link linkend='source-directory'>Source Directory</link> is
718 named <filename>poky</filename>:
719 <itemizedlist>
720 <listitem><para>Create the Build Directory inside your
721 Source Directory and let the name of the Build
722 Directory default to <filename>build</filename>:
723 <literallayout class='monospaced'>
724 $ cd $HOME/poky
725 $ source &OE_INIT_FILE;
726 </literallayout>
727 </para></listitem>
728 <listitem><para>Create the Build Directory inside your
729 home directory and specifically name it
730 <filename>test-builds</filename>:
731 <literallayout class='monospaced'>
732 $ cd $HOME
733 $ source poky/&OE_INIT_FILE; test-builds
734 </literallayout>
735 </para></listitem>
736 <listitem><para>
737 Provide a directory path and specifically name the
738 Build Directory.
739 Any intermediate folders in the pathname must exist.
740 This next example creates a Build Directory named
741 <filename>YP-&POKYVERSION;</filename>
742 in your home directory within the existing
743 directory <filename>mybuilds</filename>:
744 <literallayout class='monospaced'>
745 $cd $HOME
746 $ source $HOME/poky/&OE_INIT_FILE; $HOME/mybuilds/YP-&POKYVERSION;
747 </literallayout>
748 </para></listitem>
749 </itemizedlist>
750 <note>
751 By default, the Build Directory contains
752 <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>,
753 which is a temporary directory the build system uses for
754 its work.
755 <filename>TMPDIR</filename> cannot be under NFS.
756 Thus, by default, the Build Directory cannot be under NFS.
757 However, if you need the Build Directory to be under NFS,
758 you can set this up by setting <filename>TMPDIR</filename>
759 in your <filename>local.conf</filename> file
760 to use a local drive.
761 Doing so effectively separates <filename>TMPDIR</filename>
762 from <filename>TOPDIR</filename>, which is the Build
763 Directory.
764 </note>
765 </para></listitem>
766 <listitem><para id='hardware-build-system-term'>
767 <emphasis>Build System:</emphasis>
768 The system used to build images in a Yocto Project
769 Development environment.
770 The build system is sometimes referred to as the
771 development host.
772 </para></listitem>
773 <listitem><para>
774 <emphasis>Classes:</emphasis>
775 Files that provide for logic encapsulation and inheritance so
776 that commonly used patterns can be defined once and then
777 easily used in multiple recipes.
778 For reference information on the Yocto Project classes, see the
779 "<link linkend='ref-classes'>Classes</link>" chapter.
780 Class files end with the <filename>.bbclass</filename>
781 filename extension.
782 </para></listitem>
783 <listitem><para>
784 <emphasis>Configuration File:</emphasis>
785 Configuration information in various <filename>.conf</filename>
786 files provides global definitions of variables.
787 The <filename>conf/local.conf</filename> configuration file in
788 the
789 <link linkend='build-directory'>Build Directory</link>
790 contains user-defined variables that affect every build.
791 The <filename>meta-poky/conf/distro/poky.conf</filename>
792 configuration file defines Yocto "distro" configuration
793 variables used only when building with this policy.
794 Machine configuration files, which
795 are located throughout the
796 <link linkend='source-directory'>Source Directory</link>, define
797 variables for specific hardware and are only used when building
798 for that target (e.g. the
799 <filename>machine/beaglebone.conf</filename> configuration
800 file defines variables for the Texas Instruments ARM Cortex-A8
801 development board).
802 Configuration files end with a <filename>.conf</filename>
803 filename extension.
804 </para></listitem>
805 <listitem><para id='cross-development-toolchain'>
806 <emphasis>Cross-Development Toolchain:</emphasis>
807 In general, a cross-development toolchain is a collection of
808 software development tools and utilities that run on one
809 architecture and allow you to develop software for a
810 different, or targeted, architecture.
811 These toolchains contain cross-compilers, linkers, and
812 debuggers that are specific to the target architecture.</para>
813
814 <para>The Yocto Project supports two different cross-development
815 toolchains:
816 <itemizedlist>
817 <listitem><para>
818 A toolchain only used by and within
819 BitBake when building an image for a target
820 architecture.
821 </para></listitem>
822 <listitem><para>A relocatable toolchain used outside of
823 BitBake by developers when developing applications
824 that will run on a targeted device.
825 </para></listitem>
826 </itemizedlist></para>
827
828 <para>Creation of these toolchains is simple and automated.
829 For information on toolchain concepts as they apply to the
830 Yocto Project, see the
831 "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
832 section.
833 You can also find more information on using the
834 relocatable toolchain in the
835 <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
836 manual.
837 </para></listitem>
838 <listitem><para>
839 <emphasis>Image:</emphasis>
840 An image is an artifact of the BitBake build process given
841 a collection of recipes and related Metadata.
842 Images are the binary output that run on specific hardware or
843 QEMU and are used for specific use-cases.
844 For a list of the supported image types that the Yocto Project
845 provides, see the
846 "<link linkend='ref-images'>Images</link>"
847 chapter.
848 </para></listitem>
849 <listitem><para>
850 <emphasis>Layer:</emphasis>
851 A collection of recipes representing the core,
852 a BSP, or an application stack.
853 For a discussion specifically on BSP Layers, see the
854 "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
855 section in the Yocto Project Board Support Packages (BSP)
856 Developer's Guide.
857 </para></listitem>
858 <listitem><para id='metadata'>
859 <emphasis>Metadata:</emphasis>
860 The files that BitBake parses when building an image.
861 In general, Metadata includes recipes, classes, and
862 configuration files.
863 In the context of the kernel ("kernel Metadata"), the
864 term refers to the kernel config fragments and features
865 contained in the
866 <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/yocto-kernel-cache'><filename>yocto-kernel-cache</filename></ulink>
867 Git repository.
868 </para></listitem>
869 <listitem><para id='oe-core'>
870 <emphasis>OE-Core:</emphasis>
871 A core set of Metadata originating with OpenEmbedded (OE)
872 that is shared between OE and the Yocto Project.
873 This Metadata is found in the <filename>meta</filename>
874 directory of the
875 <link linkend='source-directory'>Source Directory</link>.
876 </para></listitem>
877 <listitem><para id='build-system-term'>
878 <emphasis>OpenEmbedded Build System:</emphasis>
879 The build system specific to the Yocto Project.
880 The OpenEmbedded build system is based on another project known
881 as "Poky", which uses
882 <link linkend='bitbake-term'>BitBake</link> as the task
883 executor.
884 Throughout the Yocto Project documentation set, the
885 OpenEmbedded build system is sometimes referred to simply
886 as "the build system".
887 If other build systems, such as a host or target build system
888 are referenced, the documentation clearly states the
889 difference.
890 <note>
891 For some historical information about Poky, see the
892 <link linkend='poky'>Poky</link> term.
893 </note>
894 </para></listitem>
895 <listitem><para>
896 <emphasis>Package:</emphasis>
897 In the context of the Yocto Project, this term refers to a
898 recipe's packaged output produced by BitBake (i.e. a
899 "baked recipe").
900 A package is generally the compiled binaries produced from the
901 recipe's sources.
902 You "bake" something by running it through BitBake.</para>
903
904 <para>It is worth noting that the term "package" can,
905 in general, have subtle meanings.
906 For example, the packages referred to in the
907 "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>"
908 section in the Yocto Project Quick Start are compiled binaries
909 that, when installed, add functionality to your Linux
910 distribution.</para>
911
912 <para>Another point worth noting is that historically within
913 the Yocto Project, recipes were referred to as packages - thus,
914 the existence of several BitBake variables that are seemingly
915 mis-named,
916 (e.g. <link linkend='var-PR'><filename>PR</filename></link>,
917 <link linkend='var-PV'><filename>PV</filename></link>, and
918 <link linkend='var-PE'><filename>PE</filename></link>).
919 </para></listitem>
920 <listitem><para>
921 <emphasis>Package Groups:</emphasis>
922 Arbitrary groups of software Recipes.
923 You use package groups to hold recipes that, when built,
924 usually accomplish a single task.
925 For example, a package group could contain the recipes for a
926 company’s proprietary or value-add software.
927 Or, the package group could contain the recipes that enable
928 graphics.
929 A package group is really just another recipe.
930 Because package group files are recipes, they end with the
931 <filename>.bb</filename> filename extension.
932 </para></listitem>
933 <listitem><para id='poky'>
934 <emphasis>Poky:</emphasis>
935 The term "poky", which is pronounced
936 <emphasis>Pah</emphasis>-kee, can mean several things:
937 <itemizedlist>
938 <listitem><para>
939 In its most general sense, poky is an open-source
940 project that was initially developed by OpenedHand.
941 OpenedHand developed poky off of the existing
942 OpenEmbedded build system to create a commercially
943 supportable build system for embedded Linux.
944 After Intel Corporation acquired OpenedHand, the
945 poky project became the basis for the Yocto Project's
946 build system.
947 </para></listitem>
948 <listitem><para>
949 Within the Yocto Project
950 <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink>,
951 "poky" exists as a separate Git
952 repository from which you can clone to yield a local
953 Git repository that is a copy on your host system.
954 Thus, "poky" can refer to the upstream or
955 local copy of the files used for development within
956 the Yocto Project.
957 </para></listitem>
958 <listitem><para>
959 Finally, "poky" can refer to the default
960 <link linkend='var-DISTRO'><filename>DISTRO</filename></link>
961 (i.e. distribution) created when you use the Yocto
962 Project in conjunction with the
963 <filename>poky</filename> repository to build an image.
964 </para></listitem>
965 </itemizedlist>
966 </para></listitem>
967 <listitem><para>
968 <emphasis>Recipe:</emphasis>
969 A set of instructions for building packages.
970 A recipe describes where you get source code, which patches
971 to apply, how to configure the source, how to compile it and so on.
972 Recipes also describe dependencies for libraries or for other
973 recipes.
974 Recipes represent the logical unit of execution, the software
975 to build, the images to build, and use the
976 <filename>.bb</filename> file extension.
977 </para></listitem>
978 <listitem><para id='reference-kit-term'>
979 <emphasis>Reference Kit:</emphasis>
980 A working example of a system, which includes a
981 <link linkend='board-support-package-bsp-term'>BSP</link>
982 as well as a
983 <link linkend='hardware-build-system-term'>build system</link>
984 and other components, that can work on specific hardware.
985 </para></listitem>
986 <listitem>
987 <para id='source-directory'>
988 <emphasis>Source Directory:</emphasis>
989 This term refers to the directory structure created as a result
990 of creating a local copy of the <filename>poky</filename> Git
991 repository <filename>git://git.yoctoproject.org/poky</filename>
992 or expanding a released <filename>poky</filename> tarball.
993 <note>
994 Creating a local copy of the <filename>poky</filename>
995 Git repository is the recommended method for setting up
996 your Source Directory.
997 </note>
998 Sometimes you might hear the term "poky directory" used to refer
999 to this directory structure.
1000 <note>
1001 The OpenEmbedded build system does not support file or
1002 directory names that contain spaces.
1003 Be sure that the Source Directory you use does not contain
1004 these types of names.
1005 </note></para>
1006
1007 <para>The Source Directory contains BitBake, Documentation,
1008 Metadata and other files that all support the Yocto Project.
1009 Consequently, you must have the Source Directory in place on
1010 your development system in order to do any development using
1011 the Yocto Project.</para>
1012
1013 <para>When you create a local copy of the Git repository, you
1014 can name the repository anything you like.
1015 Throughout much of the documentation, "poky"
1016 is used as the name of the top-level folder of the local copy of
1017 the poky Git repository.
1018 So, for example, cloning the <filename>poky</filename> Git
1019 repository results in a local Git repository whose top-level
1020 folder is also named "poky".</para>
1021
1022 <para>While it is not recommended that you use tarball expansion
1023 to set up the Source Directory, if you do, the top-level
1024 directory name of the Source Directory is derived from the
1025 Yocto Project release tarball.
1026 For example, downloading and unpacking
1027 <filename>&YOCTO_POKY_TARBALL;</filename> results in a
1028 Source Directory whose root folder is named
1029 <filename>&YOCTO_POKY;</filename>.</para>
1030
1031 <para>It is important to understand the differences between the
1032 Source Directory created by unpacking a released tarball as
1033 compared to cloning
1034 <filename>git://git.yoctoproject.org/poky</filename>.
1035 When you unpack a tarball, you have an exact copy of the files
1036 based on the time of release - a fixed release point.
1037 Any changes you make to your local files in the Source Directory
1038 are on top of the release and will remain local only.
1039 On the other hand, when you clone the <filename>poky</filename>
1040 Git repository, you have an active development repository with
1041 access to the upstream repository's branches and tags.
1042 In this case, any local changes you make to the local
1043 Source Directory can be later applied to active development
1044 branches of the upstream <filename>poky</filename> Git
1045 repository.</para>
1046
1047 <para>For more information on concepts related to Git
1048 repositories, branches, and tags, see the
1049 "<link linkend='repositories-tags-and-branches'>Repositories, Tags, and Branches</link>"
1050 section.
1051 </para></listitem>
1052 <listitem><para><emphasis>Task:</emphasis>
1053 A unit of execution for BitBake (e.g.
1054 <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>,
1055 <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>,
1056 <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>,
1057 and so forth).
1058 </para></listitem>
1059 <listitem><para id='toaster-term'><emphasis>Toaster:</emphasis>
1060 A web interface to the Yocto Project's
1061 <link linkend='build-system-term'>OpenEmbedded Build System</link>.
1062 The interface enables you to configure and run your builds.
1063 Information about builds is collected and stored in a database.
1064 For information on Toaster, see the
1065 <ulink url='&YOCTO_DOCS_TOAST_URL;'>Yocto Project Toaster Manual</ulink>.
1066 </para></listitem>
1067 <listitem><para>
1068 <emphasis>Upstream:</emphasis>
1069 A reference to source code or repositories
1070 that are not local to the development system but located in a
1071 master area that is controlled by the maintainer of the source
1072 code.
1073 For example, in order for a developer to work on a particular
1074 piece of code, they need to first get a copy of it from an
1075 "upstream" source.
1076 </para></listitem>
1077 </itemizedlist>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001078 </para>
1079</section>
1080
1081</chapter>
1082<!--
1083vim: expandtab tw=80 ts=4
1084-->