blob: 5625dfcdd454e6fde2724087fc1774aee88fd376 [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
Brad Bishop19323692019-04-05 15:28:33 -040047 related to the Yocto Project and determine their roles.
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 Bishop316dfdd2018-06-25 12:45:53 -0400179 Keep your cross-development toolchains updated.
180 You can do this through provisioning either as new
181 toolchain downloads or as updates through a package
182 update mechanism using <filename>opkg</filename>
183 to provide updates to an existing toolchain.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800184 The exact mechanics of how and when to do this depend
185 on local policy.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400186 </para></listitem>
187 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800188 Use multiple toolchains installed locally into
189 different locations to allow development across
Brad Bishop316dfdd2018-06-25 12:45:53 -0400190 versions.
191 </para></listitem>
192 </itemizedlist>
193 </para></listitem>
194 <listitem><para>
195 <emphasis>Set up the Core Development Machines:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800196 As mentioned earlier, core developers work on the contents of
197 the operating system itself.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400198 Following are some best practices for setting up machines
199 used for developing images:
200 <itemizedlist>
201 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800202 Have the
203 <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
204 available on the developer workstations so developers
205 can run their own builds and directly rebuild the
206 software stack.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400207 </para></listitem>
208 <listitem><para>
209 Keep the core system unchanged as much as
210 possible and do your work in layers on top of the
211 core system.
212 Doing so gives you a greater level of portability when
213 upgrading to new versions of the core system or Board
214 Support Packages (BSPs).
215 </para></listitem>
216 <listitem><para>
217 Share layers amongst the developers of a
218 particular project and contain the policy configuration
219 that defines the project.
220 </para></listitem>
221 </itemizedlist>
222 </para></listitem>
223 <listitem><para>
224 <emphasis>Set up an Autobuilder:</emphasis>
225 Autobuilders are often the core of the development
226 environment.
227 It is here that changes from individual developers are brought
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800228 together and centrally tested.
229 Based on this automated build and test environment, subsequent
230 decisions about releases can be made.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400231 Autobuilders also allow for "continuous integration" style
232 testing of software components and regression identification
233 and tracking.</para>
234
235 <para>See "<ulink url='http://autobuilder.yoctoproject.org'>Yocto Project Autobuilder</ulink>"
236 for more information and links to buildbot.
237 The Yocto Project team has found this implementation
238 works well in this role.
239 A public example of this is the Yocto Project
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800240 Autobuilders, which the Yocto Project team uses to test the
241 overall health of the project.</para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400242
243 <para>The features of this system are:
244 <itemizedlist>
245 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800246 Highlights when commits break the build.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400247 </para></listitem>
248 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800249 Populates an
250 <ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate cache</ulink>
251 from which developers can pull rather than requiring
252 local builds.
253 </para></listitem>
254 <listitem><para>
255 Allows commit hook triggers, which trigger builds when
256 commits are made.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400257 </para></listitem>
258 <listitem><para>
259 Allows triggering of automated image booting
260 and testing under the QuickEMUlator (QEMU).
261 </para></listitem>
262 <listitem><para>
263 Supports incremental build testing and
264 from-scratch builds.
265 </para></listitem>
266 <listitem><para>
267 Shares output that allows developer
268 testing and historical regression investigation.
269 </para></listitem>
270 <listitem><para>
271 Creates output that can be used for releases.
272 </para></listitem>
273 <listitem><para>
274 Allows scheduling of builds so that resources
275 can be used efficiently.
276 </para></listitem>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800277 </itemizedlist>
278 </para></listitem>
279 <listitem><para>
280 <emphasis>Set up Test Machines:</emphasis>
281 Use a small number of shared, high performance systems
282 for testing purposes.
283 Developers can use these systems for wider, more
284 extensive testing while they continue to develop
285 locally using their primary development system.
286 </para></listitem>
287 <listitem><para>
288 <emphasis>Document Policies and Change Flow:</emphasis>
289 The Yocto Project uses a hierarchical structure and a
Brad Bishop316dfdd2018-06-25 12:45:53 -0400290 pull model.
291 Scripts exist to create and send pull requests
292 (i.e. <filename>create-pull-request</filename> and
293 <filename>send-pull-request</filename>).
294 This model is in line with other open source projects where
295 maintainers are responsible for specific areas of the project
296 and a single maintainer handles the final "top-of-tree" merges.
297 <note>
298 You can also use a more collective push model.
299 The <filename>gitolite</filename> software supports both the
300 push and pull models quite easily.
301 </note></para>
302
303 <para>As with any development environment, it is important
304 to document the policy used as well as any main project
305 guidelines so they are understood by everyone.
306 It is also a good idea to have well structured
307 commit messages, which are usually a part of a project's
308 guidelines.
309 Good commit messages are essential when looking back in time and
310 trying to understand why changes were made.</para>
311
312 <para>If you discover that changes are needed to the core
313 layer of the project, it is worth sharing those with the
314 community as soon as possible.
315 Chances are if you have discovered the need for changes,
316 someone else in the community needs them also.
317 </para></listitem>
318 <listitem><para>
319 <emphasis>Development Environment Summary:</emphasis>
320 Aside from the previous steps, some best practices exist
321 within the Yocto Project development environment.
322 Consider the following:
323 <itemizedlist>
324 <listitem><para>
325 Use
326 <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>
327 as the source control system.
328 </para></listitem>
329 <listitem><para>
330 Maintain your Metadata in layers that make sense
331 for your situation.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800332 See the
333 "<ulink url='&YOCTO_DOCS_OM_URL;#the-yocto-project-layer-model'>The Yocto Project Layer Model</ulink>"
334 section in the Yocto Project Overview and Concepts
335 Manual and the
336 "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>"
337 section for more information on layers.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400338 </para></listitem>
339 <listitem><para>
340 Separate the project's Metadata and code by using
341 separate Git repositories.
342 See the
343 "<ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800344 section in the Yocto Project Overview and Concepts
345 Manual for information on these repositories.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400346 See the
347 "<link linkend='locating-yocto-project-source-files'>Locating Yocto Project Source Files</link>"
348 section for information on how to set up local Git
349 repositories for related upstream Yocto Project
350 Git repositories.
351 </para></listitem>
352 <listitem><para>
353 Set up the directory for the shared state cache
354 (<ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>)
355 where it makes sense.
356 For example, set up the sstate cache on a system used
357 by developers in the same organization and share the
358 same source directories on their machines.
359 </para></listitem>
360 <listitem><para>
361 Set up an Autobuilder and have it populate the
362 sstate cache and source directories.
363 </para></listitem>
364 <listitem><para>
365 The Yocto Project community encourages you
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800366 to send patches to the project to fix bugs or add
367 features.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400368 If you do submit patches, follow the project commit
369 guidelines for writing good commit messages.
370 See the "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
371 section.
372 </para></listitem>
373 <listitem><para>
374 Send changes to the core sooner than later
375 as others are likely to run into the same issues.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800376 For some guidance on mailing lists to use, see the list
377 in the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400378 "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
379 section.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800380 For a description of the available mailing lists, see
381 the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400382 "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>"
383 section in the Yocto Project Reference Manual.
384 </para></listitem>
385 </itemizedlist>
386 </para></listitem>
387 </orderedlist>
388 </para>
389</section>
390
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800391<section id='dev-preparing-the-build-host'>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400392 <title>Preparing the Build Host</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500393
394 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800395 This section provides procedures to set up a system to be used as your
396 <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>
397 for development using the Yocto Project.
398 Your build host can be a native Linux machine (recommended) or it can
399 be a machine (Linux, Mac, or Windows) that uses
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500400 <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
401 which leverages
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800402 <ulink url='https://www.docker.com/'>Docker Containers</ulink>.
403 <note>
404 You cannot use a build host that is using the
405 <ulink url='https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux'>Windows Subsystem for Linux</ulink>
406 (WSL).
407 The Yocto Project is not compatible with WSL.
408 </note>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500409 </para>
410
411 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800412 Once your build host is set up to use the Yocto Project,
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500413 further steps are necessary depending on what you want to
414 accomplish.
415 See the following references for information on how to prepare for
Brad Bishopc342db32019-05-15 21:57:59 -0400416 Board Support Package (BSP) development and kernel development:
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500417 <itemizedlist>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500418 <listitem><para>
419 <emphasis>BSP Development:</emphasis>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500420 See the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500421 "<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 -0500422 section in the Yocto Project Board Support Package (BSP)
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500423 Developer's Guide.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500424 </para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500425 <listitem><para>
426 <emphasis>Kernel Development:</emphasis>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500427 See the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500428 "<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>"
429 section in the Yocto Project Linux Kernel Development Manual.
430 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500431 </itemizedlist>
432 </para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500433
434 <section id='setting-up-a-native-linux-host'>
435 <title>Setting Up a Native Linux Host</title>
436
437 <para>
438 Follow these steps to prepare a native Linux machine as your
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800439 Yocto Project Build Host:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500440 <orderedlist>
441 <listitem><para>
442 <emphasis>Use a Supported Linux Distribution:</emphasis>
443 You should have a reasonably current Linux-based host
444 system.
445 You will have the best results with a recent release of
446 Fedora, openSUSE, Debian, Ubuntu, or CentOS as these
447 releases are frequently tested against the Yocto Project
448 and officially supported.
449 For a list of the distributions under validation and their
450 status, see the
451 "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section
452 in the Yocto Project Reference Manual and the wiki page at
453 <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>.
454 </para></listitem>
455 <listitem><para>
456 <emphasis>Have Enough Free Memory:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800457 Your system should have at least 50 Gbytes of free disk
458 space for building images.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500459 </para></listitem>
460 <listitem><para>
461 <emphasis>Meet Minimal Version Requirements:</emphasis>
462 The OpenEmbedded build system should be able to run on any
463 modern distribution that has the following versions for
464 Git, tar, and Python.
465 <itemizedlist>
466 <listitem><para>
467 Git 1.8.3.1 or greater
468 </para></listitem>
469 <listitem><para>
470 tar 1.27 or greater
471 </para></listitem>
472 <listitem><para>
473 Python 3.4.0 or greater.
474 </para></listitem>
475 </itemizedlist>
476 If your build host does not meet any of these three listed
477 version requirements, you can take steps to prepare the
478 system so that you can still use the Yocto Project.
479 See the
480 "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
481 section in the Yocto Project Reference Manual for
482 information.
483 </para></listitem>
484 <listitem><para>
485 <emphasis>Install Development Host Packages:</emphasis>
486 Required development host packages vary depending on your
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800487 build host and what you want to do with the Yocto
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500488 Project.
489 Collectively, the number of required packages is large
490 if you want to be able to cover all cases.</para>
491
492 <para>For lists of required packages for all scenarios,
493 see the
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800494 "<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 -0500495 section in the Yocto Project Reference Manual.
496 </para></listitem>
497 </orderedlist>
498 Once you have completed the previous steps, you are ready to
499 continue using a given development path on your native Linux
500 machine.
501 If you are going to use BitBake, see the
502 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
503 section.
504 If you are going to use the Extensible SDK, see the
505 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
506 Chapter in the Yocto Project Application Development and the
507 Extensible Software Development Kit (eSDK) manual.
508 If you want to work on the kernel, see the
509 <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
510 If you are going to use Toaster, see the
511 "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
512 section in the Toaster User Manual.
513 </para>
514 </section>
515
516 <section id='setting-up-to-use-crops'>
517 <title>Setting Up to Use CROss PlatformS (CROPS)</title>
518
519 <para>
520 With
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800521 <ulink url='https://github.com/crops/crops/blob/master/README.md'>CROPS</ulink>,
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500522 which leverages
523 <ulink url='https://www.docker.com/'>Docker Containers</ulink>,
524 you can create a Yocto Project development environment that
525 is operating system agnostic.
526 You can set up a container in which you can develop using the
527 Yocto Project on a Windows, Mac, or Linux machine.
528 </para>
529
530 <para>
531 Follow these general steps to prepare a Windows, Mac, or Linux
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800532 machine as your Yocto Project build host:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500533 <orderedlist>
534 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800535 <emphasis>Determine What Your Build Host Needs:</emphasis>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500536 <ulink url='https://www.docker.com/what-docker'>Docker</ulink>
537 is a software container platform that you need to install
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800538 on the build host.
539 Depending on your build host, you might have to install
540 different software to support Docker containers.
541 Go to the Docker installation page and read about the
542 platform requirements in
543 "<ulink url='https://docs.docker.com/install/#supported-platforms'>Supported Platforms</ulink>"
544 your build host needs to run containers.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500545 </para></listitem>
546 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800547 <emphasis>Choose What To Install:</emphasis>
548 Depending on whether or not your build host meets system
549 requirements, you need to install "Docker CE Stable" or
550 the "Docker Toolbox".
551 Most situations call for Docker CE.
552 However, if you have a build host that does not meet
553 requirements (e.g. Pre-Windows 10 or Windows 10 "Home"
554 version), you must install Docker Toolbox instead.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500555 </para></listitem>
556 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400557 <emphasis>Go to the Install Site for Your Platform:</emphasis>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500558 Click the link for the Docker edition associated with
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800559 your build host's native software.
560 For example, if your build host is running Microsoft
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500561 Windows Version 10 and you want the Docker CE Stable
562 edition, click that link under "Supported Platforms".
563 </para></listitem>
564 <listitem><para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500565 <emphasis>Install the Software:</emphasis>
566 Once you have understood all the pre-requisites, you can
567 download and install the appropriate software.
568 Follow the instructions for your specific machine and
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800569 the type of the software you need to install:
570 <itemizedlist>
571 <listitem><para>
572 Install
573 <ulink url='https://docs.docker.com/docker-for-windows/install/#install-docker-for-windows-desktop-app'>Docker CE for Windows</ulink>
574 for Windows build hosts that meet requirements.
575 </para></listitem>
576 <listitem><para>
577 Install
578 <ulink url='https://docs.docker.com/docker-for-mac/install/#install-and-run-docker-for-mac'>Docker CE for Macs</ulink>
579 for Mac build hosts that meet requirements.
580 </para></listitem>
581 <listitem><para>
582 Install
583 <ulink url='https://docs.docker.com/toolbox/toolbox_install_windows/'>Docker Toolbox for Windows</ulink>
584 for Windows build hosts that do not meet Docker
585 requirements.
586 </para></listitem>
587 <listitem><para>
588 Install
589 <ulink url='https://docs.docker.com/toolbox/toolbox_install_mac/'>Docker Toolbox for MacOS</ulink>
590 for Mac build hosts that do not meet Docker
591 requirements.
592 </para></listitem>
593 <listitem><para>
594 Install
595 <ulink url='https://docs.docker.com/install/linux/docker-ce/centos/'>Docker CE for CentOS</ulink>
596 for Linux build hosts running the CentOS
597 distribution.
598 </para></listitem>
599 <listitem><para>
600 Install
601 <ulink url='https://docs.docker.com/install/linux/docker-ce/debian/'>Docker CE for Debian</ulink>
602 for Linux build hosts running the Debian
603 distribution.
604 </para></listitem>
605 <listitem><para>
606 Install
607 <ulink url='https://docs.docker.com/install/linux/docker-ce/fedora/'>Docker CE for Fedora</ulink>
608 for Linux build hosts running the Fedora
609 distribution.
610 </para></listitem>
611 <listitem><para>
612 Install
613 <ulink url='https://docs.docker.com/install/linux/docker-ce/ubuntu/'>Docker CE for Ubuntu</ulink>
614 for Linux build hosts running the Ubuntu
615 distribution.
616 </para></listitem>
617 </itemizedlist>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500618 </para></listitem>
619 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400620 <emphasis>Optionally Orient Yourself With Docker:</emphasis>
621 If you are unfamiliar with Docker and the container
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500622 concept, you can learn more here -
623 <ulink url='https://docs.docker.com/get-started/'></ulink>.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800624 </para></listitem>
625 <listitem><para>
626 <emphasis>Launch Docker or Docker Toolbox:</emphasis>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500627 You should be able to launch Docker or the Docker Toolbox
628 and have a terminal shell on your development host.
629 </para></listitem>
630 <listitem><para>
631 <emphasis>Set Up the Containers to Use the Yocto Project:</emphasis>
632 Go to
633 <ulink url='https://github.com/crops/docker-win-mac-docs/wiki'></ulink>
634 and follow the directions for your particular
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800635 build host (i.e. Linux, Mac, or Windows).</para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500636
637 <para>Once you complete the setup instructions for your
638 machine, you have the Poky, Extensible SDK, and Toaster
639 containers available.
640 You can click those links from the page and learn more
641 about using each of those containers.
642 </para></listitem>
643 </orderedlist>
644 Once you have a container set up, everything is in place to
645 develop just as if you were running on a native Linux machine.
646 If you are going to use the Poky container, see the
647 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
648 section.
649 If you are going to use the Extensible SDK container, see the
650 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
651 Chapter in the Yocto Project Application Development and the
652 Extensible Software Development Kit (eSDK) manual.
653 If you are going to use the Toaster container, see the
654 "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
655 section in the Toaster User Manual.
656 </para>
657 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500658</section>
659
Brad Bishop316dfdd2018-06-25 12:45:53 -0400660<section id='locating-yocto-project-source-files'>
661 <title>Locating Yocto Project Source Files</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500662
663 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800664 This section shows you how to locate and access the
665 source files that ship with the Yocto Project.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500666 You establish and use these local files to work on projects.
667 <note><title>Notes</title>
668 <itemizedlist>
669 <listitem><para>
670 For concepts and introductory information about Git as it
671 is used in the Yocto Project, see the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400672 "<ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>"
673 section in the Yocto Project Overview and Concepts Manual.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500674 </para></listitem>
675 <listitem><para>
676 For concepts on Yocto Project source repositories, see the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400677 "<ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
678 section in the Yocto Project Overview and Concepts Manual."
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500679 </para></listitem>
680 </itemizedlist>
681 </note>
682 </para>
683
684 <section id='accessing-source-repositories'>
685 <title>Accessing Source Repositories</title>
686
687 <para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400688 Working from a copy of the upstream Yocto Project
689 <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
690 is the preferred method for obtaining and using a Yocto Project
691 release.
692 You can view the Yocto Project Source Repositories at
693 <ulink url='&YOCTO_GIT_URL;'></ulink>.
694 In particular, you can find the
695 <filename>poky</filename> repository at
696 <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/'></ulink>.
697 </para>
698
699 <para>
700 Use the following procedure to locate the latest upstream copy of
701 the <filename>poky</filename> Git repository:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500702 <orderedlist>
703 <listitem><para>
704 <emphasis>Access Repositories:</emphasis>
705 Open a browser and go to
706 <ulink url='&YOCTO_GIT_URL;'></ulink> to access the
707 GUI-based interface into the Yocto Project source
708 repositories.
709 </para></listitem>
710 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400711 <emphasis>Select the Repository:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800712 Click on the repository in which you are interested (e.g.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500713 <filename>poky</filename>).
714 </para></listitem>
715 <listitem><para>
716 <emphasis>Find the URL Used to Clone the Repository:</emphasis>
717 At the bottom of the page, note the URL used to
Brad Bishop316dfdd2018-06-25 12:45:53 -0400718 <ulink url='&YOCTO_DOCS_OM_URL;#git-commands-clone'>clone</ulink>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500719 that repository (e.g.
720 <filename>&YOCTO_GIT_URL;/poky</filename>).
Brad Bishop316dfdd2018-06-25 12:45:53 -0400721 <note>
722 For information on cloning a repository, see the
723 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
724 section.
725 </note>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500726 </para></listitem>
727 </orderedlist>
728 </para>
729 </section>
730
731 <section id='accessing-index-of-releases'>
732 <title>Accessing Index of Releases</title>
733
734 <para>
735 Yocto Project maintains an Index of Releases area that contains
736 related files that contribute to the Yocto Project.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400737 Rather than Git repositories, these files are tarballs that
738 represent snapshots in time of a given component.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500739 <note><title>Tip</title>
740 The recommended method for accessing Yocto Project
Brad Bishop316dfdd2018-06-25 12:45:53 -0400741 components is to use Git to clone the upstream repository and
742 work from within that locally cloned repository.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500743 The procedure in this section exists should you desire a
744 tarball snapshot of any given component.
745 </note>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800746 Follow these steps to locate and download a particular tarball:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500747 <orderedlist>
748 <listitem><para>
749 <emphasis>Access the Index of Releases:</emphasis>
750 Open a browser and go to
751 <ulink url='&YOCTO_DL_URL;/releases'></ulink> to access the
752 Index of Releases.
753 The list represents released components (e.g.
Brad Bishopc342db32019-05-15 21:57:59 -0400754 <filename>bitbake</filename>,
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500755 <filename>sato</filename>, and so on).
756 <note>
757 The <filename>yocto</filename> directory contains the
758 full array of released Poky tarballs.
759 The <filename>poky</filename> directory in the
760 Index of Releases was historically used for very
Brad Bishop316dfdd2018-06-25 12:45:53 -0400761 early releases and exists now only for retroactive
762 completeness.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500763 </note>
764 </para></listitem>
765 <listitem><para>
766 <emphasis>Select a Component:</emphasis>
767 Click on any released component in which you are interested
768 (e.g. <filename>yocto</filename>).
769 </para></listitem>
770 <listitem><para>
771 <emphasis>Find the Tarball:</emphasis>
772 Drill down to find the associated tarball.
773 For example, click on <filename>yocto-&DISTRO;</filename> to
774 view files associated with the Yocto Project &DISTRO;
775 release (e.g. <filename>poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;.tar.bz2</filename>,
776 which is the released Poky tarball).
777 </para></listitem>
778 <listitem><para>
779 <emphasis>Download the Tarball:</emphasis>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400780 Click the tarball to download and save a snapshot of the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500781 given component.
782 </para></listitem>
783 </orderedlist>
784 </para>
785 </section>
786
787 <section id='using-the-downloads-page'>
788 <title>Using the Downloads Page</title>
789
790 <para>
791 The
792 <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400793 uses a "DOWNLOADS" page from which you can locate and download
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500794 tarballs of any Yocto Project release.
795 Rather than Git repositories, these files represent snapshot
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800796 tarballs similar to the tarballs located in the Index of Releases
797 described in the
798 "<link linkend='accessing-index-of-releases'>Accessing Index of Releases</link>"
799 section.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500800 <note><title>Tip</title>
801 The recommended method for accessing Yocto Project
802 components is to use Git to clone a repository and work from
803 within that local repository.
804 The procedure in this section exists should you desire a
805 tarball snapshot of any given component.
806 </note>
807 <orderedlist>
808 <listitem><para>
809 <emphasis>Go to the Yocto Project Website:</emphasis>
810 Open The
811 <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
812 in your browser.
813 </para></listitem>
814 <listitem><para>
815 <emphasis>Get to the Downloads Area:</emphasis>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400816 Select the "DOWNLOADS" item from the pull-down
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800817 "SOFTWARE" tab menu near the top of the page.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500818 </para></listitem>
819 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400820 <emphasis>Select a Yocto Project Release:</emphasis>
821 Use the menu next to "RELEASE" to display and choose
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800822 a recent or past supported Yocto Project release
823 (e.g. &DISTRO_NAME_NO_CAP;,
824 &DISTRO_NAME_NO_CAP_MINUS_ONE;, and so forth).
825 <note><title>Tip</title>
826 For a "map" of Yocto Project releases to version
827 numbers, see the
828 <ulink url='https://wiki.yoctoproject.org/wiki/Releases'>Releases</ulink>
829 wiki page.
830 </note>
831 You can use the "RELEASE ARCHIVE" link to reveal a menu of
832 all Yocto Project releases.
833 </para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500834 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400835 <emphasis>Download Tools or Board Support Packages (BSPs):</emphasis>
836 From the "DOWNLOADS" page, you can download tools or
837 BSPs as well.
838 Just scroll down the page and look for what you need.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500839 </para></listitem>
840 </orderedlist>
841 </para>
842 </section>
843
Brad Bishop316dfdd2018-06-25 12:45:53 -0400844 <section id='accessing-nightly-builds'>
845 <title>Accessing Nightly Builds</title>
846
847 <para>
848 Yocto Project maintains an area for nightly builds that contains
849 tarball releases at <ulink url='&YOCTO_AB_NIGHTLY_URL;'/>.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800850 These builds include Yocto Project releases ("poky"),
Brad Bishopc342db32019-05-15 21:57:59 -0400851 toolchains, and builds for supported machines.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400852 </para>
853
854 <para>
855 Should you ever want to access a nightly build of a particular
856 Yocto Project component, use the following procedure:
857 <orderedlist>
858 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800859 <emphasis>Locate the Index of Nightly Builds:</emphasis>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400860 Open a browser and go to
861 <ulink url='&YOCTO_AB_NIGHTLY_URL;'/> to access the
862 Nightly Builds.
863 </para></listitem>
864 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800865 <emphasis>Select a Date:</emphasis>
866 Click on the date in which you are interested.
867 If you want the latest builds, use "CURRENT".
868 </para></listitem>
869 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400870 <emphasis>Select a Build:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800871 Choose the area in which you are interested.
872 For example, if you are looking for the most recent
873 toolchains, select the "toolchain" link.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400874 </para></listitem>
875 <listitem><para>
876 <emphasis>Find the Tarball:</emphasis>
877 Drill down to find the associated tarball.
878 </para></listitem>
879 <listitem><para>
880 <emphasis>Download the Tarball:</emphasis>
881 Click the tarball to download and save a snapshot of the
882 given component.
883 </para></listitem>
884 </orderedlist>
885 </para>
886 </section>
887</section>
888
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800889<section id='cloning-and-checking-out-branches'>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400890 <title>Cloning and Checking Out Branches</title>
891
892 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800893 To use the Yocto Project for development, you need a release locally
894 installed on your development system.
895 This locally installed set of files is referred to as the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400896 <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
897 in the Yocto Project documentation.
898 </para>
899
900 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800901 The preferred method of creating your Source Directory is by using
Brad Bishop316dfdd2018-06-25 12:45:53 -0400902 <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink> to clone a local
903 copy of the upstream <filename>poky</filename> repository.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800904 Working from a cloned copy of the upstream repository allows you
905 to contribute back into the Yocto Project or to simply work with
Brad Bishop316dfdd2018-06-25 12:45:53 -0400906 the latest software on a development branch.
907 Because Git maintains and creates an upstream repository with
908 a complete history of changes and you are working with a local
909 clone of that repository, you have access to all the Yocto
910 Project development branches and tag names used in the upstream
911 repository.
912 </para>
913
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500914 <section id='cloning-the-poky-repository'>
915 <title>Cloning the <filename>poky</filename> Repository</title>
916
917 <para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500918 Follow these steps to create a local version of the
919 upstream
920 <ulink url='&YOCTO_DOCS_REF_URL;#poky'><filename>poky</filename></ulink>
921 Git repository.
922 <orderedlist>
923 <listitem><para>
924 <emphasis>Set Your Directory:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800925 Change your working directory to where you want to
926 create your local copy of
927 <filename>poky</filename>.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500928 </para></listitem>
929 <listitem><para>
930 <emphasis>Clone the Repository:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800931 The following example command clones the
932 <filename>poky</filename> repository and uses
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500933 the default name "poky" for your local repository:
934 <literallayout class='monospaced'>
935 $ git clone git://git.yoctoproject.org/poky
936 Cloning into 'poky'...
Brad Bishop19323692019-04-05 15:28:33 -0400937 remote: Counting objects: 432160, done.
938 remote: Compressing objects: 100% (102056/102056), done.
939 remote: Total 432160 (delta 323116), reused 432037 (delta 323000)
940 Receiving objects: 100% (432160/432160), 153.81 MiB | 8.54 MiB/s, done.
941 Resolving deltas: 100% (323116/323116), done.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500942 Checking connectivity... done.
943 </literallayout>
944 Unless you specify a specific development branch or
945 tag name, Git clones the "master" branch, which results
946 in a snapshot of the latest development changes for
947 "master".
948 For information on how to check out a specific
949 development branch or on how to check out a local
950 branch based on a tag name, see the
951 "<link linkend='checking-out-by-branch-in-poky'>Checking Out By Branch in Poky</link>"
952 and
Brad Bishop316dfdd2018-06-25 12:45:53 -0400953 <link linkend='checkout-out-by-tag-in-poky'>Checking Out By Tag in Poky</link>"
954 sections, respectively.</para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500955
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800956 <para>Once the local repository is created, you can
957 change to that directory and check its status.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500958 Here, the single "master" branch exists on your system
959 and by default, it is checked out:
960 <literallayout class='monospaced'>
961 $ cd ~/poky
962 $ git status
963 On branch master
964 Your branch is up-to-date with 'origin/master'.
965 nothing to commit, working directory clean
966 $ git branch
967 * master
968 </literallayout>
969 Your local repository of poky is identical to the
970 upstream poky repository at the time from which it was
971 cloned.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800972 As you work with the local branch, you can periodically
973 use the <filename>git pull &dash;&dash;rebase</filename>
974 command to be sure you are up-to-date with the upstream
975 branch.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500976 </para></listitem>
977 </orderedlist>
978 </para>
979 </section>
980
981 <section id='checking-out-by-branch-in-poky'>
982 <title>Checking Out by Branch in Poky</title>
983
984 <para>
985 When you clone the upstream poky repository, you have access to
986 all its development branches.
987 Each development branch in a repository is unique as it forks
988 off the "master" branch.
989 To see and use the files of a particular development branch
990 locally, you need to know the branch name and then specifically
991 check out that development branch.
992 <note>
993 Checking out an active development branch by branch name
994 gives you a snapshot of that particular branch at the time
995 you check it out.
996 Further development on top of the branch that occurs after
997 check it out can occur.
998 </note>
999 <orderedlist>
1000 <listitem><para>
1001 <emphasis>Switch to the Poky Directory:</emphasis>
1002 If you have a local poky Git repository, switch to that
1003 directory.
1004 If you do not have the local copy of poky, see the
1005 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
1006 section.
1007 </para></listitem>
1008 <listitem><para>
1009 <emphasis>Determine Existing Branch Names:</emphasis>
1010 <literallayout class='monospaced'>
1011 $ git branch -a
1012 * master
1013 remotes/origin/1.1_M1
1014 remotes/origin/1.1_M2
1015 remotes/origin/1.1_M3
1016 remotes/origin/1.1_M4
1017 remotes/origin/1.2_M1
1018 remotes/origin/1.2_M2
1019 remotes/origin/1.2_M3
1020 .
1021 .
1022 .
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001023 remotes/origin/pyro
Brad Bishop19323692019-04-05 15:28:33 -04001024 remotes/origin/pyro-next
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001025 remotes/origin/rocko
Brad Bishop19323692019-04-05 15:28:33 -04001026 remotes/origin/rocko-next
1027 remotes/origin/sumo
1028 remotes/origin/sumo-next
1029 remotes/origin/thud
1030 remotes/origin/thud-next
1031 remotes/origin/warrior
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001032 </literallayout>
1033 </para></listitem>
1034 <listitem><para>
1035 <emphasis>Checkout the Branch:</emphasis>
1036 Checkout the development branch in which you want to work.
1037 For example, to access the files for the Yocto Project
1038 &DISTRO; Release (&DISTRO_NAME;), use the following command:
1039 <literallayout class='monospaced'>
1040 $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
1041 Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
1042 Switched to a new branch '&DISTRO_NAME_NO_CAP;'
1043 </literallayout>
1044 The previous command checks out the "&DISTRO_NAME_NO_CAP;"
1045 development branch and reports that the branch is tracking
1046 the upstream "origin/&DISTRO_NAME_NO_CAP;" branch.</para>
1047
1048 <para>The following command displays the branches
1049 that are now part of your local poky repository.
1050 The asterisk character indicates the branch that is
1051 currently checked out for work:
1052 <literallayout class='monospaced'>
1053 $ git branch
1054 master
1055 * &DISTRO_NAME_NO_CAP;
1056 </literallayout>
1057 </para></listitem>
1058 </orderedlist>
1059 </para>
1060 </section>
1061
1062 <section id='checkout-out-by-tag-in-poky'>
1063 <title>Checking Out by Tag in Poky</title>
1064
1065 <para>
1066 Similar to branches, the upstream repository uses tags
1067 to mark specific commits associated with significant points in
1068 a development branch (i.e. a release point or stage of a
1069 release).
1070 You might want to set up a local branch based on one of those
1071 points in the repository.
1072 The process is similar to checking out by branch name except you
1073 use tag names.
1074 <note>
1075 Checking out a branch based on a tag gives you a
1076 stable set of files not affected by development on the
1077 branch above the tag.
1078 </note>
1079 <orderedlist>
1080 <listitem><para>
1081 <emphasis>Switch to the Poky Directory:</emphasis>
1082 If you have a local poky Git repository, switch to that
1083 directory.
1084 If you do not have the local copy of poky, see the
1085 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
1086 section.
1087 </para></listitem>
1088 <listitem><para>
1089 <emphasis>Fetch the Tag Names:</emphasis>
1090 To checkout the branch based on a tag name, you need to
1091 fetch the upstream tags into your local repository:
1092 <literallayout class='monospaced'>
1093 $ git fetch --tags
1094 $
1095 </literallayout>
1096 </para></listitem>
1097 <listitem><para>
1098 <emphasis>List the Tag Names:</emphasis>
1099 You can list the tag names now:
1100 <literallayout class='monospaced'>
1101 $ git tag
1102 1.1_M1.final
1103 1.1_M1.rc1
1104 1.1_M1.rc2
1105 1.1_M2.final
1106 1.1_M2.rc1
1107 .
1108 .
1109 .
Scott Rifenbarkfa4cfe32019-01-11 11:55:06 -08001110 yocto-2.5
1111 yocto-2.5.1
1112 yocto-2.5.2
Brad Bishop19323692019-04-05 15:28:33 -04001113 yocto-2.5.3
Scott Rifenbarkfa4cfe32019-01-11 11:55:06 -08001114 yocto-2.6
Scott Rifenbarkb0466fb2019-01-22 10:21:44 -08001115 yocto-2.6.1
Brad Bishopc342db32019-05-15 21:57:59 -04001116 yocto-2.6.2
Brad Bishop19323692019-04-05 15:28:33 -04001117 yocto-2.7
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001118 yocto_1.5_M5.rc8
1119 </literallayout>
1120 </para></listitem>
1121 <listitem><para>
1122 <emphasis>Checkout the Branch:</emphasis>
1123 <literallayout class='monospaced'>
Brad Bishop316dfdd2018-06-25 12:45:53 -04001124 $ git checkout tags/&DISTRO_REL_TAG; -b my_yocto_&DISTRO;
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001125 Switched to a new branch 'my_yocto_&DISTRO;'
1126 $ git branch
1127 master
1128 * my_yocto_&DISTRO;
1129 </literallayout>
1130 The previous command creates and checks out a local
1131 branch named "my_yocto_&DISTRO;", which is based on
1132 the commit in the upstream poky repository that has
1133 the same tag.
1134 In this example, the files you have available locally
1135 as a result of the <filename>checkout</filename>
1136 command are a snapshot of the
1137 "&DISTRO_NAME_NO_CAP;" development branch at the point
1138 where Yocto Project &DISTRO; was released.
1139 </para></listitem>
1140 </orderedlist>
1141 </para>
1142 </section>
1143</section>
1144
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001145</chapter>
1146<!--
1147vim: expandtab tw=80 ts=4
1148-->