blob: d8726b4857e6def8d00c100aad3ca3ef21e463aa [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='dev-manual-start'>
6
Brad Bishop316dfdd2018-06-25 12:45:53 -04007<title>Setting Up to Use the Yocto Project</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008
9<para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050010 This chapter provides procedures related to getting set up to use the
11 Yocto Project.
Brad Bishop316dfdd2018-06-25 12:45:53 -040012 You can learn about creating a team environment that develops using the
13 Yocto Project, how to set up a build host, how to locate Yocto Project
14 source repositories, and how to create local Git repositories.
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015</para>
16
Brad Bishop316dfdd2018-06-25 12:45:53 -040017<section id="usingpoky-changes-collaborate">
18 <title>Creating a Team Development Environment</title>
19
20 <para>
21 It might not be immediately clear how you can use the Yocto
22 Project in a team development environment, or scale it for a large
23 team of developers.
24 One of the strengths of the Yocto Project is that it is extremely
25 flexible.
26 Thus, you can adapt it to many different use cases and scenarios.
27 However, these characteristics can cause a struggle if you are trying
28 to create a working setup that scales across a large team.
29 </para>
30
31 <para>
32 To help you understand how to set up this type of environment,
33 this section presents a procedure that gives you the information
34 to learn how to get the results you want.
35 The procedure is high-level and presents some of the project's most
36 successful experiences, practices, solutions, and available
37 technologies that work well.
38 Keep in mind, the procedure here is a starting point.
39 You can build off it and customize it to fit any
40 particular working environment and set of practices.
41 <orderedlist>
42 <listitem><para>
43 <emphasis>Determine Who is Going to be Developing:</emphasis>
44 You need to understand who is going to be doing anything
45 related to the Yocto Project and what their roles would be.
46 Making this determination is essential to completing the
47 steps two and three, which are to get your equipment together
48 and set up your development environment's hardware topology.
49 </para>
50
51 <para>The following roles exist:
52 <itemizedlist>
53 <listitem><para>
54 <emphasis>Application Development:</emphasis>
55 These types of developers do application level work
56 on top of an existing software stack.
57 </para></listitem>
58 <listitem><para>
59 <emphasis>Core System Development:</emphasis>
60 These types of developers work on the contents of the
61 operating system image itself.
62 </para></listitem>
63 <listitem><para>
64 <emphasis>Build Engineer:</emphasis>
65 This type of developer manages Autobuilders and
66 releases.
67 Not all environments need a Build Engineer.
68 </para></listitem>
69 <listitem><para>
70 <emphasis>Test Engineer:</emphasis>
71 This type of developer creates and manages automated
72 tests needed to ensure all application and core
73 system development meets desired quality standards.
74 </para></listitem>
75 </itemizedlist>
76 </para></listitem>
77 <listitem><para>
78 <emphasis>Gather the Hardware:</emphasis>
79 Based on the size and make-up of the team, get the hardware
80 together.
81 Any development, build, or test engineer should be using
82 a system that is running a supported Linux distribution.
83 Systems, in general, should be high performance (e.g. dual,
84 six-core Xeons with 24 Gbytes of RAM and plenty of disk space).
85 You can help ensure efficiency by having any machines used
86 for testing or that run Autobuilders be as high performance
87 as possible.
88 </para></listitem>
89 <listitem><para>
90 <emphasis>Understand the Hardware Topology of the Environment:</emphasis>
91 Once you understand the hardware involved and the make-up
92 of the team, you can understand the hardware topology of the
93 development environment.
94 You can get a visual idea of the machines and their roles
95 across the development environment.
96
97<!--
98 The following figure shows a moderately sized Yocto Project
99 development environment.
100
101 <para role="writernotes">
102 Need figure.</para>
103-->
104
105 </para></listitem>
106 <listitem><para>
107 <emphasis>Use Git as Your Source Control Manager (SCM):</emphasis>
108 Keeping your
109 <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
110 and any software you are developing under the
111 control of an SCM system that is compatible
112 with the OpenEmbedded build system is advisable.
113 Of the SCMs BitBake supports, the
114 Yocto Project team strongly recommends using
115 <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>.
116 Git is a distributed system that is easy to backup,
117 allows you to work remotely, and then connects back to the
118 infrastructure.
119 <note>
120 For information about BitBake, see the
121 <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
122 </note></para>
123
124 <para>It is relatively easy to set up Git services and create
125 infrastructure like
126 <ulink url='&YOCTO_GIT_URL;'>http://git.yoctoproject.org</ulink>,
127 which is based on server software called
128 <filename>gitolite</filename> with <filename>cgit</filename>
129 being used to generate the web interface that lets you view the
130 repositories.
131 The <filename>gitolite</filename> software identifies users
132 using SSH keys and allows branch-based
133 access controls to repositories that you can control as little
134 or as much as necessary.
135
136 <note>
137 The setup of these services is beyond the scope of this
138 manual.
139 However, sites such as these exist that describe how to
140 perform setup:
141 <itemizedlist>
142 <listitem><para>
143 <ulink url='http://git-scm.com/book/ch4-8.html'>Git documentation</ulink>:
144 Describes how to install <filename>gitolite</filename>
145 on the server.
146 </para></listitem>
147 <listitem><para>
148 <ulink url='http://gitolite.com'>Gitolite</ulink>:
149 Information for <filename>gitolite</filename>.
150 </para></listitem>
151 <listitem><para>
152 <ulink url='https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools'>Interfaces, frontends, and tools</ulink>:
153 Documentation on how to create interfaces and frontends
154 for Git.
155 </para></listitem>
156 </itemizedlist>
157 </note>
158 </para></listitem>
159 <listitem><para>
160 <emphasis>Set up the Application Development Machines:</emphasis>
161 As mentioned earlier, application developers are creating
162 applications on top of existing software stacks.
163 Following are some best practices for setting up machines
164 that do application development:
165 <itemizedlist>
166 <listitem><para>
167 Use a pre-built toolchain that
168 contains the software stack itself.
169 Then, develop the application code on top of the
170 stack.
171 This method works well for small numbers of relatively
172 isolated applications.
173 </para></listitem>
174 <listitem><para>
175 When possible, use the Yocto Project
176 plug-in for the
177 <trademark class='trade'>Eclipse</trademark> IDE
178 and SDK development practices.
179 For more information, see the
180 "<ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>"
181 manual.
182 </para></listitem>
183 <listitem><para>
184 Keep your cross-development toolchains updated.
185 You can do this through provisioning either as new
186 toolchain downloads or as updates through a package
187 update mechanism using <filename>opkg</filename>
188 to provide updates to an existing toolchain.
189 The exact mechanics of how and when to do this are a
190 question for local policy.
191 </para></listitem>
192 <listitem><para>
193 Use multiple toolchains installed locally
194 into different locations to allow development across
195 versions.
196 </para></listitem>
197 </itemizedlist>
198 </para></listitem>
199 <listitem><para>
200 <emphasis>Set up the Core Development Machines:</emphasis>
201 As mentioned earlier, these types of developers work on the
202 contents of the operating system itself.
203 Following are some best practices for setting up machines
204 used for developing images:
205 <itemizedlist>
206 <listitem><para>
207 Have the Yocto Project build system itself available on
208 the developer workstations so developers can run their own
209 builds and directly rebuild the software stack.
210 </para></listitem>
211 <listitem><para>
212 Keep the core system unchanged as much as
213 possible and do your work in layers on top of the
214 core system.
215 Doing so gives you a greater level of portability when
216 upgrading to new versions of the core system or Board
217 Support Packages (BSPs).
218 </para></listitem>
219 <listitem><para>
220 Share layers amongst the developers of a
221 particular project and contain the policy configuration
222 that defines the project.
223 </para></listitem>
224 </itemizedlist>
225 </para></listitem>
226 <listitem><para>
227 <emphasis>Set up an Autobuilder:</emphasis>
228 Autobuilders are often the core of the development
229 environment.
230 It is here that changes from individual developers are brought
231 together and centrally tested and subsequent decisions about
232 releases can be made.
233 Autobuilders also allow for "continuous integration" style
234 testing of software components and regression identification
235 and tracking.</para>
236
237 <para>See "<ulink url='http://autobuilder.yoctoproject.org'>Yocto Project Autobuilder</ulink>"
238 for more information and links to buildbot.
239 The Yocto Project team has found this implementation
240 works well in this role.
241 A public example of this is the Yocto Project
242 Autobuilders, which we use to test the overall health of the
243 project.</para>
244
245 <para>The features of this system are:
246 <itemizedlist>
247 <listitem><para>
248 Highlights when commits break the build.
249 </para></listitem>
250 <listitem><para>
251 Populates an sstate cache from which
252 developers can pull rather than requiring local
253 builds.
254 </para></listitem>
255 <listitem><para>
256 Allows commit hook triggers,
257 which trigger builds when commits are made.
258 </para></listitem>
259 <listitem><para>
260 Allows triggering of automated image booting
261 and testing under the QuickEMUlator (QEMU).
262 </para></listitem>
263 <listitem><para>
264 Supports incremental build testing and
265 from-scratch builds.
266 </para></listitem>
267 <listitem><para>
268 Shares output that allows developer
269 testing and historical regression investigation.
270 </para></listitem>
271 <listitem><para>
272 Creates output that can be used for releases.
273 </para></listitem>
274 <listitem><para>
275 Allows scheduling of builds so that resources
276 can be used efficiently.
277 </para></listitem>
278 </itemizedlist>
279 </para></listitem>
280 <listitem><para>
281 <emphasis>Set up Test Machines:</emphasis>
282 Use a small number of shared, high performance systems
283 for testing purposes.
284 Developers can use these systems for wider, more
285 extensive testing while they continue to develop
286 locally using their primary development system.
287 </para></listitem>
288 <listitem><para>
289 <emphasis>Document Policies and Change Flow:</emphasis>
290 The Yocto Project itself uses a hierarchical structure and a
291 pull model.
292 Scripts exist to create and send pull requests
293 (i.e. <filename>create-pull-request</filename> and
294 <filename>send-pull-request</filename>).
295 This model is in line with other open source projects where
296 maintainers are responsible for specific areas of the project
297 and a single maintainer handles the final "top-of-tree" merges.
298 <note>
299 You can also use a more collective push model.
300 The <filename>gitolite</filename> software supports both the
301 push and pull models quite easily.
302 </note></para>
303
304 <para>As with any development environment, it is important
305 to document the policy used as well as any main project
306 guidelines so they are understood by everyone.
307 It is also a good idea to have well structured
308 commit messages, which are usually a part of a project's
309 guidelines.
310 Good commit messages are essential when looking back in time and
311 trying to understand why changes were made.</para>
312
313 <para>If you discover that changes are needed to the core
314 layer of the project, it is worth sharing those with the
315 community as soon as possible.
316 Chances are if you have discovered the need for changes,
317 someone else in the community needs them also.
318 </para></listitem>
319 <listitem><para>
320 <emphasis>Development Environment Summary:</emphasis>
321 Aside from the previous steps, some best practices exist
322 within the Yocto Project development environment.
323 Consider the following:
324 <itemizedlist>
325 <listitem><para>
326 Use
327 <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>
328 as the source control system.
329 </para></listitem>
330 <listitem><para>
331 Maintain your Metadata in layers that make sense
332 for your situation.
333 See the "<link linkend='understanding-and-creating-layers'>Understanding
334 and Creating Layers</link>" section for more information on
335 layers.
336 </para></listitem>
337 <listitem><para>
338 Separate the project's Metadata and code by using
339 separate Git repositories.
340 See the
341 "<ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
342 section for information on these repositories.
343 See the
344 "<link linkend='locating-yocto-project-source-files'>Locating Yocto Project Source Files</link>"
345 section for information on how to set up local Git
346 repositories for related upstream Yocto Project
347 Git repositories.
348 </para></listitem>
349 <listitem><para>
350 Set up the directory for the shared state cache
351 (<ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>)
352 where it makes sense.
353 For example, set up the sstate cache on a system used
354 by developers in the same organization and share the
355 same source directories on their machines.
356 </para></listitem>
357 <listitem><para>
358 Set up an Autobuilder and have it populate the
359 sstate cache and source directories.
360 </para></listitem>
361 <listitem><para>
362 The Yocto Project community encourages you
363 to send patches to the project to fix bugs or add features.
364 If you do submit patches, follow the project commit
365 guidelines for writing good commit messages.
366 See the "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
367 section.
368 </para></listitem>
369 <listitem><para>
370 Send changes to the core sooner than later
371 as others are likely to run into the same issues.
372 For some guidance on mailing lists to use, see the list in the
373 "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
374 section.
375 For a description of the available mailing lists, see the
376 "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>"
377 section in the Yocto Project Reference Manual.
378 </para></listitem>
379 </itemizedlist>
380 </para></listitem>
381 </orderedlist>
382 </para>
383</section>
384
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500385<section id='setting-up-the-development-host-to-use-the-yocto-project'>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400386 <title>Preparing the Build Host</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500387
388 <para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500389 This section provides procedures to set up your development host to
390 use the Yocto Project.
391 You can use the Yocto Project on a native Linux development host or
392 you can use
393 <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
394 which leverages
395 <ulink url='https://www.docker.com/'>Docker Containers</ulink>,
396 to prepare any Linux, Mac, or Windows development host.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500397 </para>
398
399 <para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500400 Once your development host is set up to use the Yocto Project,
401 further steps are necessary depending on what you want to
402 accomplish.
403 See the following references for information on how to prepare for
404 Board Support Package (BSP) development, kernel development, and
405 development using the <trademark class='trade'>Eclipse</trademark> IDE:
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500406 <itemizedlist>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500407 <listitem><para>
408 <emphasis>BSP Development:</emphasis>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500409 See the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500410 "<ulink url='&YOCTO_DOCS_BSP_URL;#preparing-your-build-host-to-work-with-bsp-layers'>Preparing Your Build Host to Work With BSP Layers</ulink>"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500411 section in the Yocto Project Board Support Package (BSP)
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500412 Developer's Guide.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500413 </para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500414 <listitem><para>
415 <emphasis>Kernel Development:</emphasis>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500416 See the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500417 "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#preparing-the-build-host-to-work-on-the-kernel'>Preparing the Build Host to Work on the Kernel</ulink>"
418 section in the Yocto Project Linux Kernel Development Manual.
419 </para></listitem>
420 <listitem><para>
421 <emphasis>Eclipse Development:</emphasis>
422 See the
423 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-eclipse-project'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></ulink>"
424 Chapter in the Yocto Project Application Development and the
425 Extensible Software Development Kit (eSDK) manual.
426 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500427 </itemizedlist>
428 </para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500429
430 <section id='setting-up-a-native-linux-host'>
431 <title>Setting Up a Native Linux Host</title>
432
433 <para>
434 Follow these steps to prepare a native Linux machine as your
435 Yocto Project development host:
436 <orderedlist>
437 <listitem><para>
438 <emphasis>Use a Supported Linux Distribution:</emphasis>
439 You should have a reasonably current Linux-based host
440 system.
441 You will have the best results with a recent release of
442 Fedora, openSUSE, Debian, Ubuntu, or CentOS as these
443 releases are frequently tested against the Yocto Project
444 and officially supported.
445 For a list of the distributions under validation and their
446 status, see the
447 "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section
448 in the Yocto Project Reference Manual and the wiki page at
449 <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>.
450 </para></listitem>
451 <listitem><para>
452 <emphasis>Have Enough Free Memory:</emphasis>
453 You should have at least 50 Gbytes of free disk space
454 for building images.
455 </para></listitem>
456 <listitem><para>
457 <emphasis>Meet Minimal Version Requirements:</emphasis>
458 The OpenEmbedded build system should be able to run on any
459 modern distribution that has the following versions for
460 Git, tar, and Python.
461 <itemizedlist>
462 <listitem><para>
463 Git 1.8.3.1 or greater
464 </para></listitem>
465 <listitem><para>
466 tar 1.27 or greater
467 </para></listitem>
468 <listitem><para>
469 Python 3.4.0 or greater.
470 </para></listitem>
471 </itemizedlist>
472 If your build host does not meet any of these three listed
473 version requirements, you can take steps to prepare the
474 system so that you can still use the Yocto Project.
475 See the
476 "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
477 section in the Yocto Project Reference Manual for
478 information.
479 </para></listitem>
480 <listitem><para>
481 <emphasis>Install Development Host Packages:</emphasis>
482 Required development host packages vary depending on your
483 build machine and what you want to do with the Yocto
484 Project.
485 Collectively, the number of required packages is large
486 if you want to be able to cover all cases.</para>
487
488 <para>For lists of required packages for all scenarios,
489 see the
490 "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
491 section in the Yocto Project Reference Manual.
492 </para></listitem>
493 </orderedlist>
494 Once you have completed the previous steps, you are ready to
495 continue using a given development path on your native Linux
496 machine.
497 If you are going to use BitBake, see the
498 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
499 section.
500 If you are going to use the Extensible SDK, see the
501 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
502 Chapter in the Yocto Project Application Development and the
503 Extensible Software Development Kit (eSDK) manual.
504 If you want to work on the kernel, see the
505 <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
506 If you are going to use Toaster, see the
507 "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
508 section in the Toaster User Manual.
509 </para>
510 </section>
511
512 <section id='setting-up-to-use-crops'>
513 <title>Setting Up to Use CROss PlatformS (CROPS)</title>
514
515 <para>
516 With
517 <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
518 which leverages
519 <ulink url='https://www.docker.com/'>Docker Containers</ulink>,
520 you can create a Yocto Project development environment that
521 is operating system agnostic.
522 You can set up a container in which you can develop using the
523 Yocto Project on a Windows, Mac, or Linux machine.
524 </para>
525
526 <para>
527 Follow these general steps to prepare a Windows, Mac, or Linux
528 machine as your Yocto Project development host:
529 <orderedlist>
530 <listitem><para>
531 <emphasis>Go to the Docker Installation Site:</emphasis>
532 <ulink url='https://www.docker.com/what-docker'>Docker</ulink>
533 is a software container platform that you need to install
534 on the host development machine.
535 To start the installation process, see the
536 <ulink url='https://docs.docker.com/engine/installation/'>Docker Installation</ulink>
537 site.
538 </para></listitem>
539 <listitem><para>
540 <emphasis>Choose Your Docker Edition:</emphasis>
541 Docker comes in several editions.
542 For the Yocto Project, the stable community edition
543 (i.e. "Docker CE Stable") is adequate.
544 You can learn more about the Docker editions from the
545 site.
546 </para></listitem>
547 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400548 <emphasis>Go to the Install Site for Your Platform:</emphasis>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500549 Click the link for the Docker edition associated with
550 your development host machine's native software.
551 For example, if your machine is running Microsoft
552 Windows Version 10 and you want the Docker CE Stable
553 edition, click that link under "Supported Platforms".
554 </para></listitem>
555 <listitem><para>
556 <emphasis>Understand What You Need:</emphasis>
557 The install page has pre-requisites your machine must
558 meet.
559 Be sure you read through this page and make sure your
560 machine meets the requirements to run Docker.
561 If your machine does not meet the requirements, the page
562 has instructions to handle exceptions.
563 For example, to run Docker on Windows 10, you must have
564 the pro version of the operating system.
565 If you have the home version, you need to install the
566 <ulink url='https://docs.docker.com/toolbox/overview/#ready-to-get-started'>Docker Toolbox</ulink>.
567 </para>
568
569 <para>Another example is that a Windows machine needs to
570 have Microsoft Hyper-V.
571 If you have a legacy version of the the Microsoft
572 operating system or for any other reason you do not have
573 Microsoft Hyper-V, you would have to enter the BIOS and
574 enable virtualization.
575 </para></listitem>
576 <listitem><para>
577 <emphasis>Install the Software:</emphasis>
578 Once you have understood all the pre-requisites, you can
579 download and install the appropriate software.
580 Follow the instructions for your specific machine and
581 the type of the software you need to install.
582 </para></listitem>
583 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400584 <emphasis>Optionally Orient Yourself With Docker:</emphasis>
585 If you are unfamiliar with Docker and the container
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500586 concept, you can learn more here -
587 <ulink url='https://docs.docker.com/get-started/'></ulink>.
588 You should be able to launch Docker or the Docker Toolbox
589 and have a terminal shell on your development host.
590 </para></listitem>
591 <listitem><para>
592 <emphasis>Set Up the Containers to Use the Yocto Project:</emphasis>
593 Go to
594 <ulink url='https://github.com/crops/docker-win-mac-docs/wiki'></ulink>
595 and follow the directions for your particular
596 development host (i.e. Linux, Mac, or Windows).</para>
597
598 <para>Once you complete the setup instructions for your
599 machine, you have the Poky, Extensible SDK, and Toaster
600 containers available.
601 You can click those links from the page and learn more
602 about using each of those containers.
603 </para></listitem>
604 </orderedlist>
605 Once you have a container set up, everything is in place to
606 develop just as if you were running on a native Linux machine.
607 If you are going to use the Poky container, see the
608 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
609 section.
610 If you are going to use the Extensible SDK container, see the
611 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
612 Chapter in the Yocto Project Application Development and the
613 Extensible Software Development Kit (eSDK) manual.
614 If you are going to use the Toaster container, see the
615 "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
616 section in the Toaster User Manual.
617 </para>
618 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500619</section>
620
Brad Bishop316dfdd2018-06-25 12:45:53 -0400621<section id='locating-yocto-project-source-files'>
622 <title>Locating Yocto Project Source Files</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500623
624 <para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400625 This section contains procedures related to locating Yocto Project
626 files.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500627 You establish and use these local files to work on projects.
628 <note><title>Notes</title>
629 <itemizedlist>
630 <listitem><para>
631 For concepts and introductory information about Git as it
632 is used in the Yocto Project, see the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400633 "<ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>"
634 section in the Yocto Project Overview and Concepts Manual.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500635 </para></listitem>
636 <listitem><para>
637 For concepts on Yocto Project source repositories, see the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400638 "<ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
639 section in the Yocto Project Overview and Concepts Manual."
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500640 </para></listitem>
641 </itemizedlist>
642 </note>
643 </para>
644
645 <section id='accessing-source-repositories'>
646 <title>Accessing Source Repositories</title>
647
648 <para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400649 Working from a copy of the upstream Yocto Project
650 <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
651 is the preferred method for obtaining and using a Yocto Project
652 release.
653 You can view the Yocto Project Source Repositories at
654 <ulink url='&YOCTO_GIT_URL;'></ulink>.
655 In particular, you can find the
656 <filename>poky</filename> repository at
657 <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/'></ulink>.
658 </para>
659
660 <para>
661 Use the following procedure to locate the latest upstream copy of
662 the <filename>poky</filename> Git repository:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500663 <orderedlist>
664 <listitem><para>
665 <emphasis>Access Repositories:</emphasis>
666 Open a browser and go to
667 <ulink url='&YOCTO_GIT_URL;'></ulink> to access the
668 GUI-based interface into the Yocto Project source
669 repositories.
670 </para></listitem>
671 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400672 <emphasis>Select the Repository:</emphasis>
673 Click on the repository in which you are interested (i.e.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500674 <filename>poky</filename>).
675 </para></listitem>
676 <listitem><para>
677 <emphasis>Find the URL Used to Clone the Repository:</emphasis>
678 At the bottom of the page, note the URL used to
Brad Bishop316dfdd2018-06-25 12:45:53 -0400679 <ulink url='&YOCTO_DOCS_OM_URL;#git-commands-clone'>clone</ulink>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500680 that repository (e.g.
681 <filename>&YOCTO_GIT_URL;/poky</filename>).
Brad Bishop316dfdd2018-06-25 12:45:53 -0400682 <note>
683 For information on cloning a repository, see the
684 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
685 section.
686 </note>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500687 </para></listitem>
688 </orderedlist>
689 </para>
690 </section>
691
692 <section id='accessing-index-of-releases'>
693 <title>Accessing Index of Releases</title>
694
695 <para>
696 Yocto Project maintains an Index of Releases area that contains
697 related files that contribute to the Yocto Project.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400698 Rather than Git repositories, these files are tarballs that
699 represent snapshots in time of a given component.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500700 <note><title>Tip</title>
701 The recommended method for accessing Yocto Project
Brad Bishop316dfdd2018-06-25 12:45:53 -0400702 components is to use Git to clone the upstream repository and
703 work from within that locally cloned repository.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500704 The procedure in this section exists should you desire a
705 tarball snapshot of any given component.
706 </note>
707 <orderedlist>
708 <listitem><para>
709 <emphasis>Access the Index of Releases:</emphasis>
710 Open a browser and go to
711 <ulink url='&YOCTO_DL_URL;/releases'></ulink> to access the
712 Index of Releases.
713 The list represents released components (e.g.
714 <filename>eclipse-plugin</filename>,
715 <filename>sato</filename>, and so on).
716 <note>
717 The <filename>yocto</filename> directory contains the
718 full array of released Poky tarballs.
719 The <filename>poky</filename> directory in the
720 Index of Releases was historically used for very
Brad Bishop316dfdd2018-06-25 12:45:53 -0400721 early releases and exists now only for retroactive
722 completeness.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500723 </note>
724 </para></listitem>
725 <listitem><para>
726 <emphasis>Select a Component:</emphasis>
727 Click on any released component in which you are interested
728 (e.g. <filename>yocto</filename>).
729 </para></listitem>
730 <listitem><para>
731 <emphasis>Find the Tarball:</emphasis>
732 Drill down to find the associated tarball.
733 For example, click on <filename>yocto-&DISTRO;</filename> to
734 view files associated with the Yocto Project &DISTRO;
735 release (e.g. <filename>poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;.tar.bz2</filename>,
736 which is the released Poky tarball).
737 </para></listitem>
738 <listitem><para>
739 <emphasis>Download the Tarball:</emphasis>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400740 Click the tarball to download and save a snapshot of the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500741 given component.
742 </para></listitem>
743 </orderedlist>
744 </para>
745 </section>
746
747 <section id='using-the-downloads-page'>
748 <title>Using the Downloads Page</title>
749
750 <para>
751 The
752 <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400753 uses a "DOWNLOADS" page from which you can locate and download
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500754 tarballs of any Yocto Project release.
755 Rather than Git repositories, these files represent snapshot
756 tarballs.
757 <note><title>Tip</title>
758 The recommended method for accessing Yocto Project
759 components is to use Git to clone a repository and work from
760 within that local repository.
761 The procedure in this section exists should you desire a
762 tarball snapshot of any given component.
763 </note>
764 <orderedlist>
765 <listitem><para>
766 <emphasis>Go to the Yocto Project Website:</emphasis>
767 Open The
768 <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
769 in your browser.
770 </para></listitem>
771 <listitem><para>
772 <emphasis>Get to the Downloads Area:</emphasis>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400773 Select the "DOWNLOADS" item from the pull-down
774 "SOFTWARE" tab menu.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500775 </para></listitem>
776 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400777 <emphasis>Select a Yocto Project Release:</emphasis>
778 Use the menu next to "RELEASE" to display and choose
779 a Yocto Project release (e.g. sumo, rocko, pyro, and
780 so forth.
781 For a "map" of Yocto Project releases to version numbers,
782 see the
783 <ulink url='https://wiki.yoctoproject.org/wiki/Releases'>Releases</ulink>
784 wiki page.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500785 </para></listitem>
786 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400787 <emphasis>Download Tools or Board Support Packages (BSPs):</emphasis>
788 From the "DOWNLOADS" page, you can download tools or
789 BSPs as well.
790 Just scroll down the page and look for what you need.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500791 </para></listitem>
792 </orderedlist>
793 </para>
794 </section>
795
Brad Bishop316dfdd2018-06-25 12:45:53 -0400796 <section id='accessing-nightly-builds'>
797 <title>Accessing Nightly Builds</title>
798
799 <para>
800 Yocto Project maintains an area for nightly builds that contains
801 tarball releases at <ulink url='&YOCTO_AB_NIGHTLY_URL;'/>.
802 These builds include Yocto Project releases, SDK installation
803 scripts, and experimental builds.
804 </para>
805
806 <para>
807 Should you ever want to access a nightly build of a particular
808 Yocto Project component, use the following procedure:
809 <orderedlist>
810 <listitem><para>
811 <emphasis>Access the Nightly Builds:</emphasis>
812 Open a browser and go to
813 <ulink url='&YOCTO_AB_NIGHTLY_URL;'/> to access the
814 Nightly Builds.
815 </para></listitem>
816 <listitem><para>
817 <emphasis>Select a Build:</emphasis>
818 Click on any build by date in which you are interested.
819 </para></listitem>
820 <listitem><para>
821 <emphasis>Find the Tarball:</emphasis>
822 Drill down to find the associated tarball.
823 </para></listitem>
824 <listitem><para>
825 <emphasis>Download the Tarball:</emphasis>
826 Click the tarball to download and save a snapshot of the
827 given component.
828 </para></listitem>
829 </orderedlist>
830 </para>
831 </section>
832</section>
833
834<section id='cloning-and-checking-out-branchs'>
835 <title>Cloning and Checking Out Branches</title>
836
837 <para>
838 To use the Yocto Project, you need a release of the Yocto Project
839 locally installed on your development system.
840 The locally installed set of files is referred to as the
841 <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
842 in the Yocto Project documentation.
843 </para>
844
845 <para>
846 You create your Source Directory by using
847 <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink> to clone a local
848 copy of the upstream <filename>poky</filename> repository.
849 <note><title>Tip</title>
850 The preferred method of getting the Yocto Project Source
851 Directory set up is to clone the repository.
852 </note>
853 Working from a copy of the upstream repository allows you
854 to contribute back into the Yocto Project or simply work with
855 the latest software on a development branch.
856 Because Git maintains and creates an upstream repository with
857 a complete history of changes and you are working with a local
858 clone of that repository, you have access to all the Yocto
859 Project development branches and tag names used in the upstream
860 repository.
861 </para>
862
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500863 <section id='cloning-the-poky-repository'>
864 <title>Cloning the <filename>poky</filename> Repository</title>
865
866 <para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500867 Follow these steps to create a local version of the
868 upstream
869 <ulink url='&YOCTO_DOCS_REF_URL;#poky'><filename>poky</filename></ulink>
870 Git repository.
871 <orderedlist>
872 <listitem><para>
873 <emphasis>Set Your Directory:</emphasis>
874 Be in the directory where you want to create your local
875 copy of poky.
876 </para></listitem>
877 <listitem><para>
878 <emphasis>Clone the Repository:</emphasis>
879 The following command clones the repository and uses
880 the default name "poky" for your local repository:
881 <literallayout class='monospaced'>
882 $ git clone git://git.yoctoproject.org/poky
883 Cloning into 'poky'...
884 remote: Counting objects: 367178, done.
885 remote: Compressing objects: 100% (88161/88161), done.
886 remote: Total 367178 (delta 272761), reused 366942 (delta 272525)
887 Receiving objects: 100% (367178/367178), 133.26 MiB | 6.40 MiB/s, done.
888 Resolving deltas: 100% (272761/272761), done.
889 Checking connectivity... done.
890 </literallayout>
891 Unless you specify a specific development branch or
892 tag name, Git clones the "master" branch, which results
893 in a snapshot of the latest development changes for
894 "master".
895 For information on how to check out a specific
896 development branch or on how to check out a local
897 branch based on a tag name, see the
898 "<link linkend='checking-out-by-branch-in-poky'>Checking Out By Branch in Poky</link>"
899 and
Brad Bishop316dfdd2018-06-25 12:45:53 -0400900 <link linkend='checkout-out-by-tag-in-poky'>Checking Out By Tag in Poky</link>"
901 sections, respectively.</para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500902
903 <para>Once the repository is created, you can change to
904 that directory and check its status.
905 Here, the single "master" branch exists on your system
906 and by default, it is checked out:
907 <literallayout class='monospaced'>
908 $ cd ~/poky
909 $ git status
910 On branch master
911 Your branch is up-to-date with 'origin/master'.
912 nothing to commit, working directory clean
913 $ git branch
914 * master
915 </literallayout>
916 Your local repository of poky is identical to the
917 upstream poky repository at the time from which it was
918 cloned.
919 </para></listitem>
920 </orderedlist>
921 </para>
922 </section>
923
924 <section id='checking-out-by-branch-in-poky'>
925 <title>Checking Out by Branch in Poky</title>
926
927 <para>
928 When you clone the upstream poky repository, you have access to
929 all its development branches.
930 Each development branch in a repository is unique as it forks
931 off the "master" branch.
932 To see and use the files of a particular development branch
933 locally, you need to know the branch name and then specifically
934 check out that development branch.
935 <note>
936 Checking out an active development branch by branch name
937 gives you a snapshot of that particular branch at the time
938 you check it out.
939 Further development on top of the branch that occurs after
940 check it out can occur.
941 </note>
942 <orderedlist>
943 <listitem><para>
944 <emphasis>Switch to the Poky Directory:</emphasis>
945 If you have a local poky Git repository, switch to that
946 directory.
947 If you do not have the local copy of poky, see the
948 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
949 section.
950 </para></listitem>
951 <listitem><para>
952 <emphasis>Determine Existing Branch Names:</emphasis>
953 <literallayout class='monospaced'>
954 $ git branch -a
955 * master
956 remotes/origin/1.1_M1
957 remotes/origin/1.1_M2
958 remotes/origin/1.1_M3
959 remotes/origin/1.1_M4
960 remotes/origin/1.2_M1
961 remotes/origin/1.2_M2
962 remotes/origin/1.2_M3
963 .
964 .
965 .
966 remotes/origin/master-next
967 remotes/origin/master-next2
968 remotes/origin/morty
969 remotes/origin/pinky
970 remotes/origin/purple
971 remotes/origin/pyro
972 remotes/origin/rocko
973 </literallayout>
974 </para></listitem>
975 <listitem><para>
976 <emphasis>Checkout the Branch:</emphasis>
977 Checkout the development branch in which you want to work.
978 For example, to access the files for the Yocto Project
979 &DISTRO; Release (&DISTRO_NAME;), use the following command:
980 <literallayout class='monospaced'>
981 $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
982 Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
983 Switched to a new branch '&DISTRO_NAME_NO_CAP;'
984 </literallayout>
985 The previous command checks out the "&DISTRO_NAME_NO_CAP;"
986 development branch and reports that the branch is tracking
987 the upstream "origin/&DISTRO_NAME_NO_CAP;" branch.</para>
988
989 <para>The following command displays the branches
990 that are now part of your local poky repository.
991 The asterisk character indicates the branch that is
992 currently checked out for work:
993 <literallayout class='monospaced'>
994 $ git branch
995 master
996 * &DISTRO_NAME_NO_CAP;
997 </literallayout>
998 </para></listitem>
999 </orderedlist>
1000 </para>
1001 </section>
1002
1003 <section id='checkout-out-by-tag-in-poky'>
1004 <title>Checking Out by Tag in Poky</title>
1005
1006 <para>
1007 Similar to branches, the upstream repository uses tags
1008 to mark specific commits associated with significant points in
1009 a development branch (i.e. a release point or stage of a
1010 release).
1011 You might want to set up a local branch based on one of those
1012 points in the repository.
1013 The process is similar to checking out by branch name except you
1014 use tag names.
1015 <note>
1016 Checking out a branch based on a tag gives you a
1017 stable set of files not affected by development on the
1018 branch above the tag.
1019 </note>
1020 <orderedlist>
1021 <listitem><para>
1022 <emphasis>Switch to the Poky Directory:</emphasis>
1023 If you have a local poky Git repository, switch to that
1024 directory.
1025 If you do not have the local copy of poky, see the
1026 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
1027 section.
1028 </para></listitem>
1029 <listitem><para>
1030 <emphasis>Fetch the Tag Names:</emphasis>
1031 To checkout the branch based on a tag name, you need to
1032 fetch the upstream tags into your local repository:
1033 <literallayout class='monospaced'>
1034 $ git fetch --tags
1035 $
1036 </literallayout>
1037 </para></listitem>
1038 <listitem><para>
1039 <emphasis>List the Tag Names:</emphasis>
1040 You can list the tag names now:
1041 <literallayout class='monospaced'>
1042 $ git tag
1043 1.1_M1.final
1044 1.1_M1.rc1
1045 1.1_M1.rc2
1046 1.1_M2.final
1047 1.1_M2.rc1
1048 .
1049 .
1050 .
1051 yocto-2.2
1052 yocto-2.2.1
1053 yocto-2.3
1054 yocto-2.3.1
1055 yocto-2.4
1056 yocto_1.5_M5.rc8
1057 </literallayout>
1058 </para></listitem>
1059 <listitem><para>
1060 <emphasis>Checkout the Branch:</emphasis>
1061 <literallayout class='monospaced'>
Brad Bishop316dfdd2018-06-25 12:45:53 -04001062 $ git checkout tags/&DISTRO_REL_TAG; -b my_yocto_&DISTRO;
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001063 Switched to a new branch 'my_yocto_&DISTRO;'
1064 $ git branch
1065 master
1066 * my_yocto_&DISTRO;
1067 </literallayout>
1068 The previous command creates and checks out a local
1069 branch named "my_yocto_&DISTRO;", which is based on
1070 the commit in the upstream poky repository that has
1071 the same tag.
1072 In this example, the files you have available locally
1073 as a result of the <filename>checkout</filename>
1074 command are a snapshot of the
1075 "&DISTRO_NAME_NO_CAP;" development branch at the point
1076 where Yocto Project &DISTRO; was released.
1077 </para></listitem>
1078 </orderedlist>
1079 </para>
1080 </section>
1081</section>
1082
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001083</chapter>
1084<!--
1085vim: expandtab tw=80 ts=4
1086-->