blob: 8cb5631f0dc93401ea22599047bd1b410eef7b70 [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>
Andrew Geissler82c905d2020-04-13 13:39:40 -050010 This chapter provides guidance on how to prepare to use the
Brad Bishopd7bf8c12018-02-25 22:55:05 -050011 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 Bishop79641f22019-09-10 07:20:22 -040026 You can adapt the Yocto Project to many different use cases and
Andrew Geissler82c905d2020-04-13 13:39:40 -050027 scenarios;
28 however, this flexibility could cause difficulties if you are trying
29 to create a working setup that scales effectively.
Brad Bishop316dfdd2018-06-25 12:45:53 -040030 </para>
31
32 <para>
33 To help you understand how to set up this type of environment,
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080034 this section presents a procedure that gives you information
35 that can help you get the results you want.
Brad Bishop316dfdd2018-06-25 12:45:53 -040036 The procedure is high-level and presents some of the project's most
37 successful experiences, practices, solutions, and available
Andrew Geissler82c905d2020-04-13 13:39:40 -050038 technologies that have proved to work well in the past;
39 however, keep in mind, the procedure here is simply a starting point.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080040 You can build off these steps and customize the procedure to fit any
Brad Bishop316dfdd2018-06-25 12:45:53 -040041 particular working environment and set of practices.
42 <orderedlist>
43 <listitem><para>
44 <emphasis>Determine Who is Going to be Developing:</emphasis>
Andrew Geissler82c905d2020-04-13 13:39:40 -050045 You first need to understand who is going to be doing anything
Brad Bishop19323692019-04-05 15:28:33 -040046 related to the Yocto Project and determine their roles.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080047 Making this determination is essential to completing
Andrew Geissler82c905d2020-04-13 13:39:40 -050048 subsequent steps, which are to get your equipment together
Brad Bishop316dfdd2018-06-25 12:45:53 -040049 and set up your development environment's hardware topology.
50 </para>
51
52 <para>The following roles exist:
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080053 <itemizedlist>
54 <listitem><para>
55 <emphasis>Application Developer:</emphasis>
56 This type of developer does application level work
57 on top of an existing software stack.
58 </para></listitem>
59 <listitem><para>
60 <emphasis>Core System Developer:</emphasis>
61 This type of developer works on the contents of the
62 operating system image itself.
63 </para></listitem>
64 <listitem><para>
65 <emphasis>Build Engineer:</emphasis>
66 This type of developer manages Autobuilders and
Andrew Geissler82c905d2020-04-13 13:39:40 -050067 releases. Depending on the specifics of the environment,
68 not all situations might need a Build Engineer.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080069 </para></listitem>
70 <listitem><para>
71 <emphasis>Test Engineer:</emphasis>
72 This type of developer creates and manages automated
73 tests that are used to ensure all application and
74 core system development meets desired quality
75 standards.
76 </para></listitem>
77 </itemizedlist>
Brad Bishop316dfdd2018-06-25 12:45:53 -040078 </para></listitem>
79 <listitem><para>
80 <emphasis>Gather the Hardware:</emphasis>
81 Based on the size and make-up of the team, get the hardware
82 together.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080083 Ideally, any development, build, or test engineer uses
84 a system that runs a supported Linux distribution.
85 These systems, in general, should be high performance
86 (e.g. dual, six-core Xeons with 24 Gbytes of RAM and plenty
87 of disk space).
Brad Bishop316dfdd2018-06-25 12:45:53 -040088 You can help ensure efficiency by having any machines used
89 for testing or that run Autobuilders be as high performance
90 as possible.
Andrew Geissler82c905d2020-04-13 13:39:40 -050091 <note>
92 Given sufficient processing power, you might also consider
93 building Yocto Project development containers to be run
94 under Docker, which is described later.
95 </note>
Brad Bishop316dfdd2018-06-25 12:45:53 -040096 </para></listitem>
97 <listitem><para>
98 <emphasis>Understand the Hardware Topology of the Environment:</emphasis>
99 Once you understand the hardware involved and the make-up
100 of the team, you can understand the hardware topology of the
101 development environment.
102 You can get a visual idea of the machines and their roles
103 across the development environment.
104
105<!--
106 The following figure shows a moderately sized Yocto Project
107 development environment.
108
109 <para role="writernotes">
110 Need figure.</para>
111-->
112
113 </para></listitem>
114 <listitem><para>
115 <emphasis>Use Git as Your Source Control Manager (SCM):</emphasis>
116 Keeping your
117 <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800118 (i.e. recipes, configuration files, classes, and so forth)
119 and any software you are developing under the control of an SCM
120 system that is compatible with the OpenEmbedded build system
121 is advisable.
Andrew Geissler82c905d2020-04-13 13:39:40 -0500122 Of all of the SCMs supported by BitBake, the Yocto Project team strongly
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800123 recommends using
Brad Bishop316dfdd2018-06-25 12:45:53 -0400124 <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>.
Andrew Geissler82c905d2020-04-13 13:39:40 -0500125 Git is a distributed system that is easy to back up,
Brad Bishop316dfdd2018-06-25 12:45:53 -0400126 allows you to work remotely, and then connects back to the
127 infrastructure.
128 <note>
129 For information about BitBake, see the
130 <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
131 </note></para>
132
133 <para>It is relatively easy to set up Git services and create
134 infrastructure like
135 <ulink url='&YOCTO_GIT_URL;'>http://git.yoctoproject.org</ulink>,
136 which is based on server software called
137 <filename>gitolite</filename> with <filename>cgit</filename>
138 being used to generate the web interface that lets you view the
139 repositories.
140 The <filename>gitolite</filename> software identifies users
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800141 using SSH keys and allows branch-based access controls to
142 repositories that you can control as little or as much as
143 necessary.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400144 <note>
145 The setup of these services is beyond the scope of this
146 manual.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800147 However, sites such as the following exist that describe
148 how to perform setup:
Brad Bishop316dfdd2018-06-25 12:45:53 -0400149 <itemizedlist>
150 <listitem><para>
151 <ulink url='http://git-scm.com/book/ch4-8.html'>Git documentation</ulink>:
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800152 Describes how to install
153 <filename>gitolite</filename> on the server.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400154 </para></listitem>
155 <listitem><para>
156 <ulink url='http://gitolite.com'>Gitolite</ulink>:
157 Information for <filename>gitolite</filename>.
158 </para></listitem>
159 <listitem><para>
160 <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 -0800161 Documentation on how to create interfaces and
162 frontends for Git.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400163 </para></listitem>
164 </itemizedlist>
165 </note>
166 </para></listitem>
167 <listitem><para>
168 <emphasis>Set up the Application Development Machines:</emphasis>
169 As mentioned earlier, application developers are creating
170 applications on top of existing software stacks.
171 Following are some best practices for setting up machines
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800172 used for application development:
Brad Bishop316dfdd2018-06-25 12:45:53 -0400173 <itemizedlist>
174 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800175 Use a pre-built toolchain that contains the software
176 stack itself.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400177 Then, develop the application code on top of the
178 stack.
179 This method works well for small numbers of relatively
180 isolated applications.
181 </para></listitem>
182 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400183 Keep your cross-development toolchains updated.
184 You can do this through provisioning either as new
185 toolchain downloads or as updates through a package
186 update mechanism using <filename>opkg</filename>
187 to provide updates to an existing toolchain.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800188 The exact mechanics of how and when to do this depend
189 on local policy.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400190 </para></listitem>
191 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800192 Use multiple toolchains installed locally into
193 different locations to allow development across
Brad Bishop316dfdd2018-06-25 12:45:53 -0400194 versions.
195 </para></listitem>
196 </itemizedlist>
197 </para></listitem>
198 <listitem><para>
199 <emphasis>Set up the Core Development Machines:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800200 As mentioned earlier, core developers work on the contents of
201 the operating system itself.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400202 Following are some best practices for setting up machines
203 used for developing images:
204 <itemizedlist>
205 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800206 Have the
207 <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
208 available on the developer workstations so developers
209 can run their own builds and directly rebuild the
210 software stack.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400211 </para></listitem>
212 <listitem><para>
213 Keep the core system unchanged as much as
214 possible and do your work in layers on top of the
215 core system.
216 Doing so gives you a greater level of portability when
217 upgrading to new versions of the core system or Board
218 Support Packages (BSPs).
219 </para></listitem>
220 <listitem><para>
221 Share layers amongst the developers of a
222 particular project and contain the policy configuration
223 that defines the project.
224 </para></listitem>
225 </itemizedlist>
226 </para></listitem>
227 <listitem><para>
228 <emphasis>Set up an Autobuilder:</emphasis>
229 Autobuilders are often the core of the development
230 environment.
231 It is here that changes from individual developers are brought
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800232 together and centrally tested.
233 Based on this automated build and test environment, subsequent
234 decisions about releases can be made.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400235 Autobuilders also allow for "continuous integration" style
236 testing of software components and regression identification
237 and tracking.</para>
238
239 <para>See "<ulink url='http://autobuilder.yoctoproject.org'>Yocto Project Autobuilder</ulink>"
240 for more information and links to buildbot.
241 The Yocto Project team has found this implementation
242 works well in this role.
243 A public example of this is the Yocto Project
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800244 Autobuilders, which the Yocto Project team uses to test the
245 overall health of the project.</para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400246
247 <para>The features of this system are:
248 <itemizedlist>
249 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800250 Highlights when commits break the build.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400251 </para></listitem>
252 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800253 Populates an
254 <ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate cache</ulink>
255 from which developers can pull rather than requiring
256 local builds.
257 </para></listitem>
258 <listitem><para>
259 Allows commit hook triggers, which trigger builds when
260 commits are made.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400261 </para></listitem>
262 <listitem><para>
263 Allows triggering of automated image booting
264 and testing under the QuickEMUlator (QEMU).
265 </para></listitem>
266 <listitem><para>
267 Supports incremental build testing and
268 from-scratch builds.
269 </para></listitem>
270 <listitem><para>
271 Shares output that allows developer
272 testing and historical regression investigation.
273 </para></listitem>
274 <listitem><para>
275 Creates output that can be used for releases.
276 </para></listitem>
277 <listitem><para>
278 Allows scheduling of builds so that resources
279 can be used efficiently.
280 </para></listitem>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800281 </itemizedlist>
282 </para></listitem>
283 <listitem><para>
284 <emphasis>Set up Test Machines:</emphasis>
285 Use a small number of shared, high performance systems
286 for testing purposes.
287 Developers can use these systems for wider, more
288 extensive testing while they continue to develop
289 locally using their primary development system.
290 </para></listitem>
291 <listitem><para>
292 <emphasis>Document Policies and Change Flow:</emphasis>
293 The Yocto Project uses a hierarchical structure and a
Brad Bishop316dfdd2018-06-25 12:45:53 -0400294 pull model.
295 Scripts exist to create and send pull requests
296 (i.e. <filename>create-pull-request</filename> and
297 <filename>send-pull-request</filename>).
298 This model is in line with other open source projects where
299 maintainers are responsible for specific areas of the project
300 and a single maintainer handles the final "top-of-tree" merges.
301 <note>
302 You can also use a more collective push model.
303 The <filename>gitolite</filename> software supports both the
304 push and pull models quite easily.
305 </note></para>
306
307 <para>As with any development environment, it is important
308 to document the policy used as well as any main project
309 guidelines so they are understood by everyone.
Andrew Geissler82c905d2020-04-13 13:39:40 -0500310 It is also a good idea to have well-structured
Brad Bishop316dfdd2018-06-25 12:45:53 -0400311 commit messages, which are usually a part of a project's
312 guidelines.
313 Good commit messages are essential when looking back in time and
314 trying to understand why changes were made.</para>
315
316 <para>If you discover that changes are needed to the core
317 layer of the project, it is worth sharing those with the
318 community as soon as possible.
319 Chances are if you have discovered the need for changes,
320 someone else in the community needs them also.
321 </para></listitem>
322 <listitem><para>
323 <emphasis>Development Environment Summary:</emphasis>
324 Aside from the previous steps, some best practices exist
325 within the Yocto Project development environment.
326 Consider the following:
327 <itemizedlist>
328 <listitem><para>
329 Use
330 <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>
331 as the source control system.
332 </para></listitem>
333 <listitem><para>
334 Maintain your Metadata in layers that make sense
335 for your situation.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800336 See the
337 "<ulink url='&YOCTO_DOCS_OM_URL;#the-yocto-project-layer-model'>The Yocto Project Layer Model</ulink>"
338 section in the Yocto Project Overview and Concepts
339 Manual and the
340 "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>"
341 section for more information on layers.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400342 </para></listitem>
343 <listitem><para>
344 Separate the project's Metadata and code by using
345 separate Git repositories.
346 See the
347 "<ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800348 section in the Yocto Project Overview and Concepts
349 Manual for information on these repositories.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400350 See the
351 "<link linkend='locating-yocto-project-source-files'>Locating Yocto Project Source Files</link>"
352 section for information on how to set up local Git
353 repositories for related upstream Yocto Project
354 Git repositories.
355 </para></listitem>
356 <listitem><para>
357 Set up the directory for the shared state cache
358 (<ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>)
359 where it makes sense.
360 For example, set up the sstate cache on a system used
361 by developers in the same organization and share the
362 same source directories on their machines.
363 </para></listitem>
364 <listitem><para>
365 Set up an Autobuilder and have it populate the
366 sstate cache and source directories.
367 </para></listitem>
368 <listitem><para>
369 The Yocto Project community encourages you
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800370 to send patches to the project to fix bugs or add
371 features.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400372 If you do submit patches, follow the project commit
373 guidelines for writing good commit messages.
374 See the "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
375 section.
376 </para></listitem>
377 <listitem><para>
378 Send changes to the core sooner than later
379 as others are likely to run into the same issues.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800380 For some guidance on mailing lists to use, see the list
381 in the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400382 "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
383 section.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800384 For a description of the available mailing lists, see
385 the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400386 "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>"
387 section in the Yocto Project Reference Manual.
388 </para></listitem>
389 </itemizedlist>
390 </para></listitem>
391 </orderedlist>
392 </para>
393</section>
394
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800395<section id='dev-preparing-the-build-host'>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400396 <title>Preparing the Build Host</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500397
398 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800399 This section provides procedures to set up a system to be used as your
400 <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>
401 for development using the Yocto Project.
Andrew Geissler82c905d2020-04-13 13:39:40 -0500402 Your build host can be a native Linux machine (recommended), it can
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800403 be a machine (Linux, Mac, or Windows) that uses
Andrew Geissler82c905d2020-04-13 13:39:40 -0500404 <ulink url='https://github.com/crops/poky-container'>CROPS</ulink>,
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500405 which leverages
Andrew Geissler82c905d2020-04-13 13:39:40 -0500406 <ulink url='https://www.docker.com/'>Docker Containers</ulink> or it can
407 be a Windows machine capable of running Windows Subsystem For Linux v2 (WSL).
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800408 <note>
Andrew Geissler82c905d2020-04-13 13:39:40 -0500409 The Yocto Project is not compatible with
410 <ulink url='https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux'>Windows Subsystem for Linux v1</ulink>.
411 It is compatible but not officially supported nor validated with WSLv2.
412 If you still decide to use WSL please upgrade to
413 <ulink url='https://docs.microsoft.com/en-us/windows/wsl/wsl2-install'>WSLv2</ulink>.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800414 </note>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500415 </para>
416
417 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800418 Once your build host is set up to use the Yocto Project,
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500419 further steps are necessary depending on what you want to
420 accomplish.
421 See the following references for information on how to prepare for
Brad Bishopc342db32019-05-15 21:57:59 -0400422 Board Support Package (BSP) development and kernel development:
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500423 <itemizedlist>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500424 <listitem><para>
425 <emphasis>BSP Development:</emphasis>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500426 See the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500427 "<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 -0500428 section in the Yocto Project Board Support Package (BSP)
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500429 Developer's Guide.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500430 </para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500431 <listitem><para>
432 <emphasis>Kernel Development:</emphasis>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500433 See the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500434 "<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>"
435 section in the Yocto Project Linux Kernel Development Manual.
436 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500437 </itemizedlist>
438 </para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500439
440 <section id='setting-up-a-native-linux-host'>
441 <title>Setting Up a Native Linux Host</title>
442
443 <para>
444 Follow these steps to prepare a native Linux machine as your
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800445 Yocto Project Build Host:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500446 <orderedlist>
447 <listitem><para>
448 <emphasis>Use a Supported Linux Distribution:</emphasis>
449 You should have a reasonably current Linux-based host
450 system.
451 You will have the best results with a recent release of
Andrew Geissler82c905d2020-04-13 13:39:40 -0500452 Fedora, openSUSE, Debian, Ubuntu, RHEL or CentOS as these
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500453 releases are frequently tested against the Yocto Project
454 and officially supported.
455 For a list of the distributions under validation and their
456 status, see the
457 "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section
458 in the Yocto Project Reference Manual and the wiki page at
459 <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>.
460 </para></listitem>
461 <listitem><para>
462 <emphasis>Have Enough Free Memory:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800463 Your system should have at least 50 Gbytes of free disk
464 space for building images.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500465 </para></listitem>
466 <listitem><para>
467 <emphasis>Meet Minimal Version Requirements:</emphasis>
468 The OpenEmbedded build system should be able to run on any
469 modern distribution that has the following versions for
Andrew Geissler82c905d2020-04-13 13:39:40 -0500470 Git, tar, Python and gcc.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500471 <itemizedlist>
472 <listitem><para>
473 Git 1.8.3.1 or greater
474 </para></listitem>
475 <listitem><para>
Andrew Geissler82c905d2020-04-13 13:39:40 -0500476 tar 1.28 or greater
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500477 </para></listitem>
478 <listitem><para>
Andrew Geissler82c905d2020-04-13 13:39:40 -0500479 Python 3.5.0 or greater.
480 </para></listitem>
481 <listitem><para>
482 gcc 5.0 or greater.
483 </para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500484 </itemizedlist>
485 If your build host does not meet any of these three listed
486 version requirements, you can take steps to prepare the
487 system so that you can still use the Yocto Project.
488 See the
Andrew Geissler82c905d2020-04-13 13:39:40 -0500489 "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-python-and-gcc-versions'>Required Git, tar, Python and gcc Versions</ulink>"
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500490 section in the Yocto Project Reference Manual for
491 information.
492 </para></listitem>
493 <listitem><para>
494 <emphasis>Install Development Host Packages:</emphasis>
495 Required development host packages vary depending on your
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800496 build host and what you want to do with the Yocto
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500497 Project.
498 Collectively, the number of required packages is large
499 if you want to be able to cover all cases.</para>
500
501 <para>For lists of required packages for all scenarios,
502 see the
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800503 "<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 -0500504 section in the Yocto Project Reference Manual.
505 </para></listitem>
506 </orderedlist>
507 Once you have completed the previous steps, you are ready to
508 continue using a given development path on your native Linux
509 machine.
510 If you are going to use BitBake, see the
511 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
512 section.
513 If you are going to use the Extensible SDK, see the
514 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
515 Chapter in the Yocto Project Application Development and the
516 Extensible Software Development Kit (eSDK) manual.
517 If you want to work on the kernel, see the
518 <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
519 If you are going to use Toaster, see the
520 "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
521 section in the Toaster User Manual.
522 </para>
523 </section>
524
525 <section id='setting-up-to-use-crops'>
526 <title>Setting Up to Use CROss PlatformS (CROPS)</title>
527
528 <para>
529 With
Andrew Geissler82c905d2020-04-13 13:39:40 -0500530 <ulink url='https://github.com/crops/poky-container'>CROPS</ulink>,
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500531 which leverages
532 <ulink url='https://www.docker.com/'>Docker Containers</ulink>,
533 you can create a Yocto Project development environment that
534 is operating system agnostic.
535 You can set up a container in which you can develop using the
536 Yocto Project on a Windows, Mac, or Linux machine.
537 </para>
538
539 <para>
540 Follow these general steps to prepare a Windows, Mac, or Linux
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800541 machine as your Yocto Project build host:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500542 <orderedlist>
543 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800544 <emphasis>Determine What Your Build Host Needs:</emphasis>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500545 <ulink url='https://www.docker.com/what-docker'>Docker</ulink>
546 is a software container platform that you need to install
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800547 on the build host.
548 Depending on your build host, you might have to install
549 different software to support Docker containers.
550 Go to the Docker installation page and read about the
551 platform requirements in
552 "<ulink url='https://docs.docker.com/install/#supported-platforms'>Supported Platforms</ulink>"
553 your build host needs to run containers.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500554 </para></listitem>
555 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800556 <emphasis>Choose What To Install:</emphasis>
557 Depending on whether or not your build host meets system
558 requirements, you need to install "Docker CE Stable" or
559 the "Docker Toolbox".
560 Most situations call for Docker CE.
561 However, if you have a build host that does not meet
562 requirements (e.g. Pre-Windows 10 or Windows 10 "Home"
563 version), you must install Docker Toolbox instead.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500564 </para></listitem>
565 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400566 <emphasis>Go to the Install Site for Your Platform:</emphasis>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500567 Click the link for the Docker edition associated with
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800568 your build host's native software.
569 For example, if your build host is running Microsoft
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500570 Windows Version 10 and you want the Docker CE Stable
571 edition, click that link under "Supported Platforms".
572 </para></listitem>
573 <listitem><para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500574 <emphasis>Install the Software:</emphasis>
575 Once you have understood all the pre-requisites, you can
576 download and install the appropriate software.
577 Follow the instructions for your specific machine and
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800578 the type of the software you need to install:
579 <itemizedlist>
580 <listitem><para>
581 Install
582 <ulink url='https://docs.docker.com/docker-for-windows/install/#install-docker-for-windows-desktop-app'>Docker CE for Windows</ulink>
583 for Windows build hosts that meet requirements.
584 </para></listitem>
585 <listitem><para>
586 Install
587 <ulink url='https://docs.docker.com/docker-for-mac/install/#install-and-run-docker-for-mac'>Docker CE for Macs</ulink>
588 for Mac build hosts that meet requirements.
589 </para></listitem>
590 <listitem><para>
591 Install
592 <ulink url='https://docs.docker.com/toolbox/toolbox_install_windows/'>Docker Toolbox for Windows</ulink>
593 for Windows build hosts that do not meet Docker
594 requirements.
595 </para></listitem>
596 <listitem><para>
597 Install
598 <ulink url='https://docs.docker.com/toolbox/toolbox_install_mac/'>Docker Toolbox for MacOS</ulink>
599 for Mac build hosts that do not meet Docker
600 requirements.
601 </para></listitem>
602 <listitem><para>
603 Install
604 <ulink url='https://docs.docker.com/install/linux/docker-ce/centos/'>Docker CE for CentOS</ulink>
605 for Linux build hosts running the CentOS
606 distribution.
607 </para></listitem>
608 <listitem><para>
609 Install
610 <ulink url='https://docs.docker.com/install/linux/docker-ce/debian/'>Docker CE for Debian</ulink>
611 for Linux build hosts running the Debian
612 distribution.
613 </para></listitem>
614 <listitem><para>
615 Install
616 <ulink url='https://docs.docker.com/install/linux/docker-ce/fedora/'>Docker CE for Fedora</ulink>
617 for Linux build hosts running the Fedora
618 distribution.
619 </para></listitem>
620 <listitem><para>
621 Install
622 <ulink url='https://docs.docker.com/install/linux/docker-ce/ubuntu/'>Docker CE for Ubuntu</ulink>
623 for Linux build hosts running the Ubuntu
624 distribution.
625 </para></listitem>
626 </itemizedlist>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500627 </para></listitem>
628 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400629 <emphasis>Optionally Orient Yourself With Docker:</emphasis>
630 If you are unfamiliar with Docker and the container
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500631 concept, you can learn more here -
632 <ulink url='https://docs.docker.com/get-started/'></ulink>.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800633 </para></listitem>
634 <listitem><para>
635 <emphasis>Launch Docker or Docker Toolbox:</emphasis>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500636 You should be able to launch Docker or the Docker Toolbox
637 and have a terminal shell on your development host.
638 </para></listitem>
639 <listitem><para>
640 <emphasis>Set Up the Containers to Use the Yocto Project:</emphasis>
641 Go to
642 <ulink url='https://github.com/crops/docker-win-mac-docs/wiki'></ulink>
643 and follow the directions for your particular
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800644 build host (i.e. Linux, Mac, or Windows).</para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500645
646 <para>Once you complete the setup instructions for your
647 machine, you have the Poky, Extensible SDK, and Toaster
648 containers available.
649 You can click those links from the page and learn more
650 about using each of those containers.
651 </para></listitem>
652 </orderedlist>
653 Once you have a container set up, everything is in place to
654 develop just as if you were running on a native Linux machine.
655 If you are going to use the Poky container, see the
656 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
657 section.
658 If you are going to use the Extensible SDK container, see the
659 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
660 Chapter in the Yocto Project Application Development and the
661 Extensible Software Development Kit (eSDK) manual.
662 If you are going to use the Toaster container, see the
663 "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
664 section in the Toaster User Manual.
665 </para>
666 </section>
Andrew Geissler82c905d2020-04-13 13:39:40 -0500667
668 <section id='setting-up-to-use-wsl'>
669 <title>Setting Up to Use Windows Subsystem For Linux (WSLv2)</title>
670
671 <para>
672 With <ulink url='https://docs.microsoft.com/en-us/windows/wsl/wsl2-about'>
673 Windows Subsystem for Linux (WSLv2)</ulink>, you can create a
674 Yocto Project development environment that allows you to build
675 on Windows. You can set up a Linux distribution inside Windows
676 in which you can develop using the Yocto Project.
677 </para>
678
679 <para>
680 Follow these general steps to prepare a Windows machine using WSLv2
681 as your Yocto Project build host:
682 <orderedlist>
683 <listitem><para>
684 <emphasis>Make sure your Windows 10 machine is capable of running WSLv2:</emphasis>
685
686 WSLv2 is only available for Windows 10 builds > 18917. To
687 check which build version you are running, you may open a
688 command prompt on Windows and execute the command "ver".
689 <literallayout class='monospaced'>
690 C:\Users\myuser> ver
691
692 Microsoft Windows [Version 10.0.19041.153]
693 </literallayout>
694 If your build is capable of running WSLv2 you may continue,
695 for more information on this subject or instructions on how
696 to upgrade to WSLv2 visit <ulink url='https://docs.microsoft.com/en-us/windows/wsl/wsl2-install'>Windows 10 WSLv2</ulink>
697 </para></listitem>
698 <listitem><para>
699 <emphasis>Install the Linux distribution of your choice inside Windows 10:</emphasis>
700 Once you know your version of Windows 10 supports WSLv2,
701 you can install the distribution of your choice from the
702 Microsoft Store.
703 Open the Microsoft Store and search for Linux. While there
704 are several Linux distributions available, the assumption
705 is that your pick will be one of the distributions supported
706 by the Yocto Project as stated on the instructions for
707 using a native Linux host.
708 After making your selection, simply click "Get" to download
709 and install the distribution.
710 </para></listitem>
711 <listitem><para>
712 <emphasis>Check your Linux distribution is using WSLv2:</emphasis>
713 Open a Windows PowerShell and run:
714 <literallayout class='monospaced'>
715 C:\WINDOWS\system32> wsl -l -v
716 NAME STATE VERSION
717 *Ubuntu Running 2
718 </literallayout>
719 Note the version column which says the WSL version being used by
720 your distribution, on compatible systems, this can be changed back
721 at any point in time.
722 </para></listitem>
723 <listitem><para>
724 <emphasis>Optionally Orient Yourself on WSL:</emphasis>
725 If you are unfamiliar with WSL, you can learn more here -
726 <ulink url='https://docs.microsoft.com/en-us/windows/wsl/wsl2-about'></ulink>.
727 </para></listitem>
728 <listitem><para>
729 <emphasis>Launch your WSL Distibution:</emphasis>
730 From the Windows start menu simply launch your WSL distribution
731 just like any other application.
732 </para></listitem>
733 <listitem><para>
734 <emphasis>Optimize your WSLv2 storage often:</emphasis>
735 Due to the way storage is handled on WSLv2, the storage
736 space used by the undelying Linux distribution is not
737 reflected immedately, and since bitbake heavily uses
738 storage, after several builds, you may be unaware you
739 are running out of space. WSLv2 uses a VHDX file for
740 storage, this issue can be easily avoided by manually
741 optimizing this file often, this can be done in the
742 following way:
743 <orderedlist>
744 <listitem><para>
745 <emphasis>Find the location of your VHDX file:</emphasis>
746 First you need to find the distro app package directory,
747 to achieve this open a Windows Powershell as Administrator
748 and run:
749 <literallayout class='monospaced'>
750 C:\WINDOWS\system32> Get-AppxPackage -Name "*Ubuntu*" | Select PackageFamilyName
751 PackageFamilyName
752 -----------------
753 CanonicalGroupLimited.UbuntuonWindows_79abcdefgh
754 </literallayout>
755 You should now replace the <replaceable>PackageFamilyName</replaceable>
756 and your <replaceable>user</replaceable> on the following
757 path to find your VHDX file: <filename>C:\Users\user\AppData\Local\Packages\PackageFamilyName\LocalState\</filename>
758 For example:
759 <literallayout class='monospaced'>
760 ls C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\
761 Mode LastWriteTime Length Name
762 -a---- 3/14/2020 9:52 PM 57418973184 ext4.vhdx
763 </literallayout>
764 Your VHDX file path is: <filename>C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx</filename>
765 </para></listitem>
766 <listitem><para><emphasis>Optimize your VHDX file:</emphasis>
767 Open a Windows Powershell as Administrator to optimize
768 your VHDX file, shutting down WSL first:
769 <literallayout class='monospaced'>
770 C:\WINDOWS\system32> wsl --shutdown
771 C:\WINDOWS\system32> optimize-vhd -Path C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx -Mode full
772 </literallayout>
773 A progress bar should be shown while optimizing the VHDX file,
774 and storage should now be reflected correctly on the Windows
775 Explorer.
776 </para></listitem>
777 </orderedlist>
778 </para></listitem>
779 </orderedlist>
780 <note>
781 The current implementation of WSLv2 does not have out-of-the-box
782 access to external devices such as those connected through a
783 USB port, but it automatically mounts your <filename>C:</filename>
784 drive on <filename>/mnt/c/</filename> (and others), which
785 you can use to share deploy artifacts to be later flashed on
786 hardware through Windows, but your build directory should not
787 reside inside this mountpoint.
788 </note>
789 Once you have WSLv2 set up, everything is in place to
790 develop just as if you were running on a native Linux machine.
791 If you are going to use the Extensible SDK container, see the
792 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
793 Chapter in the Yocto Project Application Development and the
794 Extensible Software Development Kit (eSDK) manual.
795 If you are going to use the Toaster container, see the
796 "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
797 section in the Toaster User Manual.
798 </para>
799 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500800</section>
801
Brad Bishop316dfdd2018-06-25 12:45:53 -0400802<section id='locating-yocto-project-source-files'>
803 <title>Locating Yocto Project Source Files</title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500804
805 <para>
Andrew Geissler82c905d2020-04-13 13:39:40 -0500806 This section shows you how to locate, fetch and configure the source
807 files you'll need to work with the Yocto Project.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500808 <note><title>Notes</title>
809 <itemizedlist>
810 <listitem><para>
811 For concepts and introductory information about Git as it
812 is used in the Yocto Project, see the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400813 "<ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>"
814 section in the Yocto Project Overview and Concepts Manual.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500815 </para></listitem>
816 <listitem><para>
817 For concepts on Yocto Project source repositories, see the
Brad Bishop316dfdd2018-06-25 12:45:53 -0400818 "<ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
819 section in the Yocto Project Overview and Concepts Manual."
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500820 </para></listitem>
821 </itemizedlist>
822 </note>
823 </para>
824
825 <section id='accessing-source-repositories'>
826 <title>Accessing Source Repositories</title>
827
828 <para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400829 Working from a copy of the upstream Yocto Project
830 <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
831 is the preferred method for obtaining and using a Yocto Project
832 release.
833 You can view the Yocto Project Source Repositories at
834 <ulink url='&YOCTO_GIT_URL;'></ulink>.
835 In particular, you can find the
836 <filename>poky</filename> repository at
837 <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/'></ulink>.
838 </para>
839
840 <para>
841 Use the following procedure to locate the latest upstream copy of
842 the <filename>poky</filename> Git repository:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500843 <orderedlist>
844 <listitem><para>
845 <emphasis>Access Repositories:</emphasis>
846 Open a browser and go to
847 <ulink url='&YOCTO_GIT_URL;'></ulink> to access the
848 GUI-based interface into the Yocto Project source
849 repositories.
850 </para></listitem>
851 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400852 <emphasis>Select the Repository:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800853 Click on the repository in which you are interested (e.g.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500854 <filename>poky</filename>).
855 </para></listitem>
856 <listitem><para>
857 <emphasis>Find the URL Used to Clone the Repository:</emphasis>
858 At the bottom of the page, note the URL used to
Brad Bishop316dfdd2018-06-25 12:45:53 -0400859 <ulink url='&YOCTO_DOCS_OM_URL;#git-commands-clone'>clone</ulink>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500860 that repository (e.g.
861 <filename>&YOCTO_GIT_URL;/poky</filename>).
Brad Bishop316dfdd2018-06-25 12:45:53 -0400862 <note>
863 For information on cloning a repository, see the
864 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
865 section.
866 </note>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500867 </para></listitem>
868 </orderedlist>
869 </para>
870 </section>
871
872 <section id='accessing-index-of-releases'>
873 <title>Accessing Index of Releases</title>
874
875 <para>
876 Yocto Project maintains an Index of Releases area that contains
877 related files that contribute to the Yocto Project.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400878 Rather than Git repositories, these files are tarballs that
879 represent snapshots in time of a given component.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500880 <note><title>Tip</title>
881 The recommended method for accessing Yocto Project
Brad Bishop316dfdd2018-06-25 12:45:53 -0400882 components is to use Git to clone the upstream repository and
883 work from within that locally cloned repository.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500884 The procedure in this section exists should you desire a
885 tarball snapshot of any given component.
886 </note>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800887 Follow these steps to locate and download a particular tarball:
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500888 <orderedlist>
889 <listitem><para>
890 <emphasis>Access the Index of Releases:</emphasis>
891 Open a browser and go to
892 <ulink url='&YOCTO_DL_URL;/releases'></ulink> to access the
893 Index of Releases.
894 The list represents released components (e.g.
Brad Bishopc342db32019-05-15 21:57:59 -0400895 <filename>bitbake</filename>,
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500896 <filename>sato</filename>, and so on).
897 <note>
898 The <filename>yocto</filename> directory contains the
899 full array of released Poky tarballs.
900 The <filename>poky</filename> directory in the
901 Index of Releases was historically used for very
Brad Bishop316dfdd2018-06-25 12:45:53 -0400902 early releases and exists now only for retroactive
903 completeness.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500904 </note>
905 </para></listitem>
906 <listitem><para>
907 <emphasis>Select a Component:</emphasis>
908 Click on any released component in which you are interested
909 (e.g. <filename>yocto</filename>).
910 </para></listitem>
911 <listitem><para>
912 <emphasis>Find the Tarball:</emphasis>
913 Drill down to find the associated tarball.
914 For example, click on <filename>yocto-&DISTRO;</filename> to
915 view files associated with the Yocto Project &DISTRO;
916 release (e.g. <filename>poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;.tar.bz2</filename>,
917 which is the released Poky tarball).
918 </para></listitem>
919 <listitem><para>
920 <emphasis>Download the Tarball:</emphasis>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400921 Click the tarball to download and save a snapshot of the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500922 given component.
923 </para></listitem>
924 </orderedlist>
925 </para>
926 </section>
927
928 <section id='using-the-downloads-page'>
929 <title>Using the Downloads Page</title>
930
931 <para>
932 The
933 <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400934 uses a "DOWNLOADS" page from which you can locate and download
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500935 tarballs of any Yocto Project release.
936 Rather than Git repositories, these files represent snapshot
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800937 tarballs similar to the tarballs located in the Index of Releases
938 described in the
939 "<link linkend='accessing-index-of-releases'>Accessing Index of Releases</link>"
940 section.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500941 <note><title>Tip</title>
942 The recommended method for accessing Yocto Project
943 components is to use Git to clone a repository and work from
944 within that local repository.
945 The procedure in this section exists should you desire a
946 tarball snapshot of any given component.
947 </note>
948 <orderedlist>
949 <listitem><para>
950 <emphasis>Go to the Yocto Project Website:</emphasis>
951 Open The
952 <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
953 in your browser.
954 </para></listitem>
955 <listitem><para>
956 <emphasis>Get to the Downloads Area:</emphasis>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400957 Select the "DOWNLOADS" item from the pull-down
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800958 "SOFTWARE" tab menu near the top of the page.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500959 </para></listitem>
960 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400961 <emphasis>Select a Yocto Project Release:</emphasis>
962 Use the menu next to "RELEASE" to display and choose
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800963 a recent or past supported Yocto Project release
964 (e.g. &DISTRO_NAME_NO_CAP;,
965 &DISTRO_NAME_NO_CAP_MINUS_ONE;, and so forth).
966 <note><title>Tip</title>
967 For a "map" of Yocto Project releases to version
968 numbers, see the
969 <ulink url='https://wiki.yoctoproject.org/wiki/Releases'>Releases</ulink>
970 wiki page.
971 </note>
972 You can use the "RELEASE ARCHIVE" link to reveal a menu of
973 all Yocto Project releases.
974 </para></listitem>
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500975 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -0400976 <emphasis>Download Tools or Board Support Packages (BSPs):</emphasis>
977 From the "DOWNLOADS" page, you can download tools or
978 BSPs as well.
979 Just scroll down the page and look for what you need.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500980 </para></listitem>
981 </orderedlist>
982 </para>
983 </section>
984
Brad Bishop316dfdd2018-06-25 12:45:53 -0400985 <section id='accessing-nightly-builds'>
986 <title>Accessing Nightly Builds</title>
987
988 <para>
989 Yocto Project maintains an area for nightly builds that contains
990 tarball releases at <ulink url='&YOCTO_AB_NIGHTLY_URL;'/>.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800991 These builds include Yocto Project releases ("poky"),
Brad Bishopc342db32019-05-15 21:57:59 -0400992 toolchains, and builds for supported machines.
Brad Bishop316dfdd2018-06-25 12:45:53 -0400993 </para>
994
995 <para>
996 Should you ever want to access a nightly build of a particular
997 Yocto Project component, use the following procedure:
998 <orderedlist>
999 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001000 <emphasis>Locate the Index of Nightly Builds:</emphasis>
Brad Bishop316dfdd2018-06-25 12:45:53 -04001001 Open a browser and go to
1002 <ulink url='&YOCTO_AB_NIGHTLY_URL;'/> to access the
1003 Nightly Builds.
1004 </para></listitem>
1005 <listitem><para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001006 <emphasis>Select a Date:</emphasis>
1007 Click on the date in which you are interested.
1008 If you want the latest builds, use "CURRENT".
1009 </para></listitem>
1010 <listitem><para>
Brad Bishop316dfdd2018-06-25 12:45:53 -04001011 <emphasis>Select a Build:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001012 Choose the area in which you are interested.
1013 For example, if you are looking for the most recent
1014 toolchains, select the "toolchain" link.
Brad Bishop316dfdd2018-06-25 12:45:53 -04001015 </para></listitem>
1016 <listitem><para>
1017 <emphasis>Find the Tarball:</emphasis>
1018 Drill down to find the associated tarball.
1019 </para></listitem>
1020 <listitem><para>
1021 <emphasis>Download the Tarball:</emphasis>
1022 Click the tarball to download and save a snapshot of the
1023 given component.
1024 </para></listitem>
1025 </orderedlist>
1026 </para>
1027 </section>
1028</section>
1029
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001030<section id='cloning-and-checking-out-branches'>
Brad Bishop316dfdd2018-06-25 12:45:53 -04001031 <title>Cloning and Checking Out Branches</title>
1032
1033 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001034 To use the Yocto Project for development, you need a release locally
1035 installed on your development system.
1036 This locally installed set of files is referred to as the
Brad Bishop316dfdd2018-06-25 12:45:53 -04001037 <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
1038 in the Yocto Project documentation.
1039 </para>
1040
1041 <para>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001042 The preferred method of creating your Source Directory is by using
Brad Bishop316dfdd2018-06-25 12:45:53 -04001043 <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink> to clone a local
1044 copy of the upstream <filename>poky</filename> repository.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001045 Working from a cloned copy of the upstream repository allows you
1046 to contribute back into the Yocto Project or to simply work with
Brad Bishop316dfdd2018-06-25 12:45:53 -04001047 the latest software on a development branch.
1048 Because Git maintains and creates an upstream repository with
1049 a complete history of changes and you are working with a local
1050 clone of that repository, you have access to all the Yocto
1051 Project development branches and tag names used in the upstream
1052 repository.
1053 </para>
1054
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001055 <section id='cloning-the-poky-repository'>
1056 <title>Cloning the <filename>poky</filename> Repository</title>
1057
1058 <para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001059 Follow these steps to create a local version of the
1060 upstream
1061 <ulink url='&YOCTO_DOCS_REF_URL;#poky'><filename>poky</filename></ulink>
1062 Git repository.
1063 <orderedlist>
1064 <listitem><para>
1065 <emphasis>Set Your Directory:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001066 Change your working directory to where you want to
1067 create your local copy of
1068 <filename>poky</filename>.
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001069 </para></listitem>
1070 <listitem><para>
1071 <emphasis>Clone the Repository:</emphasis>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001072 The following example command clones the
1073 <filename>poky</filename> repository and uses
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001074 the default name "poky" for your local repository:
1075 <literallayout class='monospaced'>
1076 $ git clone git://git.yoctoproject.org/poky
1077 Cloning into 'poky'...
Brad Bishop19323692019-04-05 15:28:33 -04001078 remote: Counting objects: 432160, done.
1079 remote: Compressing objects: 100% (102056/102056), done.
1080 remote: Total 432160 (delta 323116), reused 432037 (delta 323000)
1081 Receiving objects: 100% (432160/432160), 153.81 MiB | 8.54 MiB/s, done.
1082 Resolving deltas: 100% (323116/323116), done.
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001083 Checking connectivity... done.
1084 </literallayout>
1085 Unless you specify a specific development branch or
1086 tag name, Git clones the "master" branch, which results
1087 in a snapshot of the latest development changes for
1088 "master".
1089 For information on how to check out a specific
1090 development branch or on how to check out a local
1091 branch based on a tag name, see the
1092 "<link linkend='checking-out-by-branch-in-poky'>Checking Out By Branch in Poky</link>"
1093 and
Brad Bishop316dfdd2018-06-25 12:45:53 -04001094 <link linkend='checkout-out-by-tag-in-poky'>Checking Out By Tag in Poky</link>"
1095 sections, respectively.</para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001096
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001097 <para>Once the local repository is created, you can
1098 change to that directory and check its status.
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001099 Here, the single "master" branch exists on your system
1100 and by default, it is checked out:
1101 <literallayout class='monospaced'>
1102 $ cd ~/poky
1103 $ git status
1104 On branch master
1105 Your branch is up-to-date with 'origin/master'.
1106 nothing to commit, working directory clean
1107 $ git branch
1108 * master
1109 </literallayout>
1110 Your local repository of poky is identical to the
1111 upstream poky repository at the time from which it was
1112 cloned.
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001113 As you work with the local branch, you can periodically
1114 use the <filename>git pull &dash;&dash;rebase</filename>
1115 command to be sure you are up-to-date with the upstream
1116 branch.
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001117 </para></listitem>
1118 </orderedlist>
1119 </para>
1120 </section>
1121
1122 <section id='checking-out-by-branch-in-poky'>
1123 <title>Checking Out by Branch in Poky</title>
1124
1125 <para>
1126 When you clone the upstream poky repository, you have access to
1127 all its development branches.
1128 Each development branch in a repository is unique as it forks
1129 off the "master" branch.
1130 To see and use the files of a particular development branch
1131 locally, you need to know the branch name and then specifically
1132 check out that development branch.
1133 <note>
1134 Checking out an active development branch by branch name
1135 gives you a snapshot of that particular branch at the time
1136 you check it out.
1137 Further development on top of the branch that occurs after
1138 check it out can occur.
1139 </note>
1140 <orderedlist>
1141 <listitem><para>
1142 <emphasis>Switch to the Poky Directory:</emphasis>
1143 If you have a local poky Git repository, switch to that
1144 directory.
1145 If you do not have the local copy of poky, see the
1146 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
1147 section.
1148 </para></listitem>
1149 <listitem><para>
1150 <emphasis>Determine Existing Branch Names:</emphasis>
1151 <literallayout class='monospaced'>
1152 $ git branch -a
1153 * master
1154 remotes/origin/1.1_M1
1155 remotes/origin/1.1_M2
1156 remotes/origin/1.1_M3
1157 remotes/origin/1.1_M4
1158 remotes/origin/1.2_M1
1159 remotes/origin/1.2_M2
1160 remotes/origin/1.2_M3
1161 .
1162 .
1163 .
Brad Bishop19323692019-04-05 15:28:33 -04001164 remotes/origin/thud
1165 remotes/origin/thud-next
1166 remotes/origin/warrior
Andrew Geissler82c905d2020-04-13 13:39:40 -05001167 remotes/origin/warrior-next
1168 remotes/origin/zeus
1169 remotes/origin/zeus-next
1170 ... and so on ...
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001171 </literallayout>
1172 </para></listitem>
1173 <listitem><para>
Andrew Geissler82c905d2020-04-13 13:39:40 -05001174 <emphasis>Check out the Branch:</emphasis>
1175 Check out the development branch in which you want to work.
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001176 For example, to access the files for the Yocto Project
1177 &DISTRO; Release (&DISTRO_NAME;), use the following command:
1178 <literallayout class='monospaced'>
1179 $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
1180 Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
1181 Switched to a new branch '&DISTRO_NAME_NO_CAP;'
1182 </literallayout>
1183 The previous command checks out the "&DISTRO_NAME_NO_CAP;"
1184 development branch and reports that the branch is tracking
1185 the upstream "origin/&DISTRO_NAME_NO_CAP;" branch.</para>
1186
1187 <para>The following command displays the branches
1188 that are now part of your local poky repository.
1189 The asterisk character indicates the branch that is
1190 currently checked out for work:
1191 <literallayout class='monospaced'>
1192 $ git branch
1193 master
1194 * &DISTRO_NAME_NO_CAP;
1195 </literallayout>
1196 </para></listitem>
1197 </orderedlist>
1198 </para>
1199 </section>
1200
1201 <section id='checkout-out-by-tag-in-poky'>
1202 <title>Checking Out by Tag in Poky</title>
1203
1204 <para>
1205 Similar to branches, the upstream repository uses tags
1206 to mark specific commits associated with significant points in
1207 a development branch (i.e. a release point or stage of a
1208 release).
1209 You might want to set up a local branch based on one of those
1210 points in the repository.
1211 The process is similar to checking out by branch name except you
1212 use tag names.
1213 <note>
1214 Checking out a branch based on a tag gives you a
1215 stable set of files not affected by development on the
1216 branch above the tag.
1217 </note>
1218 <orderedlist>
1219 <listitem><para>
1220 <emphasis>Switch to the Poky Directory:</emphasis>
1221 If you have a local poky Git repository, switch to that
1222 directory.
1223 If you do not have the local copy of poky, see the
1224 "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
1225 section.
1226 </para></listitem>
1227 <listitem><para>
1228 <emphasis>Fetch the Tag Names:</emphasis>
1229 To checkout the branch based on a tag name, you need to
1230 fetch the upstream tags into your local repository:
1231 <literallayout class='monospaced'>
1232 $ git fetch --tags
1233 $
1234 </literallayout>
1235 </para></listitem>
1236 <listitem><para>
1237 <emphasis>List the Tag Names:</emphasis>
1238 You can list the tag names now:
1239 <literallayout class='monospaced'>
1240 $ git tag
1241 1.1_M1.final
1242 1.1_M1.rc1
1243 1.1_M1.rc2
1244 1.1_M2.final
1245 1.1_M2.rc1
1246 .
1247 .
1248 .
Scott Rifenbarkfa4cfe32019-01-11 11:55:06 -08001249 yocto-2.5
1250 yocto-2.5.1
1251 yocto-2.5.2
Brad Bishop19323692019-04-05 15:28:33 -04001252 yocto-2.5.3
Scott Rifenbarkfa4cfe32019-01-11 11:55:06 -08001253 yocto-2.6
Scott Rifenbarkb0466fb2019-01-22 10:21:44 -08001254 yocto-2.6.1
Brad Bishopc342db32019-05-15 21:57:59 -04001255 yocto-2.6.2
Brad Bishop19323692019-04-05 15:28:33 -04001256 yocto-2.7
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001257 yocto_1.5_M5.rc8
1258 </literallayout>
1259 </para></listitem>
1260 <listitem><para>
Andrew Geissler82c905d2020-04-13 13:39:40 -05001261 <emphasis>Check out the Branch:</emphasis>
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001262 <literallayout class='monospaced'>
Brad Bishop316dfdd2018-06-25 12:45:53 -04001263 $ git checkout tags/&DISTRO_REL_TAG; -b my_yocto_&DISTRO;
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001264 Switched to a new branch 'my_yocto_&DISTRO;'
1265 $ git branch
1266 master
1267 * my_yocto_&DISTRO;
1268 </literallayout>
1269 The previous command creates and checks out a local
1270 branch named "my_yocto_&DISTRO;", which is based on
1271 the commit in the upstream poky repository that has
1272 the same tag.
1273 In this example, the files you have available locally
1274 as a result of the <filename>checkout</filename>
1275 command are a snapshot of the
1276 "&DISTRO_NAME_NO_CAP;" development branch at the point
1277 where Yocto Project &DISTRO; was released.
1278 </para></listitem>
1279 </orderedlist>
1280 </para>
1281 </section>
1282</section>
1283
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001284</chapter>
1285<!--
1286vim: expandtab tw=80 ts=4
1287-->