blob: 3f971ba4b06a0a1ced07d434ae758fffdcc603ee [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
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080013 Yocto Project, how to set up a
14 <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>,
15 how to locate Yocto Project source repositories, and how to create local
16 Git repositories.
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017</para>
18
Brad Bishop316dfdd2018-06-25 12:45:53 -040019<section id="usingpoky-changes-collaborate">
20 <title>Creating a Team Development Environment</title>
21
22 <para>
23 It might not be immediately clear how you can use the Yocto
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080024 Project in a team development environment, or how to scale it for a
25 large team of developers.
Brad Bishop316dfdd2018-06-25 12:45:53 -040026 One of the strengths of the Yocto Project is that it is extremely
27 flexible.
28 Thus, you can adapt it to many different use cases and scenarios.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080029 However, this flexibility could cause difficulties if you are trying
Brad Bishop316dfdd2018-06-25 12:45:53 -040030 to create a working setup that scales across a large team.
31 </para>
32
33 <para>
34 To help you understand how to set up this type of environment,
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080035 this section presents a procedure that gives you information
36 that can help you get the results you want.
Brad Bishop316dfdd2018-06-25 12:45:53 -040037 The procedure is high-level and presents some of the project's most
38 successful experiences, practices, solutions, and available
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080039 technologies that have proved to work well in the past.
Brad Bishop316dfdd2018-06-25 12:45:53 -040040 Keep in mind, the procedure here is a starting point.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080041 You can build off these steps and customize the procedure to fit any
Brad Bishop316dfdd2018-06-25 12:45:53 -040042 particular working environment and set of practices.
43 <orderedlist>
44 <listitem><para>
45 <emphasis>Determine Who is Going to be Developing:</emphasis>
46 You need to understand who is going to be doing anything
47 related to the Yocto Project and what their roles would be.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080048 Making this determination is essential to completing
Brad Bishop316dfdd2018-06-25 12:45:53 -040049 steps two and three, which are to get your equipment together
50 and set up your development environment's hardware topology.
51 </para>
52
53 <para>The following roles exist:
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080054 <itemizedlist>
55 <listitem><para>
56 <emphasis>Application Developer:</emphasis>
57 This type of developer does application level work
58 on top of an existing software stack.
59 </para></listitem>
60 <listitem><para>
61 <emphasis>Core System Developer:</emphasis>
62 This type of developer works on the contents of the
63 operating system image itself.
64 </para></listitem>
65 <listitem><para>
66 <emphasis>Build Engineer:</emphasis>
67 This type of developer manages Autobuilders and
68 releases.
69 Not all environments need a Build Engineer.
70 </para></listitem>
71 <listitem><para>
72 <emphasis>Test Engineer:</emphasis>
73 This type of developer creates and manages automated
74 tests that are used to ensure all application and
75 core system development meets desired quality
76 standards.
77 </para></listitem>
78 </itemizedlist>
Brad Bishop316dfdd2018-06-25 12:45:53 -040079 </para></listitem>
80 <listitem><para>
81 <emphasis>Gather the Hardware:</emphasis>
82 Based on the size and make-up of the team, get the hardware
83 together.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080084 Ideally, any development, build, or test engineer uses
85 a system that runs a supported Linux distribution.
86 These systems, in general, should be high performance
87 (e.g. dual, six-core Xeons with 24 Gbytes of RAM and plenty
88 of disk space).
Brad Bishop316dfdd2018-06-25 12:45:53 -040089 You can help ensure efficiency by having any machines used
90 for testing or that run Autobuilders be as high performance
91 as possible.
92 </para></listitem>
93 <listitem><para>
94 <emphasis>Understand the Hardware Topology of the Environment:</emphasis>
95 Once you understand the hardware involved and the make-up
96 of the team, you can understand the hardware topology of the
97 development environment.
98 You can get a visual idea of the machines and their roles
99 across the development environment.
100
101<!--
102 The following figure shows a moderately sized Yocto Project
103 development environment.
104
105 <para role="writernotes">
106 Need figure.</para>
107-->
108
109 </para></listitem>
110 <listitem><para>
111 <emphasis>Use Git as Your Source Control Manager (SCM):</emphasis>
112 Keeping your
113 <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800114 (i.e. recipes, configuration files, classes, and so forth)
115 and any software you are developing under the control of an SCM
116 system that is compatible with the OpenEmbedded build system
117 is advisable.
118 Of the SCMs BitBake supports, the Yocto Project team strongly
119 recommends using
Brad Bishop316dfdd2018-06-25 12:45:53 -0400120 <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>.
121 Git is a distributed system that is easy to backup,
122 allows you to work remotely, and then connects back to the
123 infrastructure.
124 <note>
125 For information about BitBake, see the
126 <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
127 </note></para>
128
129 <para>It is relatively easy to set up Git services and create
130 infrastructure like
131 <ulink url='&YOCTO_GIT_URL;'>http://git.yoctoproject.org</ulink>,
132 which is based on server software called
133 <filename>gitolite</filename> with <filename>cgit</filename>
134 being used to generate the web interface that lets you view the
135 repositories.
136 The <filename>gitolite</filename> software identifies users
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800137 using SSH keys and allows branch-based access controls to
138 repositories that you can control as little or as much as
139 necessary.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400140 <note>
141 The setup of these services is beyond the scope of this
142 manual.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800143 However, sites such as the following exist that describe
144 how to perform setup:
Brad Bishop316dfdd2018-06-25 12:45:53 -0400145 <itemizedlist>
146 <listitem><para>
147 <ulink url='http://git-scm.com/book/ch4-8.html'>Git documentation</ulink>:
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800148 Describes how to install
149 <filename>gitolite</filename> on the server.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400150 </para></listitem>
151 <listitem><para>
152 <ulink url='http://gitolite.com'>Gitolite</ulink>:
153 Information for <filename>gitolite</filename>.
154 </para></listitem>
155 <listitem><para>
156 <ulink url='https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools'>Interfaces, frontends, and tools</ulink>:
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800157 Documentation on how to create interfaces and
158 frontends for Git.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400159 </para></listitem>
160 </itemizedlist>
161 </note>
162 </para></listitem>
163 <listitem><para>
164 <emphasis>Set up the Application Development Machines:</emphasis>
165 As mentioned earlier, application developers are creating
166 applications on top of existing software stacks.
167 Following are some best practices for setting up machines
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800168 used for application development:
Brad Bishop316dfdd2018-06-25 12:45:53 -0400169 <itemizedlist>
170 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800171 Use a pre-built toolchain that contains the software
172 stack itself.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400173 Then, develop the application code on top of the
174 stack.
175 This method works well for small numbers of relatively
176 isolated applications.
177 </para></listitem>
178 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800179 When possible, use the Yocto Project plug-in for the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400180 <trademark class='trade'>Eclipse</trademark> IDE
181 and SDK development practices.
182 For more information, see the
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800183 <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400184 manual.
185 </para></listitem>
186 <listitem><para>
187 Keep your cross-development toolchains updated.
188 You can do this through provisioning either as new
189 toolchain downloads or as updates through a package
190 update mechanism using <filename>opkg</filename>
191 to provide updates to an existing toolchain.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800192 The exact mechanics of how and when to do this depend
193 on local policy.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400194 </para></listitem>
195 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800196 Use multiple toolchains installed locally into
197 different locations to allow development across
Brad Bishop316dfdd2018-06-25 12:45:53 -0400198 versions.
199 </para></listitem>
200 </itemizedlist>
201 </para></listitem>
202 <listitem><para>
203 <emphasis>Set up the Core Development Machines:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800204 As mentioned earlier, core developers work on the contents of
205 the operating system itself.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400206 Following are some best practices for setting up machines
207 used for developing images:
208 <itemizedlist>
209 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800210 Have the
211 <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
212 available on the developer workstations so developers
213 can run their own builds and directly rebuild the
214 software stack.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400215 </para></listitem>
216 <listitem><para>
217 Keep the core system unchanged as much as
218 possible and do your work in layers on top of the
219 core system.
220 Doing so gives you a greater level of portability when
221 upgrading to new versions of the core system or Board
222 Support Packages (BSPs).
223 </para></listitem>
224 <listitem><para>
225 Share layers amongst the developers of a
226 particular project and contain the policy configuration
227 that defines the project.
228 </para></listitem>
229 </itemizedlist>
230 </para></listitem>
231 <listitem><para>
232 <emphasis>Set up an Autobuilder:</emphasis>
233 Autobuilders are often the core of the development
234 environment.
235 It is here that changes from individual developers are brought
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800236 together and centrally tested.
237 Based on this automated build and test environment, subsequent
238 decisions about releases can be made.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400239 Autobuilders also allow for "continuous integration" style
240 testing of software components and regression identification
241 and tracking.</para>
242
243 <para>See "<ulink url='http://autobuilder.yoctoproject.org'>Yocto Project Autobuilder</ulink>"
244 for more information and links to buildbot.
245 The Yocto Project team has found this implementation
246 works well in this role.
247 A public example of this is the Yocto Project
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800248 Autobuilders, which the Yocto Project team uses to test the
249 overall health of the project.</para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400250
251 <para>The features of this system are:
252 <itemizedlist>
253 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800254 Highlights when commits break the build.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400255 </para></listitem>
256 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800257 Populates an
258 <ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate cache</ulink>
259 from which developers can pull rather than requiring
260 local builds.
261 </para></listitem>
262 <listitem><para>
263 Allows commit hook triggers, which trigger builds when
264 commits are made.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400265 </para></listitem>
266 <listitem><para>
267 Allows triggering of automated image booting
268 and testing under the QuickEMUlator (QEMU).
269 </para></listitem>
270 <listitem><para>
271 Supports incremental build testing and
272 from-scratch builds.
273 </para></listitem>
274 <listitem><para>
275 Shares output that allows developer
276 testing and historical regression investigation.
277 </para></listitem>
278 <listitem><para>
279 Creates output that can be used for releases.
280 </para></listitem>
281 <listitem><para>
282 Allows scheduling of builds so that resources
283 can be used efficiently.
284 </para></listitem>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800285 </itemizedlist>
286 </para></listitem>
287 <listitem><para>
288 <emphasis>Set up Test Machines:</emphasis>
289 Use a small number of shared, high performance systems
290 for testing purposes.
291 Developers can use these systems for wider, more
292 extensive testing while they continue to develop
293 locally using their primary development system.
294 </para></listitem>
295 <listitem><para>
296 <emphasis>Document Policies and Change Flow:</emphasis>
297 The Yocto Project uses a hierarchical structure and a
Brad Bishop316dfdd2018-06-25 12:45:53 -0400298 pull model.
299 Scripts exist to create and send pull requests
300 (i.e. <filename>create-pull-request</filename> and
301 <filename>send-pull-request</filename>).
302 This model is in line with other open source projects where
303 maintainers are responsible for specific areas of the project
304 and a single maintainer handles the final "top-of-tree" merges.
305 <note>
306 You can also use a more collective push model.
307 The <filename>gitolite</filename> software supports both the
308 push and pull models quite easily.
309 </note></para>
310
311 <para>As with any development environment, it is important
312 to document the policy used as well as any main project
313 guidelines so they are understood by everyone.
314 It is also a good idea to have well structured
315 commit messages, which are usually a part of a project's
316 guidelines.
317 Good commit messages are essential when looking back in time and
318 trying to understand why changes were made.</para>
319
320 <para>If you discover that changes are needed to the core
321 layer of the project, it is worth sharing those with the
322 community as soon as possible.
323 Chances are if you have discovered the need for changes,
324 someone else in the community needs them also.
325 </para></listitem>
326 <listitem><para>
327 <emphasis>Development Environment Summary:</emphasis>
328 Aside from the previous steps, some best practices exist
329 within the Yocto Project development environment.
330 Consider the following:
331 <itemizedlist>
332 <listitem><para>
333 Use
334 <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>
335 as the source control system.
336 </para></listitem>
337 <listitem><para>
338 Maintain your Metadata in layers that make sense
339 for your situation.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800340 See the
341 "<ulink url='&YOCTO_DOCS_OM_URL;#the-yocto-project-layer-model'>The Yocto Project Layer Model</ulink>"
342 section in the Yocto Project Overview and Concepts
343 Manual and the
344 "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>"
345 section for more information on layers.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400346 </para></listitem>
347 <listitem><para>
348 Separate the project's Metadata and code by using
349 separate Git repositories.
350 See the
351 "<ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800352 section in the Yocto Project Overview and Concepts
353 Manual for information on these repositories.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400354 See the
355 "<link linkend='locating-yocto-project-source-files'>Locating Yocto Project Source Files</link>"
356 section for information on how to set up local Git
357 repositories for related upstream Yocto Project
358 Git repositories.
359 </para></listitem>
360 <listitem><para>
361 Set up the directory for the shared state cache
362 (<ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>)
363 where it makes sense.
364 For example, set up the sstate cache on a system used
365 by developers in the same organization and share the
366 same source directories on their machines.
367 </para></listitem>
368 <listitem><para>
369 Set up an Autobuilder and have it populate the
370 sstate cache and source directories.
371 </para></listitem>
372 <listitem><para>
373 The Yocto Project community encourages you
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800374 to send patches to the project to fix bugs or add
375 features.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400376 If you do submit patches, follow the project commit
377 guidelines for writing good commit messages.
378 See the "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
379 section.
380 </para></listitem>
381 <listitem><para>
382 Send changes to the core sooner than later
383 as others are likely to run into the same issues.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800384 For some guidance on mailing lists to use, see the list
385 in the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400386 "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
387 section.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800388 For a description of the available mailing lists, see
389 the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400390 "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>"
391 section in the Yocto Project Reference Manual.
392 </para></listitem>
393 </itemizedlist>
394 </para></listitem>
395 </orderedlist>
396 </para>
397</section>
398
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800399<section id='dev-preparing-the-build-host'>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400400 <title>Preparing the Build Host</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500401
402 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800403 This section provides procedures to set up a system to be used as your
404 <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>
405 for development using the Yocto Project.
406 Your build host can be a native Linux machine (recommended) or it can
407 be a machine (Linux, Mac, or Windows) that uses
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500408 <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
409 which leverages
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800410 <ulink url='https://www.docker.com/'>Docker Containers</ulink>.
411 <note>
412 You cannot use a build host that is using the
413 <ulink url='https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux'>Windows Subsystem for Linux</ulink>
414 (WSL).
415 The Yocto Project is not compatible with WSL.
416 </note>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500417 </para>
418
419 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800420 Once your build host is set up to use the Yocto Project,
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500421 further steps are necessary depending on what you want to
422 accomplish.
423 See the following references for information on how to prepare for
424 Board Support Package (BSP) development, kernel development, and
425 development using the <trademark class='trade'>Eclipse</trademark> IDE:
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500426 <itemizedlist>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500427 <listitem><para>
428 <emphasis>BSP Development:</emphasis>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500429 See the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500430 "<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 -0500431 section in the Yocto Project Board Support Package (BSP)
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500432 Developer's Guide.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500433 </para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500434 <listitem><para>
435 <emphasis>Kernel Development:</emphasis>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500436 See the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500437 "<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>"
438 section in the Yocto Project Linux Kernel Development Manual.
439 </para></listitem>
440 <listitem><para>
441 <emphasis>Eclipse Development:</emphasis>
442 See the
443 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-eclipse-project'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></ulink>"
444 Chapter in the Yocto Project Application Development and the
445 Extensible Software Development Kit (eSDK) manual.
446 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500447 </itemizedlist>
448 </para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500449
450 <section id='setting-up-a-native-linux-host'>
451 <title>Setting Up a Native Linux Host</title>
452
453 <para>
454 Follow these steps to prepare a native Linux machine as your
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800455 Yocto Project Build Host:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500456 <orderedlist>
457 <listitem><para>
458 <emphasis>Use a Supported Linux Distribution:</emphasis>
459 You should have a reasonably current Linux-based host
460 system.
461 You will have the best results with a recent release of
462 Fedora, openSUSE, Debian, Ubuntu, or CentOS as these
463 releases are frequently tested against the Yocto Project
464 and officially supported.
465 For a list of the distributions under validation and their
466 status, see the
467 "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section
468 in the Yocto Project Reference Manual and the wiki page at
469 <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>.
470 </para></listitem>
471 <listitem><para>
472 <emphasis>Have Enough Free Memory:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800473 Your system should have at least 50 Gbytes of free disk
474 space for building images.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500475 </para></listitem>
476 <listitem><para>
477 <emphasis>Meet Minimal Version Requirements:</emphasis>
478 The OpenEmbedded build system should be able to run on any
479 modern distribution that has the following versions for
480 Git, tar, and Python.
481 <itemizedlist>
482 <listitem><para>
483 Git 1.8.3.1 or greater
484 </para></listitem>
485 <listitem><para>
486 tar 1.27 or greater
487 </para></listitem>
488 <listitem><para>
489 Python 3.4.0 or greater.
490 </para></listitem>
491 </itemizedlist>
492 If your build host does not meet any of these three listed
493 version requirements, you can take steps to prepare the
494 system so that you can still use the Yocto Project.
495 See the
496 "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
497 section in the Yocto Project Reference Manual for
498 information.
499 </para></listitem>
500 <listitem><para>
501 <emphasis>Install Development Host Packages:</emphasis>
502 Required development host packages vary depending on your
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800503 build host and what you want to do with the Yocto
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500504 Project.
505 Collectively, the number of required packages is large
506 if you want to be able to cover all cases.</para>
507
508 <para>For lists of required packages for all scenarios,
509 see the
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800510 "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-build-host'>Required Packages for the Build Host</ulink>"
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500511 section in the Yocto Project Reference Manual.
512 </para></listitem>
513 </orderedlist>
514 Once you have completed the previous steps, you are ready to
515 continue using a given development path on your native Linux
516 machine.
517 If you are going to use BitBake, see the
518 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
519 section.
520 If you are going to use the Extensible SDK, see the
521 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
522 Chapter in the Yocto Project Application Development and the
523 Extensible Software Development Kit (eSDK) manual.
524 If you want to work on the kernel, see the
525 <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
526 If you are going to use Toaster, see the
527 "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
528 section in the Toaster User Manual.
529 </para>
530 </section>
531
532 <section id='setting-up-to-use-crops'>
533 <title>Setting Up to Use CROss PlatformS (CROPS)</title>
534
535 <para>
536 With
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800537 <ulink url='https://github.com/crops/crops/blob/master/README.md'>CROPS</ulink>,
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500538 which leverages
539 <ulink url='https://www.docker.com/'>Docker Containers</ulink>,
540 you can create a Yocto Project development environment that
541 is operating system agnostic.
542 You can set up a container in which you can develop using the
543 Yocto Project on a Windows, Mac, or Linux machine.
544 </para>
545
546 <para>
547 Follow these general steps to prepare a Windows, Mac, or Linux
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800548 machine as your Yocto Project build host:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500549 <orderedlist>
550 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800551 <emphasis>Determine What Your Build Host Needs:</emphasis>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500552 <ulink url='https://www.docker.com/what-docker'>Docker</ulink>
553 is a software container platform that you need to install
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800554 on the build host.
555 Depending on your build host, you might have to install
556 different software to support Docker containers.
557 Go to the Docker installation page and read about the
558 platform requirements in
559 "<ulink url='https://docs.docker.com/install/#supported-platforms'>Supported Platforms</ulink>"
560 your build host needs to run containers.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500561 </para></listitem>
562 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800563 <emphasis>Choose What To Install:</emphasis>
564 Depending on whether or not your build host meets system
565 requirements, you need to install "Docker CE Stable" or
566 the "Docker Toolbox".
567 Most situations call for Docker CE.
568 However, if you have a build host that does not meet
569 requirements (e.g. Pre-Windows 10 or Windows 10 "Home"
570 version), you must install Docker Toolbox instead.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500571 </para></listitem>
572 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400573 <emphasis>Go to the Install Site for Your Platform:</emphasis>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500574 Click the link for the Docker edition associated with
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800575 your build host's native software.
576 For example, if your build host is running Microsoft
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500577 Windows Version 10 and you want the Docker CE Stable
578 edition, click that link under "Supported Platforms".
579 </para></listitem>
580 <listitem><para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500581 <emphasis>Install the Software:</emphasis>
582 Once you have understood all the pre-requisites, you can
583 download and install the appropriate software.
584 Follow the instructions for your specific machine and
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800585 the type of the software you need to install:
586 <itemizedlist>
587 <listitem><para>
588 Install
589 <ulink url='https://docs.docker.com/docker-for-windows/install/#install-docker-for-windows-desktop-app'>Docker CE for Windows</ulink>
590 for Windows build hosts that meet requirements.
591 </para></listitem>
592 <listitem><para>
593 Install
594 <ulink url='https://docs.docker.com/docker-for-mac/install/#install-and-run-docker-for-mac'>Docker CE for Macs</ulink>
595 for Mac build hosts that meet requirements.
596 </para></listitem>
597 <listitem><para>
598 Install
599 <ulink url='https://docs.docker.com/toolbox/toolbox_install_windows/'>Docker Toolbox for Windows</ulink>
600 for Windows build hosts that do not meet Docker
601 requirements.
602 </para></listitem>
603 <listitem><para>
604 Install
605 <ulink url='https://docs.docker.com/toolbox/toolbox_install_mac/'>Docker Toolbox for MacOS</ulink>
606 for Mac build hosts that do not meet Docker
607 requirements.
608 </para></listitem>
609 <listitem><para>
610 Install
611 <ulink url='https://docs.docker.com/install/linux/docker-ce/centos/'>Docker CE for CentOS</ulink>
612 for Linux build hosts running the CentOS
613 distribution.
614 </para></listitem>
615 <listitem><para>
616 Install
617 <ulink url='https://docs.docker.com/install/linux/docker-ce/debian/'>Docker CE for Debian</ulink>
618 for Linux build hosts running the Debian
619 distribution.
620 </para></listitem>
621 <listitem><para>
622 Install
623 <ulink url='https://docs.docker.com/install/linux/docker-ce/fedora/'>Docker CE for Fedora</ulink>
624 for Linux build hosts running the Fedora
625 distribution.
626 </para></listitem>
627 <listitem><para>
628 Install
629 <ulink url='https://docs.docker.com/install/linux/docker-ce/ubuntu/'>Docker CE for Ubuntu</ulink>
630 for Linux build hosts running the Ubuntu
631 distribution.
632 </para></listitem>
633 </itemizedlist>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500634 </para></listitem>
635 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400636 <emphasis>Optionally Orient Yourself With Docker:</emphasis>
637 If you are unfamiliar with Docker and the container
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500638 concept, you can learn more here -
639 <ulink url='https://docs.docker.com/get-started/'></ulink>.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800640 </para></listitem>
641 <listitem><para>
642 <emphasis>Launch Docker or Docker Toolbox:</emphasis>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500643 You should be able to launch Docker or the Docker Toolbox
644 and have a terminal shell on your development host.
645 </para></listitem>
646 <listitem><para>
647 <emphasis>Set Up the Containers to Use the Yocto Project:</emphasis>
648 Go to
649 <ulink url='https://github.com/crops/docker-win-mac-docs/wiki'></ulink>
650 and follow the directions for your particular
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800651 build host (i.e. Linux, Mac, or Windows).</para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500652
653 <para>Once you complete the setup instructions for your
654 machine, you have the Poky, Extensible SDK, and Toaster
655 containers available.
656 You can click those links from the page and learn more
657 about using each of those containers.
658 </para></listitem>
659 </orderedlist>
660 Once you have a container set up, everything is in place to
661 develop just as if you were running on a native Linux machine.
662 If you are going to use the Poky container, see the
663 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
664 section.
665 If you are going to use the Extensible SDK container, see the
666 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
667 Chapter in the Yocto Project Application Development and the
668 Extensible Software Development Kit (eSDK) manual.
669 If you are going to use the Toaster container, see the
670 "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
671 section in the Toaster User Manual.
672 </para>
673 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500674</section>
675
Brad Bishop316dfdd2018-06-25 12:45:53 -0400676<section id='locating-yocto-project-source-files'>
677 <title>Locating Yocto Project Source Files</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500678
679 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800680 This section shows you how to locate and access the
681 source files that ship with the Yocto Project.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500682 You establish and use these local files to work on projects.
683 <note><title>Notes</title>
684 <itemizedlist>
685 <listitem><para>
686 For concepts and introductory information about Git as it
687 is used in the Yocto Project, see the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400688 "<ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>"
689 section in the Yocto Project Overview and Concepts Manual.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500690 </para></listitem>
691 <listitem><para>
692 For concepts on Yocto Project source repositories, see the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400693 "<ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
694 section in the Yocto Project Overview and Concepts Manual."
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500695 </para></listitem>
696 </itemizedlist>
697 </note>
698 </para>
699
700 <section id='accessing-source-repositories'>
701 <title>Accessing Source Repositories</title>
702
703 <para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400704 Working from a copy of the upstream Yocto Project
705 <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
706 is the preferred method for obtaining and using a Yocto Project
707 release.
708 You can view the Yocto Project Source Repositories at
709 <ulink url='&YOCTO_GIT_URL;'></ulink>.
710 In particular, you can find the
711 <filename>poky</filename> repository at
712 <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/'></ulink>.
713 </para>
714
715 <para>
716 Use the following procedure to locate the latest upstream copy of
717 the <filename>poky</filename> Git repository:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500718 <orderedlist>
719 <listitem><para>
720 <emphasis>Access Repositories:</emphasis>
721 Open a browser and go to
722 <ulink url='&YOCTO_GIT_URL;'></ulink> to access the
723 GUI-based interface into the Yocto Project source
724 repositories.
725 </para></listitem>
726 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400727 <emphasis>Select the Repository:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800728 Click on the repository in which you are interested (e.g.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500729 <filename>poky</filename>).
730 </para></listitem>
731 <listitem><para>
732 <emphasis>Find the URL Used to Clone the Repository:</emphasis>
733 At the bottom of the page, note the URL used to
Brad Bishop316dfdd2018-06-25 12:45:53 -0400734 <ulink url='&YOCTO_DOCS_OM_URL;#git-commands-clone'>clone</ulink>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500735 that repository (e.g.
736 <filename>&YOCTO_GIT_URL;/poky</filename>).
Brad Bishop316dfdd2018-06-25 12:45:53 -0400737 <note>
738 For information on cloning a repository, see the
739 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
740 section.
741 </note>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500742 </para></listitem>
743 </orderedlist>
744 </para>
745 </section>
746
747 <section id='accessing-index-of-releases'>
748 <title>Accessing Index of Releases</title>
749
750 <para>
751 Yocto Project maintains an Index of Releases area that contains
752 related files that contribute to the Yocto Project.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400753 Rather than Git repositories, these files are tarballs that
754 represent snapshots in time of a given component.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500755 <note><title>Tip</title>
756 The recommended method for accessing Yocto Project
Brad Bishop316dfdd2018-06-25 12:45:53 -0400757 components is to use Git to clone the upstream repository and
758 work from within that locally cloned repository.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500759 The procedure in this section exists should you desire a
760 tarball snapshot of any given component.
761 </note>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800762 Follow these steps to locate and download a particular tarball:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500763 <orderedlist>
764 <listitem><para>
765 <emphasis>Access the Index of Releases:</emphasis>
766 Open a browser and go to
767 <ulink url='&YOCTO_DL_URL;/releases'></ulink> to access the
768 Index of Releases.
769 The list represents released components (e.g.
770 <filename>eclipse-plugin</filename>,
771 <filename>sato</filename>, and so on).
772 <note>
773 The <filename>yocto</filename> directory contains the
774 full array of released Poky tarballs.
775 The <filename>poky</filename> directory in the
776 Index of Releases was historically used for very
Brad Bishop316dfdd2018-06-25 12:45:53 -0400777 early releases and exists now only for retroactive
778 completeness.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500779 </note>
780 </para></listitem>
781 <listitem><para>
782 <emphasis>Select a Component:</emphasis>
783 Click on any released component in which you are interested
784 (e.g. <filename>yocto</filename>).
785 </para></listitem>
786 <listitem><para>
787 <emphasis>Find the Tarball:</emphasis>
788 Drill down to find the associated tarball.
789 For example, click on <filename>yocto-&DISTRO;</filename> to
790 view files associated with the Yocto Project &DISTRO;
791 release (e.g. <filename>poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;.tar.bz2</filename>,
792 which is the released Poky tarball).
793 </para></listitem>
794 <listitem><para>
795 <emphasis>Download the Tarball:</emphasis>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400796 Click the tarball to download and save a snapshot of the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500797 given component.
798 </para></listitem>
799 </orderedlist>
800 </para>
801 </section>
802
803 <section id='using-the-downloads-page'>
804 <title>Using the Downloads Page</title>
805
806 <para>
807 The
808 <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400809 uses a "DOWNLOADS" page from which you can locate and download
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500810 tarballs of any Yocto Project release.
811 Rather than Git repositories, these files represent snapshot
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800812 tarballs similar to the tarballs located in the Index of Releases
813 described in the
814 "<link linkend='accessing-index-of-releases'>Accessing Index of Releases</link>"
815 section.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500816 <note><title>Tip</title>
817 The recommended method for accessing Yocto Project
818 components is to use Git to clone a repository and work from
819 within that local repository.
820 The procedure in this section exists should you desire a
821 tarball snapshot of any given component.
822 </note>
823 <orderedlist>
824 <listitem><para>
825 <emphasis>Go to the Yocto Project Website:</emphasis>
826 Open The
827 <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
828 in your browser.
829 </para></listitem>
830 <listitem><para>
831 <emphasis>Get to the Downloads Area:</emphasis>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400832 Select the "DOWNLOADS" item from the pull-down
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800833 "SOFTWARE" tab menu near the top of the page.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500834 </para></listitem>
835 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400836 <emphasis>Select a Yocto Project Release:</emphasis>
837 Use the menu next to "RELEASE" to display and choose
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800838 a recent or past supported Yocto Project release
839 (e.g. &DISTRO_NAME_NO_CAP;,
840 &DISTRO_NAME_NO_CAP_MINUS_ONE;, and so forth).
841 <note><title>Tip</title>
842 For a "map" of Yocto Project releases to version
843 numbers, see the
844 <ulink url='https://wiki.yoctoproject.org/wiki/Releases'>Releases</ulink>
845 wiki page.
846 </note>
847 You can use the "RELEASE ARCHIVE" link to reveal a menu of
848 all Yocto Project releases.
849 </para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500850 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400851 <emphasis>Download Tools or Board Support Packages (BSPs):</emphasis>
852 From the "DOWNLOADS" page, you can download tools or
853 BSPs as well.
854 Just scroll down the page and look for what you need.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500855 </para></listitem>
856 </orderedlist>
857 </para>
858 </section>
859
Brad Bishop316dfdd2018-06-25 12:45:53 -0400860 <section id='accessing-nightly-builds'>
861 <title>Accessing Nightly Builds</title>
862
863 <para>
864 Yocto Project maintains an area for nightly builds that contains
865 tarball releases at <ulink url='&YOCTO_AB_NIGHTLY_URL;'/>.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800866 These builds include Yocto Project releases ("poky"),
867 toolchains, Yocto Project plugins for Eclipse, and builds for
868 supported machines.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400869 </para>
870
871 <para>
872 Should you ever want to access a nightly build of a particular
873 Yocto Project component, use the following procedure:
874 <orderedlist>
875 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800876 <emphasis>Locate the Index of Nightly Builds:</emphasis>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400877 Open a browser and go to
878 <ulink url='&YOCTO_AB_NIGHTLY_URL;'/> to access the
879 Nightly Builds.
880 </para></listitem>
881 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800882 <emphasis>Select a Date:</emphasis>
883 Click on the date in which you are interested.
884 If you want the latest builds, use "CURRENT".
885 </para></listitem>
886 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400887 <emphasis>Select a Build:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800888 Choose the area in which you are interested.
889 For example, if you are looking for the most recent
890 toolchains, select the "toolchain" link.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400891 </para></listitem>
892 <listitem><para>
893 <emphasis>Find the Tarball:</emphasis>
894 Drill down to find the associated tarball.
895 </para></listitem>
896 <listitem><para>
897 <emphasis>Download the Tarball:</emphasis>
898 Click the tarball to download and save a snapshot of the
899 given component.
900 </para></listitem>
901 </orderedlist>
902 </para>
903 </section>
904</section>
905
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800906<section id='cloning-and-checking-out-branches'>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400907 <title>Cloning and Checking Out Branches</title>
908
909 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800910 To use the Yocto Project for development, you need a release locally
911 installed on your development system.
912 This locally installed set of files is referred to as the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400913 <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
914 in the Yocto Project documentation.
915 </para>
916
917 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800918 The preferred method of creating your Source Directory is by using
Brad Bishop316dfdd2018-06-25 12:45:53 -0400919 <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink> to clone a local
920 copy of the upstream <filename>poky</filename> repository.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800921 Working from a cloned copy of the upstream repository allows you
922 to contribute back into the Yocto Project or to simply work with
Brad Bishop316dfdd2018-06-25 12:45:53 -0400923 the latest software on a development branch.
924 Because Git maintains and creates an upstream repository with
925 a complete history of changes and you are working with a local
926 clone of that repository, you have access to all the Yocto
927 Project development branches and tag names used in the upstream
928 repository.
929 </para>
930
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500931 <section id='cloning-the-poky-repository'>
932 <title>Cloning the <filename>poky</filename> Repository</title>
933
934 <para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500935 Follow these steps to create a local version of the
936 upstream
937 <ulink url='&YOCTO_DOCS_REF_URL;#poky'><filename>poky</filename></ulink>
938 Git repository.
939 <orderedlist>
940 <listitem><para>
941 <emphasis>Set Your Directory:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800942 Change your working directory to where you want to
943 create your local copy of
944 <filename>poky</filename>.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500945 </para></listitem>
946 <listitem><para>
947 <emphasis>Clone the Repository:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800948 The following example command clones the
949 <filename>poky</filename> repository and uses
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500950 the default name "poky" for your local repository:
951 <literallayout class='monospaced'>
952 $ git clone git://git.yoctoproject.org/poky
953 Cloning into 'poky'...
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800954 remote: Counting objects: 416542, done.
955 remote: Compressing objects: 100% (98611/98611), done.
956 remote: Total 416542 (delta 311104), reused 416377 (delta 310939)
957 Receiving objects: 100% (416542/416542), 150.39 MiB | 15.77 MiB/s, done.
958 Resolving deltas: 100% (311104/311104), done.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500959 Checking connectivity... done.
960 </literallayout>
961 Unless you specify a specific development branch or
962 tag name, Git clones the "master" branch, which results
963 in a snapshot of the latest development changes for
964 "master".
965 For information on how to check out a specific
966 development branch or on how to check out a local
967 branch based on a tag name, see the
968 "<link linkend='checking-out-by-branch-in-poky'>Checking Out By Branch in Poky</link>"
969 and
Brad Bishop316dfdd2018-06-25 12:45:53 -0400970 <link linkend='checkout-out-by-tag-in-poky'>Checking Out By Tag in Poky</link>"
971 sections, respectively.</para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500972
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800973 <para>Once the local repository is created, you can
974 change to that directory and check its status.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500975 Here, the single "master" branch exists on your system
976 and by default, it is checked out:
977 <literallayout class='monospaced'>
978 $ cd ~/poky
979 $ git status
980 On branch master
981 Your branch is up-to-date with 'origin/master'.
982 nothing to commit, working directory clean
983 $ git branch
984 * master
985 </literallayout>
986 Your local repository of poky is identical to the
987 upstream poky repository at the time from which it was
988 cloned.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800989 As you work with the local branch, you can periodically
990 use the <filename>git pull &dash;&dash;rebase</filename>
991 command to be sure you are up-to-date with the upstream
992 branch.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500993 </para></listitem>
994 </orderedlist>
995 </para>
996 </section>
997
998 <section id='checking-out-by-branch-in-poky'>
999 <title>Checking Out by Branch in Poky</title>
1000
1001 <para>
1002 When you clone the upstream poky repository, you have access to
1003 all its development branches.
1004 Each development branch in a repository is unique as it forks
1005 off the "master" branch.
1006 To see and use the files of a particular development branch
1007 locally, you need to know the branch name and then specifically
1008 check out that development branch.
1009 <note>
1010 Checking out an active development branch by branch name
1011 gives you a snapshot of that particular branch at the time
1012 you check it out.
1013 Further development on top of the branch that occurs after
1014 check it out can occur.
1015 </note>
1016 <orderedlist>
1017 <listitem><para>
1018 <emphasis>Switch to the Poky Directory:</emphasis>
1019 If you have a local poky Git repository, switch to that
1020 directory.
1021 If you do not have the local copy of poky, see the
1022 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
1023 section.
1024 </para></listitem>
1025 <listitem><para>
1026 <emphasis>Determine Existing Branch Names:</emphasis>
1027 <literallayout class='monospaced'>
1028 $ git branch -a
1029 * master
1030 remotes/origin/1.1_M1
1031 remotes/origin/1.1_M2
1032 remotes/origin/1.1_M3
1033 remotes/origin/1.1_M4
1034 remotes/origin/1.2_M1
1035 remotes/origin/1.2_M2
1036 remotes/origin/1.2_M3
1037 .
1038 .
1039 .
1040 remotes/origin/master-next
1041 remotes/origin/master-next2
1042 remotes/origin/morty
1043 remotes/origin/pinky
1044 remotes/origin/purple
1045 remotes/origin/pyro
1046 remotes/origin/rocko
1047 </literallayout>
1048 </para></listitem>
1049 <listitem><para>
1050 <emphasis>Checkout the Branch:</emphasis>
1051 Checkout the development branch in which you want to work.
1052 For example, to access the files for the Yocto Project
1053 &DISTRO; Release (&DISTRO_NAME;), use the following command:
1054 <literallayout class='monospaced'>
1055 $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
1056 Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
1057 Switched to a new branch '&DISTRO_NAME_NO_CAP;'
1058 </literallayout>
1059 The previous command checks out the "&DISTRO_NAME_NO_CAP;"
1060 development branch and reports that the branch is tracking
1061 the upstream "origin/&DISTRO_NAME_NO_CAP;" branch.</para>
1062
1063 <para>The following command displays the branches
1064 that are now part of your local poky repository.
1065 The asterisk character indicates the branch that is
1066 currently checked out for work:
1067 <literallayout class='monospaced'>
1068 $ git branch
1069 master
1070 * &DISTRO_NAME_NO_CAP;
1071 </literallayout>
1072 </para></listitem>
1073 </orderedlist>
1074 </para>
1075 </section>
1076
1077 <section id='checkout-out-by-tag-in-poky'>
1078 <title>Checking Out by Tag in Poky</title>
1079
1080 <para>
1081 Similar to branches, the upstream repository uses tags
1082 to mark specific commits associated with significant points in
1083 a development branch (i.e. a release point or stage of a
1084 release).
1085 You might want to set up a local branch based on one of those
1086 points in the repository.
1087 The process is similar to checking out by branch name except you
1088 use tag names.
1089 <note>
1090 Checking out a branch based on a tag gives you a
1091 stable set of files not affected by development on the
1092 branch above the tag.
1093 </note>
1094 <orderedlist>
1095 <listitem><para>
1096 <emphasis>Switch to the Poky Directory:</emphasis>
1097 If you have a local poky Git repository, switch to that
1098 directory.
1099 If you do not have the local copy of poky, see the
1100 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
1101 section.
1102 </para></listitem>
1103 <listitem><para>
1104 <emphasis>Fetch the Tag Names:</emphasis>
1105 To checkout the branch based on a tag name, you need to
1106 fetch the upstream tags into your local repository:
1107 <literallayout class='monospaced'>
1108 $ git fetch --tags
1109 $
1110 </literallayout>
1111 </para></listitem>
1112 <listitem><para>
1113 <emphasis>List the Tag Names:</emphasis>
1114 You can list the tag names now:
1115 <literallayout class='monospaced'>
1116 $ git tag
1117 1.1_M1.final
1118 1.1_M1.rc1
1119 1.1_M1.rc2
1120 1.1_M2.final
1121 1.1_M2.rc1
1122 .
1123 .
1124 .
1125 yocto-2.2
1126 yocto-2.2.1
1127 yocto-2.3
1128 yocto-2.3.1
1129 yocto-2.4
1130 yocto_1.5_M5.rc8
1131 </literallayout>
1132 </para></listitem>
1133 <listitem><para>
1134 <emphasis>Checkout the Branch:</emphasis>
1135 <literallayout class='monospaced'>
Brad Bishop316dfdd2018-06-25 12:45:53 -04001136 $ git checkout tags/&DISTRO_REL_TAG; -b my_yocto_&DISTRO;
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001137 Switched to a new branch 'my_yocto_&DISTRO;'
1138 $ git branch
1139 master
1140 * my_yocto_&DISTRO;
1141 </literallayout>
1142 The previous command creates and checks out a local
1143 branch named "my_yocto_&DISTRO;", which is based on
1144 the commit in the upstream poky repository that has
1145 the same tag.
1146 In this example, the files you have available locally
1147 as a result of the <filename>checkout</filename>
1148 command are a snapshot of the
1149 "&DISTRO_NAME_NO_CAP;" development branch at the point
1150 where Yocto Project &DISTRO; was released.
1151 </para></listitem>
1152 </orderedlist>
1153 </para>
1154 </section>
1155</section>
1156
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001157</chapter>
1158<!--
1159vim: expandtab tw=80 ts=4
1160-->