blob: b4b3f4bd0e09df5ac47bdc0b53de88786144f210 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001<!DOCTYPE article 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<article id='yocto-project-qs-intro'>
6 <articleinfo>
7 <title>Yocto Project Quick Start</title>
8
9 <copyright>
10 <year>&COPYRIGHT_YEAR;</year>
11 <holder>Linux Foundation</holder>
12 </copyright>
13
14 <legalnotice>
15 <para>
16 Permission is granted to copy, distribute and/or modify this document under
17 the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
18 </para>
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019 <note><title>Manual Notes</title>
20 <itemizedlist>
21 <listitem><para>
22 For the latest version of the Yocto Project Quick
23 Start associated with this Yocto Project release
24 (version &YOCTO_DOC_VERSION;),
25 see the Yocto Project Quick Start from the
26 <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
27 </para></listitem>
28 <listitem><para>
29 This version of the manual is version
30 &YOCTO_DOC_VERSION;.
31 For later releases of the Yocto Project (if they exist),
32 go to the
33 <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
34 and use the drop-down "Active Releases" button
35 and choose the Yocto Project version for which you want
36 the manual.
37 </para></listitem>
38 <listitem><para>
39 For an in-development version of the Yocto Project
40 Quick Start, see
41 <ulink url='&YOCTO_DOCS_URL;/latest/yocto-project-qs/yocto-project-qs.html'></ulink>.
42 </para></listitem>
43 </itemizedlist>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044 </note>
45 </legalnotice>
46
47
48 <abstract>
49 <imagedata fileref="figures/yocto-project-transp.png"
50 width="6in" depth="1in"
51 align="right" scale="25" />
52 </abstract>
53 </articleinfo>
54
55 <section id='welcome'>
56 <title>Welcome!</title>
57 <para>
58 Welcome to the Yocto Project!
59 The Yocto Project is an open-source collaboration project whose
60 focus is developers of embedded Linux systems.
61 Among other things, the Yocto Project uses a build host based
62 on the OpenEmbedded (OE) project, which uses the
63 <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>
64 tool, to construct complete Linux images.
65 The BitBake and OE components are combined together to form
66 a reference build host, historically known as
Brad Bishop6e60e8b2018-02-01 10:27:11 -050067 <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>
68 (<emphasis>Pah</emphasis>-key).
Patrick Williamsc124f4f2015-09-15 14:41:29 -050069 </para>
70
71 <para>
72 If you do not have a system that runs Linux and you want to give
73 the Yocto Project a test run, you might consider using the Yocto
74 Project Build Appliance.
75 The Build Appliance allows you to build and boot a custom embedded
76 Linux image with the Yocto Project using a non-Linux development
77 system.
78 See the
79 <ulink url='https://www.yoctoproject.org/tools-resources/projects/build-appliance'>Yocto Project Build Appliance</ulink>
80 for more information.
81 </para>
82
83 <para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050084 This quick start is written so that you can quickly get a
Patrick Williamsc124f4f2015-09-15 14:41:29 -050085 build host set up to use the Yocto Project and then build some
86 Linux images.
87 Rather than go into great detail about the Yocto Project and its
88 many capabilities, this quick start provides the minimal
89 information you need to try out the Yocto Project using a
90 supported Linux build host.
91 Reading and using the quick start should result in you having a
92 basic understanding of what the Yocto Project is and how to use
93 some of its core components.
94 You will also have worked through steps to produce two images:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050095 one that is suitable for emulation and one that boots on actual
Patrick Williamsc124f4f2015-09-15 14:41:29 -050096 hardware.
97 The examples highlight the ease with which you can use the
98 Yocto Project to create images for multiple types of hardware.
99 </para>
100
101 <para>
102 For more detailed information on the Yocto Project, you can
103 reference these resources:
104 <itemizedlist>
105 <listitem><para><emphasis>Website:</emphasis>
106 The
107 <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
108 provides the latest builds, breaking news, full development
109 documentation, and access to a rich Yocto Project
110 Development Community into which you can tap.
111 </para></listitem>
112 <listitem><para><emphasis>FAQs:</emphasis>
113 Lists commonly asked Yocto Project questions and answers.
114 You can find two FAQs:
115 <ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>Yocto Project FAQ</ulink>
116 on a wiki, and the
117 "<ulink url='&YOCTO_DOCS_REF_URL;#faq'>FAQ</ulink>"
118 chapter in the Yocto Project Reference Manual.
119 </para></listitem>
120 <listitem><para><emphasis>Developer Screencast:</emphasis>
121 The
122 <ulink url='http://vimeo.com/36450321'>Getting Started with the Yocto Project - New Developer Screencast Tutorial</ulink>
123 provides a 30-minute video created for users unfamiliar
124 with the Yocto Project but familiar with Linux build
125 hosts.
126 While this screencast is somewhat dated, the introductory
127 and fundamental concepts are useful for the beginner.
128 </para></listitem>
129 </itemizedlist>
130 </para>
131 </section>
132
133 <section id='yp-intro'>
134 <title>Introducing the Yocto Project Development Environment</title>
135
136 <para>
137 The Yocto Project through the OpenEmbedded build system provides an
138 open source development environment targeting the ARM, MIPS,
139 PowerPC, and x86 architectures for a variety of platforms
140 including x86-64 and emulated ones.
141 You can use components from the Yocto Project to design, develop,
142 build, debug, simulate, and test the complete software stack using
143 Linux, the X Window System, GTK+ frameworks, and Qt frameworks.
144 </para>
145
146 <mediaobject>
147 <imageobject>
148 <imagedata fileref="figures/yocto-environment.png"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500149 format="PNG" align='center' width="8in"/>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500150 </imageobject>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500151 </mediaobject>
152
153 <para>
154 Here are some highlights for the Yocto Project:
155 </para>
156
157 <itemizedlist>
158 <listitem><para>
159 Provides a recent Linux kernel along with a set of system
160 commands and libraries suitable for the embedded
161 environment.
162 </para></listitem>
163 <listitem><para>
164 Makes available system components such as X11, GTK+, Qt,
165 Clutter, and SDL (among others) so you can create a rich user
166 experience on devices that have display hardware.
167 For devices that do not have a display or where you wish to
168 use alternative UI frameworks, these components need not be
169 installed.
170 </para></listitem>
171 <listitem><para>
172 Creates a focused and stable core compatible with the
173 OpenEmbedded project with which you can easily and reliably
174 build and develop.
175 </para></listitem>
176 <listitem><para>
177 Fully supports a wide range of hardware and device emulation
178 through the Quick EMUlator (QEMU).
179 </para></listitem>
180 <listitem><para>
181 Provides a layer mechanism that allows you to easily extend
182 the system, make customizations, and keep them organized.
183 </para></listitem>
184 </itemizedlist>
185
186 <para>
187 You can use the Yocto Project to generate images for many kinds
188 of devices.
189 As mentioned earlier, the Yocto Project supports creation of
190 reference images that you can boot within and emulate using QEMU.
191 The standard example machines target QEMU full-system
192 emulation for 32-bit and 64-bit variants of x86, ARM, MIPS, and
193 PowerPC architectures.
194 Beyond emulation, you can use the layer mechanism to extend
195 support to just about any platform that Linux can run on and that
196 a toolchain can target.
197 </para>
198
199 <para>
200 Another Yocto Project feature is the Sato reference User
201 Interface.
202 This optional UI that is based on GTK+ is intended for devices with
203 restricted screen sizes and is included as part of the
204 OpenEmbedded Core layer so that developers can test parts of the
205 software stack.
206 </para>
207 </section>
208
209 <section id='yp-resources'>
210 <title>Setting Up to Use the Yocto Project</title>
211
212 <para>
213 The following list shows what you need in order to use a
214 Linux-based build host to use the Yocto Project to build images:
215 </para>
216
217 <itemizedlist>
218 <listitem><para><emphasis>Build Host</emphasis>
219 A build host with a minimum of 50 Gbytes of free disk
220 space that is running a supported Linux distribution (i.e.
221 recent releases of Fedora, openSUSE, CentOS, Debian, or
222 Ubuntu).
223 </para></listitem>
224 <listitem><para><emphasis>Build Host Packages</emphasis>
225 Appropriate packages installed on the build host.
226 </para></listitem>
227 <listitem><para><emphasis>The Yocto Project</emphasis>
228 A release of the Yocto Project.
229 </para></listitem>
230 </itemizedlist>
231
232 <section id='the-linux-distro'>
233 <title>The Linux Distribution</title>
234
235 <para>
236 The Yocto Project team verifies each release against recent
237 versions of the most popular Linux distributions that
238 provide stable releases.
239 In general, if you have the current release minus one of the
240 following distributions, you should have no problems.
241 <itemizedlist>
242 <listitem><para>
243 Ubuntu
244 </para></listitem>
245 <listitem><para>
246 Fedora
247 </para></listitem>
248 <listitem><para>
249 openSUSE
250 </para></listitem>
251 <listitem><para>
252 CentOS
253 </para></listitem>
254 <listitem><para>
255 Debian
256 </para></listitem>
257 </itemizedlist>
258 For a more detailed list of distributions that support the
259 Yocto Project, see the
260 "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>"
261 section in the Yocto Project Reference Manual.
262 </para>
263
264 <para>
265 The OpenEmbedded build system should be able to run on any
266 modern distribution that has the following versions for
267 Git, tar, and Python.
268 <itemizedlist>
269 <listitem><para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500270 Git 1.8.3.1 or greater
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500271 </para></listitem>
272 <listitem><para>
273 tar 1.24 or greater
274 </para></listitem>
275 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600276 Python 3.4.0 or greater.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500277 </para></listitem>
278 </itemizedlist>
279 If your build host does not meet any of these three listed
280 version requirements, you can take steps to prepare the
281 system so that you can still use the Yocto Project.
282 See the
283 "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
284 section in the Yocto Project Reference Manual for information.
285 </para>
286 </section>
287
288 <section id='packages'>
289 <title>The Build Host Packages</title>
290
291 <para>
292 Required build host packages vary depending on your
293 build machine and what you want to do with the Yocto Project.
294 For example, if you want to build an image that can run
295 on QEMU in graphical mode (a minimal, basic build
296 requirement), then the build host package requirements
297 are different than if you want to build an image on a headless
298 system or build out the Yocto Project documentation set.
299 </para>
300
301 <para>
302 Collectively, the number of required packages is large
303 if you want to be able to cover all cases.
304 <note>
305 In general, you need to have root access and then install
306 the required packages.
307 Thus, the commands in the following section may or may
308 not work depending on whether or not your Linux
309 distribution has <filename>sudo</filename> installed.
310 </note>
311 </para>
312
313 <para>
314 The following list shows the required packages needed to build
315 an image that runs on QEMU in graphical mode (e.g. essential
316 plus graphics support).
317 For lists of required packages for other scenarios, see the
318 "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
319 section in the Yocto Project Reference Manual.
320 <itemizedlist>
321 <listitem><para><emphasis>Ubuntu and Debian</emphasis>
322 <literallayout class='monospaced'>
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500323 $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; libsdl1.2-dev xterm
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500324 </literallayout>
325 </para></listitem>
326 <listitem><para><emphasis>Fedora</emphasis>
327 <literallayout class='monospaced'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500328 $ sudo dnf install &FEDORA_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500329 </literallayout>
330 </para></listitem>
331 <listitem><para><emphasis>OpenSUSE</emphasis>
332 <literallayout class='monospaced'>
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500333 $ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL; libSDL-devel xterm
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500334 </literallayout>
335 </para></listitem>
336 <listitem><para><emphasis>CentOS</emphasis>
337 <literallayout class='monospaced'>
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500338 $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500339 </literallayout>
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500340 <note><title>Notes</title>
341 <itemizedlist>
342 <listitem><para>
343 Extra Packages for Enterprise Linux
344 (i.e. <filename>epel-release</filename>)
345 is a collection of packages from Fedora
346 built on RHEL/CentOS for easy installation
347 of packages not included in enterprise
348 Linux by default.
349 You need to install these packages
350 separately.
351 </para></listitem>
352 <listitem><para>
353 The <filename>makecache</filename> command
354 consumes additional Metadata from
355 <filename>epel-release</filename>.
356 </para></listitem>
357 </itemizedlist>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500358 </note>
359 </para></listitem>
360 </itemizedlist>
361 </para>
362 </section>
363
364 <section id='releases'>
365 <title>Yocto Project Release</title>
366
367 <para>
368 The last requirement you need to meet before using the
369 Yocto Project is getting a Yocto Project release.
370 It is recommended that you get the latest Yocto Project release
371 by setting up (cloning in
372 <ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink> terms) a
373 local copy of the <filename>poky</filename> Git repository on
374 your build host and then checking out the latest release.
375 Doing so allows you to easily update to newer Yocto Project
376 releases as well as contribute back to the Yocto Project.
377 </para>
378
379 <para>
380 Here is an example from an Ubuntu build host that clones the
381 <filename>poky</filename> repository and then checks out the
382 latest Yocto Project Release (i.e. &DISTRO;):
383 <literallayout class='monospaced'>
384 $ git clone git://git.yoctoproject.org/poky
385 Cloning into 'poky'...
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500386 remote: Counting objects: 361782, done.
387 remote: Compressing objects: 100% (87100/87100), done.
388 remote: Total 361782 (delta 268619), reused 361439 (delta 268277)
389 Receiving objects: 100% (361782/361782), 131.94 MiB | 6.88 MiB/s, done.
390 Resolving deltas: 100% (268619/268619), done.
391 Checking connectivity... done.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500392 $ git checkout &DISTRO_NAME_NO_CAP;
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500393 </literallayout>
394 You can also get the Yocto Project Files by downloading
395 Yocto Project releases from the
396 <ulink url="&YOCTO_HOME_URL;">Yocto Project website</ulink>.
397 </para>
398
399 <para>
400 For more information on getting set up with the Yocto Project
401 release, see the
402 "<ulink url='&YOCTO_DOCS_DEV_URL;#local-yp-release'>Yocto Project Release</ulink>"
403 item in the Yocto Project Development Manual.
404 </para>
405 </section>
406 </section>
407
408 <section id='qs-building-images'>
409 <title>Building Images</title>
410
411 <para>
412 Now that you have your system requirements in order, you can give
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500413 Yocto Project a try.
414 You can try out Yocto Project using either the command-line
415 interface or using Toaster, which uses a graphical user
416 interface.
417 If you want to try out the Yocto Project using a GUI, see the
418 <ulink url='&YOCTO_DOCS_TOAST_URL;'>Toaster User Manual</ulink>
419 for information on how to install and set up Toaster.
420 </para>
421
422 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600423 To use the Yocto Project through the command-line interface,
424 finish this quick start, which presents steps that let you
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500425 do the following:
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500426 <itemizedlist>
427 <listitem><para>
428 Build a <filename>qemux86</filename> reference image
429 and run it in the QEMU emulator.
430 </para></listitem>
431 <listitem><para>
432 Easily change configurations so that you can quickly
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600433 create a second image that you can load onto bootable
434 media and actually boot target hardware.
435 This example uses the MinnowBoard
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500436 MAX-compatible boards.
437 </para></listitem>
438 </itemizedlist>
439 <note>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600440 The steps in the following two sections do not provide detail,
441 but rather provide minimal, working commands and examples
442 designed to just get you started.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500443 For more details, see the appropriate manuals in the
444 <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project manual set</ulink>.
445 </note>
446 </para>
447
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600448 <section id='building-an-image-for-emulation'>
449 <title>Building an Image for Emulation</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500450
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600451 <para>
452 Use the following commands to build your image.
453 The OpenEmbedded build system creates an entire Linux
454 distribution, including the toolchain, from source.
455 <note><title>Note about Network Proxies</title>
456 <para>
457 By default, the build process searches for source code
458 using a pre-determined order through a set of
459 locations.
460 If you are working behind a firewall and your build
461 host is not set up for proxies, you could encounter
462 problems with the build process when fetching source
463 code (e.g. fetcher failures or Git failures).
464 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500465
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600466 <para>
467 If you do not know your proxy settings, consult your
468 local network infrastructure resources and get that
469 information.
470 A good starting point could also be to check your web
471 browser settings.
472 Finally, you can find more information on using the
473 Yocto Project behind a firewall in the Yocto Project
474 Reference Manual
475 <ulink url='&YOCTO_DOCS_REF_URL;#how-does-the-yocto-project-obtain-source-code-and-will-it-work-behind-my-firewall-or-proxy-server'>FAQ</ulink>
476 and on the
477 "<ulink url='https://wiki.yoctoproject.org/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>"
478 wiki page.
479 </para>
480 </note>
481 </para>
482
483 <para>
484 <orderedlist>
485 <listitem><para><emphasis>Be Sure Your Build Host is Set Up:</emphasis>
486 The steps to build an image in this section depend on
487 your build host being properly set up.
488 Be sure you have worked through the requirements
489 described in the
490 "<link linkend='yp-resources'>Setting Up to Use the Yocto Project</link>"
491 section.
492 </para></listitem>
493 <listitem><para><emphasis>Check Out Your Branch:</emphasis>
494 Be sure you are in the
495 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
496 (e.g. <filename>poky</filename>) and then check out
497 the branch associated with the latest Yocto Project
498 Release:
499 <literallayout class='monospaced'>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500500 $ cd ~/poky
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500501 $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600502 </literallayout>
503 Git's <filename>checkout</filename> command checks out
504 the current Yocto Project release into a local branch
505 whose name matches the release (i.e.
506 <filename>&DISTRO_NAME_NO_CAP;</filename>).
507 The local branch tracks the upstream branch of the
508 same name.
509 Creating your own branch based on the released
510 branch ensures you are using the latest files for
511 that release.
512 </para></listitem>
513 <listitem><para><emphasis>Initialize the Build Environment:</emphasis>
514 Run the
515 <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
516 environment setup script to define the OpenEmbedded
517 build environment on your build host.
518 <literallayout class='monospaced'>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500519 $ source &OE_INIT_FILE;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600520 </literallayout>
521 Among other things, the script creates the
522 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
523 which is <filename>build</filename> in this case
524 and is located in the
525 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
526 After the script runs, your current working directory
527 is set to the Build Directory.
528 Later, when the build completes, the Build Directory
529 contains all the files created during the build.
530 <note>
531 For information on running a memory-resident
532 <ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>,
533 see the
534 <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>
535 setup script.
536 </note>
537 </para></listitem>
538 <listitem><para><emphasis>Examine Your Local Configuration File:</emphasis>
539 When you set up the build environment, a local
540 configuration file named
541 <filename>local.conf</filename> becomes available in
542 a <filename>conf</filename> subdirectory of the
543 Build Directory.
544 Before using BitBake to start the build, you can
545 look at this file and be sure your general
546 configurations are how you want them:
547 <itemizedlist>
548 <listitem><para>
549 To help conserve disk space during builds,
550 you can add the following statement to your
551 project's configuration file, which for this
552 example is
553 <filename>poky/build/conf/local.conf</filename>.
554 Adding this statement deletes the work
555 directory used for building a recipe once the
556 recipe is built.
557 <literallayout class='monospaced'>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500558 INHERIT += "rm_work"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600559 </literallayout>
560 </para></listitem>
561 <listitem><para>
562 By default, the target machine for the build is
563 <filename>qemux86</filename>,
564 which produces an image that can be used in
565 the QEMU emulator and is targeted at an
566 <trademark class='registered'>Intel</trademark>
567 32-bit based architecture.
568 Further on in this example, this default is
569 easily changed through the
570 <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
571 variable so that you can quickly
572 build an image for a different machine.
573 </para></listitem>
574 <listitem><para>
575 Another consideration before you build is the
576 package manager used when creating the image.
577 The default <filename>local.conf</filename>
578 file selects the RPM package manager.
579 You can control this configuration by using the
580 <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink></filename>
581 variable.</para>
582 <para>Selection of the package manager is separate
583 from whether package management is used at runtime
584 in the target image.</para>
585 <para>For additional package manager selection
586 information, see the
587 "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-package'><filename>package.bbclass</filename></ulink>"
588 section in the Yocto Project Reference Manual.
589 </para></listitem>
590 </itemizedlist>
591 </para></listitem>
592 <listitem><para><emphasis>Start the Build:</emphasis>
593 Continue with the following command to build an OS image
594 for the target, which is
595 <filename>core-image-sato</filename> in this example:
596 <note>
597 Depending on the number of processors and cores, the
598 amount of RAM, the speed of your Internet connection
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500599 and other factors, the build process could take
600 several hours the first time you run it.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600601 Subsequent builds run much faster since parts of the
602 build are cached.
603 </note>
604 <literallayout class='monospaced'>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500605 $ bitbake core-image-sato
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600606 </literallayout>
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500607 <note>
608 <para>
609 If you experience a build error due to resources
610 temporarily being unavailable and it appears you
611 should not be having this issue, it might be due
612 to the combination of a 4.3+ Linux kernel and
613 <filename>systemd</filename> version 228+
614 (i.e. see this
615 <ulink url='http://unix.stackexchange.com/questions/253903/creating-threads-fails-with-resource-temporarily-unavailable-with-4-3-kernel'>link</ulink>
616 for information).
617 </para>
618
619 <para>
620 To work around this issue, you can try either
621 of the following:
622 <itemizedlist>
623 <listitem><para>
624 Try the build again.
625 </para></listitem>
626 <listitem><para>
627 Modify the "DefaultTasksMax"
628 <filename>systemd</filename> parameter
629 by uncommenting it and setting it to
630 "infinity".
631 You can find this parameter in the
632 <filename>system.conf</filename> file
633 located in
634 <filename>/etc/systemd</filename>
635 on most systems.
636 </para></listitem>
637 </itemizedlist>
638 </para>
639 </note>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600640 For information on using the
641 <filename>bitbake</filename> command, see the
642 "<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>"
643 section in the Yocto Project Reference Manual, or see the
644 "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-command'>BitBake Command</ulink>"
645 section in the BitBake User Manual.
646 For information on other targets, see the
647 "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
648 chapter in the Yocto Project Reference Manual.
649 </para></listitem>
650 <listitem><para><emphasis>Simulate Your Image Using QEMU:</emphasis>
651 Once this particular image is built, you can start QEMU
652 and run the image:
653 <literallayout class='monospaced'>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500654 $ runqemu qemux86
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600655 </literallayout>
656 If you want to learn more about running QEMU, see the
657 "<ulink url="&YOCTO_DOCS_DEV_URL;#dev-manual-qemu">Using the Quick EMUlator (QEMU)</ulink>"
658 chapter in the Yocto Project Development Manual.
659 </para></listitem>
660 <listitem><para><emphasis>Exit QEMU:</emphasis>
661 Exit QEMU by either clicking on the shutdown icon or by
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500662 typing <filename>Ctrl-C</filename> in the QEMU
663 transcript window from which you evoked QEMU.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600664 </para></listitem>
665 </orderedlist>
666 </para>
667 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500668
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600669 <section id='building-an-image-for-hardware'>
670 <title>Building an Image for Hardware</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500671
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600672 <para id='qs-minnowboard-example'>
673 The following steps show how easy it is to set up to build an
674 image for a new machine.
675 These steps build an image for the MinnowBoard MAX, which is
676 supported by the Yocto Project and the
677 <filename>meta-intel</filename> <filename>intel-corei7-64</filename>
678 and <filename>intel-core2-32</filename> Board Support Packages
679 (BSPs).
680 <note>
681 The MinnowBoard MAX ships with 64-bit firmware.
682 If you want to use the board in 32-bit mode, you must
683 download the
684 <ulink url='http://firmware.intel.com/projects/minnowboard-max'>32-bit firmware</ulink>.
685 </note>
686 </para>
687
688 <para>
689 <orderedlist>
690 <listitem><para><emphasis>Create a Local Copy of the
691 <filename>meta-intel</filename> Repository:</emphasis>
692 Building an image for the MinnowBoard MAX requires the
693 <filename>meta-intel</filename> layer.
694 Use the <filename>git clone</filename> command to create
695 a local copy of the repository inside your
696 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
697 which is <filename>poky</filename> in this example:
698 <literallayout class='monospaced'>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500699 $ cd $HOME/poky
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500700 $ git clone git://git.yoctoproject.org/meta-intel
701 Cloning into 'meta-intel'...
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500702 remote: Counting objects: 14039, done.
703 remote: Compressing objects: 100% (4471/4471), done.
704 remote: Total 14039 (delta 8130), reused 13837 (delta 7947)
705 Receiving objects: 100% (14039/14039), 4.27 MiB | 3.98 MiB/s, done.
706 Resolving deltas: 100% (8130/8130), done.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500707 Checking connectivity... done.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600708 </literallayout>
709 By default when you clone a Git repository, the
710 "master" branch is checked out.
711 Before you build your image that uses the
712 <filename>meta-intel</filename> layer, you must be
713 sure that both repositories
714 (<filename>meta-intel</filename> and
715 <filename>poky</filename>) are using the same releases.
716 Consequently, you need to checkout out the
717 "<filename>&DISTRO_NAME_NO_CAP;</filename>" release after
718 cloning <filename>meta-intel</filename>:
719 <literallayout class='monospaced'>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500720 $ cd $HOME/poky/meta-intel
721 $ git checkout &DISTRO_NAME_NO_CAP;
722 Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
723 Switched to a new branch '&DISTRO_NAME_NO_CAP;'
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600724 </literallayout>
725 </para></listitem>
726 <listitem><para><emphasis>Configure the Build:</emphasis>
727 To configure the build, you edit the
728 <filename>bblayers.conf</filename> and
729 <filename>local.conf</filename> files, both of which are
730 located in the <filename>build/conf</filename> directory.
731 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500732
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600733 <para>Here is a quick way to make the edits.
734 The first command uses the
735 <filename>bitbake-layers add-layer</filename> command
736 to add the <filename>meta-intel</filename>
737 layer, which contains the <filename>intel-core*</filename>
738 BSPs to the build.
739 The second command selects the BSP by setting the
740 <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
741 variable.
742 <literallayout class='monospaced'>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500743 $ cd $HOME/poky/build
744 $ bitbake-layers add-layer "$HOME/poky/meta-intel"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500745 $ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600746 </literallayout>
747 <note><title>Notes</title>
748 <para>
749 If you want a 64-bit build, use the following:
750 <literallayout class='monospaced'>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500751 $ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600752 </literallayout>
753 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500754
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600755 <para>
756 If you want 32-bit images, use the following:
757 <literallayout class='monospaced'>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500758 $ echo 'MACHINE = "intel-core2-32"' >> conf/local.conf
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600759 </literallayout>
760 </para>
761 </note>
762 </para></listitem>
763 <listitem><para><emphasis>Build an Image for MinnowBoard MAX:</emphasis>
764 The type of image you build depends on your goals.
765 For example, the previous build created a
766 <filename>core-image-sato</filename> image, which is an
767 image with Sato support.
768 It is possible to build many image types for the
769 MinnowBoard MAX.
770 Some possibilities are <filename>core-image-base</filename>,
771 which is a console-only image.
772 Another choice could be a
773 <filename>core-image-full-cmdline</filename>, which is
774 another console-only image but has more full-features
775 Linux system functionality installed.
776 For types of images you can build using the Yocto
777 Project, see the
778 "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
779 chapter in the Yocto Project Reference Manual.</para>
780 <para>Because configuration changes are minimal to set up
781 for this second build, the OpenEmbedded build system can
782 re-use files from previous builds as much as possible.
783 Re-using files means this second build will be much faster
784 than an initial build.
785 For this example, the <filename>core-image-base</filename>
786 image is built:
787 <literallayout class='monospaced'>
788 $ bitbake core-image-base
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500789 </literallayout>
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500790 <note>
791 <para>
792 If you experience a build error due to resources
793 temporarily being unavailable and it appears you
794 should not be having this issue, it might be due
795 to the combination of a 4.3+ Linux kernel and
796 <filename>systemd</filename> version 228+
797 (i.e. see this
798 <ulink url='http://unix.stackexchange.com/questions/253903/creating-threads-fails-with-resource-temporarily-unavailable-with-4-3-kernel'>link</ulink>
799 for information).
800 </para>
801
802 <para>
803 To work around this issue, you can try either
804 of the following:
805 <itemizedlist>
806 <listitem><para>
807 Try the build again.
808 </para></listitem>
809 <listitem><para>
810 Modify the "DefaultTasksMax"
811 <filename>systemd</filename> parameter
812 by uncommenting it and setting it to
813 "infinity".
814 You can find this parameter in the
815 <filename>system.conf</filename> file
816 located in
817 <filename>/etc/systemd</filename>
818 on most systems.
819 </para></listitem>
820 </itemizedlist>
821 </para>
822 </note>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600823 Once the build completes, the resulting console-only image
824 is located in the Build Directory here:
825 <literallayout class='monospaced'>
Brad Bishop37a0e4d2017-12-04 01:01:44 -0500826 tmp/deploy/images/intel-corei7-64/core-image-base-intel-corei7-64.wic
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600827 </literallayout>
828 </para></listitem>
829 <listitem><para><emphasis>Write the Image:</emphasis>
830 You can write the image just built to a bootable media
831 (e.g. a USB key, SATA drive, SD card, etc.) using the
832 <filename>dd</filename> utility:
833 <literallayout class='monospaced'>
Brad Bishop37a0e4d2017-12-04 01:01:44 -0500834 $ sudo dd if=tmp/deploy/images/intel-corei7-64/core-image-base-intel-corei7-64.wic of=TARGET_DEVICE
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600835 </literallayout>
836 In the previous command, the
837 <filename>TARGET_DEVICE</filename> is the device node in
838 the host machine (e.g. <filename>/dev/sdc</filename>, which
839 is most likely a USB stick, or
840 <filename>/dev/mmcblk0</filename>, which is most likely an
Brad Bishop37a0e4d2017-12-04 01:01:44 -0500841 SD card).
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600842 </para></listitem>
843 <listitem><para><emphasis>Boot the Hardware:</emphasis>
844 With the boot device provisioned, you can insert the
845 media into the MinnowBoard MAX and boot the hardware.
846 The board should automatically detect the media and boot to
847 the bootloader and subsequently the operating system.
848 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500849
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600850 <para>If the board does not boot automatically, you can
851 boot it manually from the EFI shell as follows:
852 <literallayout class='monospaced'>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500853 Shell> connect -r
854 Shell> map -r
855 Shell> fs0:
856 Shell> bootx64
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500857 </literallayout>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600858 <note>
859 For a 32-bit image use the following:
860 <literallayout class='monospaced'>
861 Shell> bootia32
862 </literallayout>
863 </note>
864 </para></listitem>
865 </orderedlist>
866 </para>
867 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500868 </section>
869
870 <section id='qs-next-steps'>
871 <title>Next Steps</title>
872
873 <para>
874 If you completed all the steps in the previous section then
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500875 congratulations!
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500876 What now?
877 </para>
878
879 <para>
880 Depending on what you primary interests are with the Yocto Project,
881 you could consider any of the following:
882 <itemizedlist>
883 <listitem><para><emphasis>Visit the Yocto Project Web Site:</emphasis>
884 The official
885 <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink>
886 web site contains information on the entire project.
887 Visiting this site is a good way to familiarize yourself
888 with the overall project.
889 </para></listitem>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500890 <listitem><para><emphasis>Look Through the Yocto Project Development Manual:</emphasis>
891 The
892 <ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-intro'>Yocto Project Development Manual</ulink>
893 is a great place to get a feel for how to use the Yocto
894 Project.
895 The manual contains conceptual and procedural information
896 that covers
897 <ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-model'>common development models</ulink>
898 and introduces
899 <ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-newbie'>the Yocto Project open source development environment</ulink>.
900 The manual also contains several targeted sections that
901 cover specific
902 <ulink url='&YOCTO_DOCS_DEV_URL;#extendpoky'>common tasks</ulink>
903 such as understanding and creating layers, customizing
904 images, writing new recipes, working with libraries, and
905 configuring and patching the kernel.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500906 </para></listitem>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500907 <listitem><para><emphasis>Look Through the Yocto Project Software Development Kit (SDK) Developer's Guide:</emphasis>
908 The
909 <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>
910 describes how to use both the
911 <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-using-the-standard-sdk'>standard SDK</ulink>
912 and the
913 <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>extensible SDK</ulink>,
914 which are used primarily for application development.
915 This manual also provides an example workflow that uses
916 the popular <trademark class='trade'>Eclipse</trademark>
917 development environment.
918 See the
919 "<ulink url='&YOCTO_DOCS_SDK_URL;#workflow-using-eclipse'>Workflow using Eclipseâ„¢</ulink>"
920 section.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500921 </para></listitem>
922 <listitem><para><emphasis>Learn About Board Support Packages (BSPs):</emphasis>
923 If you want to learn about BSPs, see the
924 <ulink url='&YOCTO_DOCS_BSP_URL;#bsp'>Yocto Project Board Support Packages (BSP) Developer's Guide</ulink>.
925 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500926 <listitem><para><emphasis>Learn About Toaster:</emphasis>
927 Toaster is a web interface to the Yocto Project's
928 OpenEmbedded build system.
929 If you are interested in using this type of interface to
930 create images, see the
931 <ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-intro'>Toaster User Manual</ulink>.
932 </para></listitem>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500933 <listitem><para><emphasis>Have Available the Yocto Project Reference Manual</emphasis>
934 The
935 <ulink url='&YOCTO_DOCS_REF_URL;#ref-manual-intro'>Yocto Project Reference Manual</ulink>,
936 unlike the rest of the Yocto Project manual set, is
937 comprised of material suited for reference rather than
938 procedures.
939 You can get
940 <ulink url='&YOCTO_DOCS_REF_URL;#usingpoky'>build details</ulink>,
941 a
942 <ulink url='&YOCTO_DOCS_REF_URL;#closer-look'>closer look</ulink>
943 at how the pieces of the Yocto Project development
944 environment work together, information on various
945 <ulink url='&YOCTO_DOCS_REF_URL;#technical-details'>technical details</ulink>,
946 guidance on
947 <ulink url='&YOCTO_DOCS_REF_URL;#migration'>migrating to a newer Yocto Project release</ulink>,
948 reference material on the
949 <ulink url='&YOCTO_DOCS_REF_URL;#ref-structure'>directory structure</ulink>,
950 <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes'>classes</ulink>,
951 and
952 <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks'>tasks</ulink>.
953 The Yocto Project Reference Manual also contains a fairly
954 comprehensive
955 <ulink url='&YOCTO_DOCS_REF_URL;#ref-variables-glossary'>glossary of variables</ulink>
956 used within the Yocto Project.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500957 </para></listitem>
958 </itemizedlist>
959 </para>
960 </section>
961</article>
962<!--
963vim: expandtab tw=80 ts=4
964-->