blob: 762605a0aaf4c222205d53a04220ef93b36edb88 [file] [log] [blame]
Andrew Geisslerf0343792020-11-18 10:42:21 -06001.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002
3***********************************
4Setting Up to Use the Yocto Project
5***********************************
6
7This chapter provides guidance on how to prepare to use the Yocto
8Project. You can learn about creating a team environment to develop
9using the Yocto Project, how to set up a :ref:`build
Andrew Geissler09209ee2020-12-13 08:44:15 -060010host <dev-manual/start:preparing the build host>`, how to locate
Andrew Geisslerc9f78652020-09-18 14:11:35 -050011Yocto Project source repositories, and how to create local Git
12repositories.
13
Andrew Geisslerc9f78652020-09-18 14:11:35 -050014Creating a Team Development Environment
15=======================================
16
17It might not be immediately clear how you can use the Yocto Project in a
18team development environment, or how to scale it for a large team of
19developers. You can adapt the Yocto Project to many different use cases
20and scenarios; however, this flexibility could cause difficulties if you
21are trying to create a working setup that scales effectively.
22
23To help you understand how to set up this type of environment, this
24section presents a procedure that gives you information that can help
25you get the results you want. The procedure is high-level and presents
26some of the project's most successful experiences, practices, solutions,
27and available technologies that have proved to work well in the past;
28however, keep in mind, the procedure here is simply a starting point.
29You can build off these steps and customize the procedure to fit any
30particular working environment and set of practices.
31
Andrew Geissler517393d2023-01-13 08:55:19 -060032#. *Determine Who is Going to be Developing:* You first need to
Andrew Geisslerc9f78652020-09-18 14:11:35 -050033 understand who is going to be doing anything related to the Yocto
34 Project and determine their roles. Making this determination is
35 essential to completing subsequent steps, which are to get your
36 equipment together and set up your development environment's
37 hardware topology.
38
William A. Kennington IIIac69b482021-06-02 12:28:27 -070039 Here are possible roles:
Andrew Geisslerc9f78652020-09-18 14:11:35 -050040
41 - *Application Developer:* This type of developer does application
42 level work on top of an existing software stack.
43
44 - *Core System Developer:* This type of developer works on the
45 contents of the operating system image itself.
46
47 - *Build Engineer:* This type of developer manages Autobuilders and
48 releases. Depending on the specifics of the environment, not all
49 situations might need a Build Engineer.
50
51 - *Test Engineer:* This type of developer creates and manages
52 automated tests that are used to ensure all application and core
53 system development meets desired quality standards.
54
Andrew Geissler517393d2023-01-13 08:55:19 -060055#. *Gather the Hardware:* Based on the size and make-up of the team,
Andrew Geisslerc9f78652020-09-18 14:11:35 -050056 get the hardware together. Ideally, any development, build, or test
57 engineer uses a system that runs a supported Linux distribution.
58 These systems, in general, should be high performance (e.g. dual,
59 six-core Xeons with 24 Gbytes of RAM and plenty of disk space). You
60 can help ensure efficiency by having any machines used for testing
61 or that run Autobuilders be as high performance as possible.
62
63 .. note::
64
65 Given sufficient processing power, you might also consider
66 building Yocto Project development containers to be run under
67 Docker, which is described later.
68
Andrew Geissler517393d2023-01-13 08:55:19 -060069#. *Understand the Hardware Topology of the Environment:* Once you
Andrew Geisslerc9f78652020-09-18 14:11:35 -050070 understand the hardware involved and the make-up of the team, you
71 can understand the hardware topology of the development environment.
72 You can get a visual idea of the machines and their roles across the
73 development environment.
74
Andrew Geissler517393d2023-01-13 08:55:19 -060075#. *Use Git as Your Source Control Manager (SCM):* Keeping your
Andrew Geisslerc9f78652020-09-18 14:11:35 -050076 :term:`Metadata` (i.e. recipes,
77 configuration files, classes, and so forth) and any software you are
78 developing under the control of an SCM system that is compatible
79 with the OpenEmbedded build system is advisable. Of all of the SCMs
80 supported by BitBake, the Yocto Project team strongly recommends using
Andrew Geissler09209ee2020-12-13 08:44:15 -060081 :ref:`overview-manual/development-environment:git`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050082 Git is a distributed system
83 that is easy to back up, allows you to work remotely, and then
84 connects back to the infrastructure.
85
86 .. note::
87
88 For information about BitBake, see the
Andrew Geissler4c19ea12020-10-27 13:52:24 -050089 :doc:`bitbake:index`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050090
Patrick Williamsac13d5f2023-11-24 18:59:46 -060091 It is relatively easy to set up Git services and create infrastructure like
92 :yocto_git:`/`, which is based on server software called
93 `Gitolite <https://gitolite.com>`__
94 with `cgit <https://git.zx2c4.com/cgit/about/>`__ being used to
95 generate the web interface that lets you view the repositories.
96 ``gitolite`` identifies users using SSH keys and allows
Andrew Geisslerc9f78652020-09-18 14:11:35 -050097 branch-based access controls to repositories that you can control as
98 little or as much as necessary.
99
Andrew Geissler517393d2023-01-13 08:55:19 -0600100#. *Set up the Application Development Machines:* As mentioned earlier,
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500101 application developers are creating applications on top of existing
102 software stacks. Following are some best practices for setting up
103 machines used for application development:
104
105 - Use a pre-built toolchain that contains the software stack
106 itself. Then, develop the application code on top of the stack.
107 This method works well for small numbers of relatively isolated
108 applications.
109
110 - Keep your cross-development toolchains updated. You can do this
111 through provisioning either as new toolchain downloads or as
112 updates through a package update mechanism using ``opkg`` to
113 provide updates to an existing toolchain. The exact mechanics of
114 how and when to do this depend on local policy.
115
116 - Use multiple toolchains installed locally into different
117 locations to allow development across versions.
118
Andrew Geissler517393d2023-01-13 08:55:19 -0600119#. *Set up the Core Development Machines:* As mentioned earlier, core
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500120 developers work on the contents of the operating system itself.
121 Following are some best practices for setting up machines used for
122 developing images:
123
124 - Have the :term:`OpenEmbedded Build System` available on
125 the developer workstations so developers can run their own builds
126 and directly rebuild the software stack.
127
128 - Keep the core system unchanged as much as possible and do your
129 work in layers on top of the core system. Doing so gives you a
130 greater level of portability when upgrading to new versions of
131 the core system or Board Support Packages (BSPs).
132
133 - Share layers amongst the developers of a particular project and
134 contain the policy configuration that defines the project.
135
Andrew Geissler517393d2023-01-13 08:55:19 -0600136#. *Set up an Autobuilder:* Autobuilders are often the core of the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500137 development environment. It is here that changes from individual
138 developers are brought together and centrally tested. Based on this
139 automated build and test environment, subsequent decisions about
140 releases can be made. Autobuilders also allow for "continuous
141 integration" style testing of software components and regression
142 identification and tracking.
143
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500144 See ":yocto_ab:`Yocto Project Autobuilder <>`" for more
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500145 information and links to buildbot. The Yocto Project team has found
146 this implementation works well in this role. A public example of
147 this is the Yocto Project Autobuilders, which the Yocto Project team
148 uses to test the overall health of the project.
149
150 The features of this system are:
151
152 - Highlights when commits break the build.
153
154 - Populates an :ref:`sstate
Andrew Geissler09209ee2020-12-13 08:44:15 -0600155 cache <overview-manual/concepts:shared state cache>` from which
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500156 developers can pull rather than requiring local builds.
157
158 - Allows commit hook triggers, which trigger builds when commits
159 are made.
160
161 - Allows triggering of automated image booting and testing under
162 the QuickEMUlator (QEMU).
163
164 - Supports incremental build testing and from-scratch builds.
165
166 - Shares output that allows developer testing and historical
167 regression investigation.
168
169 - Creates output that can be used for releases.
170
171 - Allows scheduling of builds so that resources can be used
172 efficiently.
173
Andrew Geissler517393d2023-01-13 08:55:19 -0600174#. *Set up Test Machines:* Use a small number of shared, high
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500175 performance systems for testing purposes. Developers can use these
176 systems for wider, more extensive testing while they continue to
177 develop locally using their primary development system.
178
Andrew Geissler517393d2023-01-13 08:55:19 -0600179#. *Document Policies and Change Flow:* The Yocto Project uses a
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700180 hierarchical structure and a pull model. There are scripts to create and
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500181 send pull requests (i.e. ``create-pull-request`` and
182 ``send-pull-request``). This model is in line with other open source
183 projects where maintainers are responsible for specific areas of the
184 project and a single maintainer handles the final "top-of-tree"
185 merges.
186
187 .. note::
188
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500189 You can also use a more collective push model. The ``gitolite``
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500190 software supports both the push and pull models quite easily.
191
192 As with any development environment, it is important to document the
193 policy used as well as any main project guidelines so they are
194 understood by everyone. It is also a good idea to have
195 well-structured commit messages, which are usually a part of a
196 project's guidelines. Good commit messages are essential when
197 looking back in time and trying to understand why changes were made.
198
199 If you discover that changes are needed to the core layer of the
200 project, it is worth sharing those with the community as soon as
201 possible. Chances are if you have discovered the need for changes,
202 someone else in the community needs them also.
203
Andrew Geissler517393d2023-01-13 08:55:19 -0600204#. *Development Environment Summary:* Aside from the previous steps,
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700205 here are best practices within the Yocto Project development
206 environment:
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500207
Andrew Geissler09209ee2020-12-13 08:44:15 -0600208 - Use :ref:`overview-manual/development-environment:git` as the source control
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500209 system.
210
211 - Maintain your Metadata in layers that make sense for your
Andrew Geissler09209ee2020-12-13 08:44:15 -0600212 situation. See the ":ref:`overview-manual/yp-intro:the yocto project layer model`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500213 section in the Yocto Project Overview and Concepts Manual and the
Andrew Geissler517393d2023-01-13 08:55:19 -0600214 ":ref:`dev-manual/layers:understanding and creating layers`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500215 section for more information on layers.
216
217 - Separate the project's Metadata and code by using separate Git
Andrew Geissler09209ee2020-12-13 08:44:15 -0600218 repositories. See the ":ref:`overview-manual/development-environment:yocto project source repositories`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500219 section in the Yocto Project Overview and Concepts Manual for
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500220 information on these repositories. See the
221 ":ref:`dev-manual/start:locating yocto project source files`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500222 section for information on how to set up local Git repositories
223 for related upstream Yocto Project Git repositories.
224
225 - Set up the directory for the shared state cache
226 (:term:`SSTATE_DIR`) where
227 it makes sense. For example, set up the sstate cache on a system
228 used by developers in the same organization and share the same
229 source directories on their machines.
230
231 - Set up an Autobuilder and have it populate the sstate cache and
232 source directories.
233
234 - The Yocto Project community encourages you to send patches to the
235 project to fix bugs or add features. If you do submit patches,
236 follow the project commit guidelines for writing good commit
Andrew Geissler5082cc72023-09-11 08:41:39 -0400237 messages. See the ":doc:`../contributor-guide/submit-changes`"
238 section in the Yocto Project and OpenEmbedded Contributor Guide.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500239
240 - Send changes to the core sooner than later as others are likely
241 to run into the same issues. For some guidance on mailing lists
Andrew Geissler5082cc72023-09-11 08:41:39 -0400242 to use, see the lists in the
243 ":ref:`contributor-guide/submit-changes:finding a suitable mailing list`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500244 section. For a description
245 of the available mailing lists, see the ":ref:`resources-mailinglist`" section in
246 the Yocto Project Reference Manual.
247
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500248Preparing the Build Host
249========================
250
251This section provides procedures to set up a system to be used as your
252:term:`Build Host` for
253development using the Yocto Project. Your build host can be a native
254Linux machine (recommended), it can be a machine (Linux, Mac, or
255Windows) that uses `CROPS <https://github.com/crops/poky-container>`__,
256which leverages `Docker Containers <https://www.docker.com/>`__ or it
Patrick Williams2390b1b2022-11-03 13:47:49 -0500257can be a Windows machine capable of running version 2 of Windows Subsystem
258For Linux (WSL 2).
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500259
260.. note::
261
Patrick Williams2390b1b2022-11-03 13:47:49 -0500262 The Yocto Project is not compatible with version 1 of
Patrick Williams7784c422022-11-17 07:29:11 -0600263 :wikipedia:`Windows Subsystem for Linux <Windows_Subsystem_for_Linux>`.
Patrick Williams2390b1b2022-11-03 13:47:49 -0500264 It is compatible but neither officially supported nor validated with
265 WSL 2. If you still decide to use WSL please upgrade to
266 `WSL 2 <https://learn.microsoft.com/en-us/windows/wsl/install>`__.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500267
268Once your build host is set up to use the Yocto Project, further steps
269are necessary depending on what you want to accomplish. See the
270following references for information on how to prepare for Board Support
271Package (BSP) development and kernel development:
272
273- *BSP Development:* See the ":ref:`bsp-guide/bsp:preparing your build host to work with bsp layers`"
274 section in the Yocto Project Board Support Package (BSP) Developer's
275 Guide.
276
Andrew Geissler09209ee2020-12-13 08:44:15 -0600277- *Kernel Development:* See the ":ref:`kernel-dev/common:preparing the build host to work on the kernel`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500278 section in the Yocto Project Linux Kernel Development Manual.
279
280Setting Up a Native Linux Host
281------------------------------
282
283Follow these steps to prepare a native Linux machine as your Yocto
284Project Build Host:
285
Andrew Geissler517393d2023-01-13 08:55:19 -0600286#. *Use a Supported Linux Distribution:* You should have a reasonably
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500287 current Linux-based host system. You will have the best results with
288 a recent release of Fedora, openSUSE, Debian, Ubuntu, RHEL or CentOS
289 as these releases are frequently tested against the Yocto Project and
290 officially supported. For a list of the distributions under
291 validation and their status, see the ":ref:`Supported Linux
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500292 Distributions <system-requirements-supported-distros>`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500293 section in the Yocto Project Reference Manual and the wiki page at
Andrew Geissler09209ee2020-12-13 08:44:15 -0600294 :yocto_wiki:`Distribution Support </Distribution_Support>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500295
Andrew Geissler517393d2023-01-13 08:55:19 -0600296#. *Have Enough Free Memory:* Your system should have at least 50 Gbytes
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500297 of free disk space for building images.
298
Andrew Geissler517393d2023-01-13 08:55:19 -0600299#. *Meet Minimal Version Requirements:* The OpenEmbedded build system
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500300 should be able to run on any modern distribution that has the
Andrew Geissler615f2f12022-07-15 14:00:58 -0500301 following versions for Git, tar, Python, gcc and make.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500302
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500303 - Git &MIN_GIT_VERSION; or greater
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500304
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500305 - tar &MIN_TAR_VERSION; or greater
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500306
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500307 - Python &MIN_PYTHON_VERSION; or greater.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500308
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500309 - gcc &MIN_GCC_VERSION; or greater.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500310
Andrew Geissler615f2f12022-07-15 14:00:58 -0500311 - GNU make &MIN_MAKE_VERSION; or greater
312
Andrew Geissler5199d832021-09-24 16:47:35 -0500313 If your build host does not meet any of these listed version
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500314 requirements, you can take steps to prepare the system so that you
315 can still use the Yocto Project. See the
Andrew Geissler615f2f12022-07-15 14:00:58 -0500316 ":ref:`ref-manual/system-requirements:required git, tar, python, make and gcc versions`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500317 section in the Yocto Project Reference Manual for information.
318
Andrew Geissler517393d2023-01-13 08:55:19 -0600319#. *Install Development Host Packages:* Required development host
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500320 packages vary depending on your build host and what you want to do
321 with the Yocto Project. Collectively, the number of required packages
322 is large if you want to be able to cover all cases.
323
324 For lists of required packages for all scenarios, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600325 ":ref:`ref-manual/system-requirements:required packages for the build host`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500326 section in the Yocto Project Reference Manual.
327
328Once you have completed the previous steps, you are ready to continue
329using a given development path on your native Linux machine. If you are
330going to use BitBake, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600331":ref:`dev-manual/start:cloning the \`\`poky\`\` repository`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500332section. If you are going
Andrew Geissler09209ee2020-12-13 08:44:15 -0600333to use the Extensible SDK, see the ":doc:`/sdk-manual/extensible`" Chapter in the Yocto
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500334Project Application Development and the Extensible Software Development
Andrew Geissler09209ee2020-12-13 08:44:15 -0600335Kit (eSDK) manual. If you want to work on the kernel, see the :doc:`/kernel-dev/index`. If you are going to use
336Toaster, see the ":doc:`/toaster-manual/setup-and-use`"
Patrick Williams705982a2024-01-12 09:51:57 -0600337section in the Toaster User Manual. If you are a VSCode user, you can configure
338the `Yocto Project BitBake
339<https://marketplace.visualstudio.com/items?itemName=yocto-project.yocto-bitbake>`__
340extension accordingly.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500341
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500342Setting Up to Use CROss PlatformS (CROPS)
343-----------------------------------------
344
345With `CROPS <https://github.com/crops/poky-container>`__, which
346leverages `Docker Containers <https://www.docker.com/>`__, you can
347create a Yocto Project development environment that is operating system
348agnostic. You can set up a container in which you can develop using the
349Yocto Project on a Windows, Mac, or Linux machine.
350
351Follow these general steps to prepare a Windows, Mac, or Linux machine
352as your Yocto Project build host:
353
Andrew Geissler517393d2023-01-13 08:55:19 -0600354#. *Determine What Your Build Host Needs:*
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500355 `Docker <https://www.docker.com/what-docker>`__ is a software
356 container platform that you need to install on the build host.
357 Depending on your build host, you might have to install different
358 software to support Docker containers. Go to the Docker installation
359 page and read about the platform requirements in "`Supported
Andrew Geisslerc3d88e42020-10-02 09:45:00 -0500360 Platforms <https://docs.docker.com/engine/install/#supported-platforms>`__"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500361 your build host needs to run containers.
362
Andrew Geissler517393d2023-01-13 08:55:19 -0600363#. *Choose What To Install:* Depending on whether or not your build host
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500364 meets system requirements, you need to install "Docker CE Stable" or
365 the "Docker Toolbox". Most situations call for Docker CE. However, if
366 you have a build host that does not meet requirements (e.g.
367 Pre-Windows 10 or Windows 10 "Home" version), you must install Docker
368 Toolbox instead.
369
Andrew Geissler517393d2023-01-13 08:55:19 -0600370#. *Go to the Install Site for Your Platform:* Click the link for the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500371 Docker edition associated with your build host's native software. For
372 example, if your build host is running Microsoft Windows Version 10
373 and you want the Docker CE Stable edition, click that link under
374 "Supported Platforms".
375
Andrew Geissler517393d2023-01-13 08:55:19 -0600376#. *Install the Software:* Once you have understood all the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500377 pre-requisites, you can download and install the appropriate
378 software. Follow the instructions for your specific machine and the
379 type of the software you need to install:
380
Andrew Geisslerc926e172021-05-07 16:11:35 -0500381 - Install `Docker Desktop on
Andrew Geisslerc3d88e42020-10-02 09:45:00 -0500382 Windows <https://docs.docker.com/docker-for-windows/install/#install-docker-desktop-on-windows>`__
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500383 for Windows build hosts that meet requirements.
384
Andrew Geisslerc926e172021-05-07 16:11:35 -0500385 - Install `Docker Desktop on
Andrew Geisslerc3d88e42020-10-02 09:45:00 -0500386 MacOs <https://docs.docker.com/docker-for-mac/install/#install-and-run-docker-desktop-on-mac>`__
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500387 for Mac build hosts that meet requirements.
388
Andrew Geisslerc926e172021-05-07 16:11:35 -0500389 - Install `Docker Engine on
390 CentOS <https://docs.docker.com/engine/install/centos/>`__
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500391 for Linux build hosts running the CentOS distribution.
392
Andrew Geisslerc926e172021-05-07 16:11:35 -0500393 - Install `Docker Engine on
394 Debian <https://docs.docker.com/engine/install/debian/>`__
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500395 for Linux build hosts running the Debian distribution.
396
Andrew Geisslerc926e172021-05-07 16:11:35 -0500397 - Install `Docker Engine for
398 Fedora <https://docs.docker.com/engine/install/fedora/>`__
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500399 for Linux build hosts running the Fedora distribution.
400
Andrew Geisslerc926e172021-05-07 16:11:35 -0500401 - Install `Docker Engine for
402 Ubuntu <https://docs.docker.com/engine/install/ubuntu/>`__
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500403 for Linux build hosts running the Ubuntu distribution.
404
Andrew Geissler517393d2023-01-13 08:55:19 -0600405#. *Optionally Orient Yourself With Docker:* If you are unfamiliar with
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500406 Docker and the container concept, you can learn more here -
407 https://docs.docker.com/get-started/.
408
Andrew Geissler517393d2023-01-13 08:55:19 -0600409#. *Launch Docker or Docker Toolbox:* You should be able to launch
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500410 Docker or the Docker Toolbox and have a terminal shell on your
411 development host.
412
Andrew Geissler517393d2023-01-13 08:55:19 -0600413#. *Set Up the Containers to Use the Yocto Project:* Go to
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500414 https://github.com/crops/docker-win-mac-docs/wiki and follow
415 the directions for your particular build host (i.e. Linux, Mac, or
416 Windows).
417
418 Once you complete the setup instructions for your machine, you have
419 the Poky, Extensible SDK, and Toaster containers available. You can
420 click those links from the page and learn more about using each of
421 those containers.
422
423Once you have a container set up, everything is in place to develop just
424as if you were running on a native Linux machine. If you are going to
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500425use the Poky container, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600426":ref:`dev-manual/start:cloning the \`\`poky\`\` repository`"
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500427section. If you are going to use the Extensible SDK container, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600428":doc:`/sdk-manual/extensible`" Chapter in the Yocto
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500429Project Application Development and the Extensible Software Development
430Kit (eSDK) manual. If you are going to use the Toaster container, see
Andrew Geissler09209ee2020-12-13 08:44:15 -0600431the ":doc:`/toaster-manual/setup-and-use`"
Patrick Williams705982a2024-01-12 09:51:57 -0600432section in the Toaster User Manual. If you are a VSCode user, you can configure
433the `Yocto Project BitBake
434<https://marketplace.visualstudio.com/items?itemName=yocto-project.yocto-bitbake>`__
435extension accordingly.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500436
Patrick Williams2390b1b2022-11-03 13:47:49 -0500437Setting Up to Use Windows Subsystem For Linux (WSL 2)
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500438-----------------------------------------------------
439
Patrick Williams2390b1b2022-11-03 13:47:49 -0500440With `Windows Subsystem for Linux (WSL 2)
441<https://learn.microsoft.com/en-us/windows/wsl/>`__,
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500442you can create a Yocto Project development environment that allows you
443to build on Windows. You can set up a Linux distribution inside Windows
444in which you can develop using the Yocto Project.
445
Patrick Williams2390b1b2022-11-03 13:47:49 -0500446Follow these general steps to prepare a Windows machine using WSL 2 as
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500447your Yocto Project build host:
448
Andrew Geissler517393d2023-01-13 08:55:19 -0600449#. *Make sure your Windows machine is capable of running WSL 2:*
Patrick Williams2390b1b2022-11-03 13:47:49 -0500450
451 While all Windows 11 and Windows Server 2022 builds support WSL 2,
452 the first versions of Windows 10 and Windows Server 2019 didn't.
453 Check the minimum build numbers for `Windows 10
454 <https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-2---check-requirements-for-running-wsl-2>`__
455 and for `Windows Server 2019
456 <https://learn.microsoft.com/en-us/windows/wsl/install-on-server>`__.
457
458 To check which build version you are running, you may open a command
459 prompt on Windows and execute the command "ver"::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500460
461 C:\Users\myuser> ver
462
463 Microsoft Windows [Version 10.0.19041.153]
464
Andrew Geissler517393d2023-01-13 08:55:19 -0600465#. *Install the Linux distribution of your choice inside WSL 2:*
Patrick Williams2390b1b2022-11-03 13:47:49 -0500466 Once you know your version of Windows supports WSL 2, you can
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500467 install the distribution of your choice from the Microsoft Store.
468 Open the Microsoft Store and search for Linux. While there are
469 several Linux distributions available, the assumption is that your
470 pick will be one of the distributions supported by the Yocto Project
471 as stated on the instructions for using a native Linux host. After
472 making your selection, simply click "Get" to download and install the
473 distribution.
474
Andrew Geissler517393d2023-01-13 08:55:19 -0600475#. *Check which Linux distribution WSL 2 is using:* Open a Windows
Andrew Geisslerc926e172021-05-07 16:11:35 -0500476 PowerShell and run::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500477
478 C:\WINDOWS\system32> wsl -l -v
479 NAME STATE VERSION
480 *Ubuntu Running 2
481
Patrick Williams2390b1b2022-11-03 13:47:49 -0500482 Note that WSL 2 supports running as many different Linux distributions
483 as you want to install.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500484
Andrew Geissler517393d2023-01-13 08:55:19 -0600485#. *Optionally Get Familiar with WSL:* You can learn more on
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500486 https://docs.microsoft.com/en-us/windows/wsl/wsl2-about.
487
Andrew Geissler517393d2023-01-13 08:55:19 -0600488#. *Launch your WSL Distibution:* From the Windows start menu simply
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500489 launch your WSL distribution just like any other application.
490
Andrew Geissler517393d2023-01-13 08:55:19 -0600491#. *Optimize your WSL 2 storage often:* Due to the way storage is
Patrick Williams2390b1b2022-11-03 13:47:49 -0500492 handled on WSL 2, the storage space used by the underlying Linux
Patrick Williams975a06f2022-10-21 14:42:47 -0500493 distribution is not reflected immediately, and since BitBake heavily
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500494 uses storage, after several builds, you may be unaware you are
Patrick Williams2390b1b2022-11-03 13:47:49 -0500495 running out of space. As WSL 2 uses a VHDX file for storage, this issue
496 can be easily avoided by regularly optimizing this file in a manual way:
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500497
Andrew Geissler9aee5002022-03-30 16:27:02 +0000498 1. *Find the location of your VHDX file:*
499
500 First you need to find the distro app package directory, to achieve this
501 open a Windows Powershell as Administrator and run::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500502
503 C:\WINDOWS\system32> Get-AppxPackage -Name "*Ubuntu*" | Select PackageFamilyName
504 PackageFamilyName
505 -----------------
506 CanonicalGroupLimited.UbuntuonWindows_79abcdefgh
507
508
509 You should now
510 replace the PackageFamilyName and your user on the following path
Andrew Geisslerc926e172021-05-07 16:11:35 -0500511 to find your VHDX file::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500512
Andrew Geissler9aee5002022-03-30 16:27:02 +0000513 ls C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\
514 Mode LastWriteTime Length Name
515 -a---- 3/14/2020 9:52 PM 57418973184 ext4.vhdx
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500516
517 Your VHDX file path is:
518 ``C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx``
519
Andrew Geissler9aee5002022-03-30 16:27:02 +0000520 2a. *Optimize your VHDX file using Windows Powershell:*
521
522 To use the ``optimize-vhd`` cmdlet below, first install the Hyper-V
523 option on Windows. Then, open a Windows Powershell as Administrator to
524 optimize your VHDX file, shutting down WSL first::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500525
526 C:\WINDOWS\system32> wsl --shutdown
527 C:\WINDOWS\system32> optimize-vhd -Path C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx -Mode full
528
Andrew Geissler9aee5002022-03-30 16:27:02 +0000529 A progress bar should be shown while optimizing the
530 VHDX file, and storage should now be reflected correctly on the
531 Windows Explorer.
532
533 2b. *Optimize your VHDX file using DiskPart:*
534
535 The ``optimize-vhd`` cmdlet noted in step 2a above is provided by
536 Hyper-V. Not all SKUs of Windows can install Hyper-V. As an alternative,
537 use the DiskPart tool. To start, open a Windows command prompt as
538 Administrator to optimize your VHDX file, shutting down WSL first::
539
540 C:\WINDOWS\system32> wsl --shutdown
541 C:\WINDOWS\system32> diskpart
542
543 DISKPART> select vdisk file="<path_to_VHDX_file>"
544 DISKPART> attach vdisk readonly
545 DISKPART> compact vdisk
546 DISKPART> exit
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500547
548.. note::
549
Patrick Williams2390b1b2022-11-03 13:47:49 -0500550 The current implementation of WSL 2 does not have out-of-the-box
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500551 access to external devices such as those connected through a USB
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500552 port, but it automatically mounts your ``C:`` drive on ``/mnt/c/``
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500553 (and others), which you can use to share deploy artifacts to be later
Patrick Williams2390b1b2022-11-03 13:47:49 -0500554 flashed on hardware through Windows, but your :term:`Build Directory`
555 should not reside inside this mountpoint.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500556
Patrick Williams2390b1b2022-11-03 13:47:49 -0500557Once you have WSL 2 set up, everything is in place to develop just as if
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500558you were running on a native Linux machine. If you are going to use the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600559Extensible SDK container, see the ":doc:`/sdk-manual/extensible`" Chapter in the Yocto
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500560Project Application Development and the Extensible Software Development
561Kit (eSDK) manual. If you are going to use the Toaster container, see
Andrew Geissler09209ee2020-12-13 08:44:15 -0600562the ":doc:`/toaster-manual/setup-and-use`"
Patrick Williams705982a2024-01-12 09:51:57 -0600563section in the Toaster User Manual. If you are a VSCode user, you can configure
564the `Yocto Project BitBake
565<https://marketplace.visualstudio.com/items?itemName=yocto-project.yocto-bitbake>`__
566extension accordingly.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500567
568Locating Yocto Project Source Files
569===================================
570
571This section shows you how to locate, fetch and configure the source
572files you'll need to work with the Yocto Project.
573
574.. note::
575
576 - For concepts and introductory information about Git as it is used
Andrew Geissler09209ee2020-12-13 08:44:15 -0600577 in the Yocto Project, see the ":ref:`overview-manual/development-environment:git`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500578 section in the Yocto Project Overview and Concepts Manual.
579
580 - For concepts on Yocto Project source repositories, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600581 ":ref:`overview-manual/development-environment:yocto project source repositories`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500582 section in the Yocto Project Overview and Concepts Manual."
583
584Accessing Source Repositories
585-----------------------------
586
Andrew Geissler09209ee2020-12-13 08:44:15 -0600587Working from a copy of the upstream :ref:`dev-manual/start:accessing source repositories` is the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500588preferred method for obtaining and using a Yocto Project release. You
589can view the Yocto Project Source Repositories at
590:yocto_git:`/`. In particular, you can find the ``poky``
Andrew Geissler09209ee2020-12-13 08:44:15 -0600591repository at :yocto_git:`/poky`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500592
593Use the following procedure to locate the latest upstream copy of the
594``poky`` Git repository:
595
Andrew Geissler517393d2023-01-13 08:55:19 -0600596#. *Access Repositories:* Open a browser and go to
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500597 :yocto_git:`/` to access the GUI-based interface into the
598 Yocto Project source repositories.
599
Andrew Geissler517393d2023-01-13 08:55:19 -0600600#. *Select the Repository:* Click on the repository in which you are
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500601 interested (e.g. ``poky``).
602
Andrew Geissler517393d2023-01-13 08:55:19 -0600603#. *Find the URL Used to Clone the Repository:* At the bottom of the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500604 page, note the URL used to clone that repository
Andrew Geissler09209ee2020-12-13 08:44:15 -0600605 (e.g. :yocto_git:`/poky`).
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500606
607 .. note::
608
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500609 For information on cloning a repository, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600610 ":ref:`dev-manual/start:cloning the \`\`poky\`\` repository`" section.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500611
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500612Accessing Source Archives
613-------------------------
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500614
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500615The Yocto Project also provides source archives of its releases, which
616are available on :yocto_dl:`/releases/yocto/`. Then, choose the subdirectory
617containing the release you wish to use, for example
618:yocto_dl:`yocto-&DISTRO; </releases/yocto/yocto-&DISTRO;/>`.
619
620You will find there source archives of individual components (if you wish
621to use them individually), and of the corresponding Poky release bundling
622a selection of these components.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500623
624.. note::
625
626 The recommended method for accessing Yocto Project components is to
627 use Git to clone the upstream repository and work from within that
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500628 locally cloned repository.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500629
630Using the Downloads Page
631------------------------
632
Patrick Williams705982a2024-01-12 09:51:57 -0600633The :yocto_home:`Yocto Project Website <>` uses a "RELEASES" page
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500634from which you can locate and download tarballs of any Yocto Project
635release. Rather than Git repositories, these files represent snapshot
636tarballs similar to the tarballs located in the Index of Releases
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500637described in the ":ref:`dev-manual/start:accessing source archives`" section.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500638
Andrew Geissler517393d2023-01-13 08:55:19 -0600639#. *Go to the Yocto Project Website:* Open The
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500640 :yocto_home:`Yocto Project Website <>` in your browser.
641
Patrick Williams705982a2024-01-12 09:51:57 -0600642#. *Get to the Downloads Area:* Select the "RELEASES" item from the
643 pull-down "DEVELOPMENT" tab menu near the top of the page.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500644
Patrick Williams705982a2024-01-12 09:51:57 -0600645#. *Select a Yocto Project Release:* On the top of the "RELEASE" page currently
646 supported releases are displayed, further down past supported Yocto Project
647 releases are visible. The "Download" links in the rows of the table there
648 will lead to the download tarballs for the release.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500649 (e.g. &DISTRO_NAME_NO_CAP;, &DISTRO_NAME_NO_CAP_MINUS_ONE;, and so forth).
650
651 .. note::
652
653 For a "map" of Yocto Project releases to version numbers, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600654 :yocto_wiki:`Releases </Releases>` wiki page.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500655
656 You can use the "RELEASE ARCHIVE" link to reveal a menu of all Yocto
657 Project releases.
658
Patrick Williams705982a2024-01-12 09:51:57 -0600659#. *Download Tools or Board Support Packages (BSPs):* Next to the tarballs you
660 will find download tools or BSPs as well. Just select a Yocto Project
661 release and look for what you need.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500662
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500663Cloning and Checking Out Branches
664=================================
665
666To use the Yocto Project for development, you need a release locally
667installed on your development system. This locally installed set of
668files is referred to as the :term:`Source Directory`
669in the Yocto Project documentation.
670
671The preferred method of creating your Source Directory is by using
Andrew Geissler09209ee2020-12-13 08:44:15 -0600672:ref:`overview-manual/development-environment:git` to clone a local copy of the upstream
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500673``poky`` repository. Working from a cloned copy of the upstream
674repository allows you to contribute back into the Yocto Project or to
675simply work with the latest software on a development branch. Because
676Git maintains and creates an upstream repository with a complete history
677of changes and you are working with a local clone of that repository,
678you have access to all the Yocto Project development branches and tag
679names used in the upstream repository.
680
681Cloning the ``poky`` Repository
682-------------------------------
683
684Follow these steps to create a local version of the upstream
685:term:`Poky` Git repository.
686
Andrew Geissler517393d2023-01-13 08:55:19 -0600687#. *Set Your Directory:* Change your working directory to where you want
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500688 to create your local copy of ``poky``.
689
Andrew Geissler517393d2023-01-13 08:55:19 -0600690#. *Clone the Repository:* The following example command clones the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500691 ``poky`` repository and uses the default name "poky" for your local
Andrew Geisslerc926e172021-05-07 16:11:35 -0500692 repository::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500693
694 $ git clone git://git.yoctoproject.org/poky
695 Cloning into 'poky'...
696 remote: Counting objects: 432160, done.
697 remote: Compressing objects: 100% (102056/102056), done.
698 remote: Total 432160 (delta 323116), reused 432037 (delta 323000)
699 Receiving objects: 100% (432160/432160), 153.81 MiB | 8.54 MiB/s, done.
700 Resolving deltas: 100% (323116/323116), done.
701 Checking connectivity... done.
702
703 Unless you
704 specify a specific development branch or tag name, Git clones the
705 "master" branch, which results in a snapshot of the latest
706 development changes for "master". For information on how to check out
707 a specific development branch or on how to check out a local branch
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500708 based on a tag name, see the
709 ":ref:`dev-manual/start:checking out by branch in poky`" and
710 ":ref:`dev-manual/start:checking out by tag in poky`" sections, respectively.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500711
712 Once the local repository is created, you can change to that
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700713 directory and check its status. The ``master`` branch is checked out
714 by default::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500715
Andrew Geissler95ac1b82021-03-31 14:34:31 -0500716 $ cd poky
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500717 $ git status
718 On branch master
719 Your branch is up-to-date with 'origin/master'.
720 nothing to commit, working directory clean
721 $ git branch
722 * master
723
724 Your local repository of poky is identical to the
725 upstream poky repository at the time from which it was cloned. As you
726 work with the local branch, you can periodically use the
727 ``git pull --rebase`` command to be sure you are up-to-date
728 with the upstream branch.
729
730Checking Out by Branch in Poky
731------------------------------
732
733When you clone the upstream poky repository, you have access to all its
734development branches. Each development branch in a repository is unique
735as it forks off the "master" branch. To see and use the files of a
736particular development branch locally, you need to know the branch name
737and then specifically check out that development branch.
738
739.. note::
740
741 Checking out an active development branch by branch name gives you a
742 snapshot of that particular branch at the time you check it out.
743 Further development on top of the branch that occurs after check it
744 out can occur.
745
Andrew Geissler517393d2023-01-13 08:55:19 -0600746#. *Switch to the Poky Directory:* If you have a local poky Git
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500747 repository, switch to that directory. If you do not have the local
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500748 copy of poky, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600749 ":ref:`dev-manual/start:cloning the \`\`poky\`\` repository`"
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500750 section.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500751
Andrew Geissler517393d2023-01-13 08:55:19 -0600752#. *Determine Existing Branch Names:*
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500753 ::
754
755 $ git branch -a
756 * master
757 remotes/origin/1.1_M1
758 remotes/origin/1.1_M2
759 remotes/origin/1.1_M3
760 remotes/origin/1.1_M4
761 remotes/origin/1.2_M1
762 remotes/origin/1.2_M2
763 remotes/origin/1.2_M3
764 . . .
765 remotes/origin/thud
766 remotes/origin/thud-next
767 remotes/origin/warrior
768 remotes/origin/warrior-next
769 remotes/origin/zeus
770 remotes/origin/zeus-next
771 ... and so on ...
772
Andrew Geissler517393d2023-01-13 08:55:19 -0600773#. *Check out the Branch:* Check out the development branch in which you
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500774 want to work. For example, to access the files for the Yocto Project
Andrew Geisslerc926e172021-05-07 16:11:35 -0500775 &DISTRO; Release (&DISTRO_NAME;), use the following command::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500776
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500777 $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
778 Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
779 Switched to a new branch '&DISTRO_NAME_NO_CAP;'
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500780
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500781 The previous command checks out the "&DISTRO_NAME_NO_CAP;" development
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500782 branch and reports that the branch is tracking the upstream
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500783 "origin/&DISTRO_NAME_NO_CAP;" branch.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500784
785 The following command displays the branches that are now part of your
786 local poky repository. The asterisk character indicates the branch
Andrew Geisslerc926e172021-05-07 16:11:35 -0500787 that is currently checked out for work::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500788
789 $ git branch
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500790 master
791 * &DISTRO_NAME_NO_CAP;
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500792
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500793Checking Out by Tag in Poky
794---------------------------
795
796Similar to branches, the upstream repository uses tags to mark specific
797commits associated with significant points in a development branch (i.e.
798a release point or stage of a release). You might want to set up a local
799branch based on one of those points in the repository. The process is
800similar to checking out by branch name except you use tag names.
801
802.. note::
803
804 Checking out a branch based on a tag gives you a stable set of files
805 not affected by development on the branch above the tag.
806
Andrew Geissler517393d2023-01-13 08:55:19 -0600807#. *Switch to the Poky Directory:* If you have a local poky Git
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500808 repository, switch to that directory. If you do not have the local
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500809 copy of poky, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600810 ":ref:`dev-manual/start:cloning the \`\`poky\`\` repository`"
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500811 section.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500812
Andrew Geissler517393d2023-01-13 08:55:19 -0600813#. *Fetch the Tag Names:* To checkout the branch based on a tag name,
Andrew Geisslerc926e172021-05-07 16:11:35 -0500814 you need to fetch the upstream tags into your local repository::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500815
816 $ git fetch --tags
817 $
818
Andrew Geissler517393d2023-01-13 08:55:19 -0600819#. *List the Tag Names:* You can list the tag names now::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500820
821 $ git tag
822 1.1_M1.final
823 1.1_M1.rc1
824 1.1_M1.rc2
825 1.1_M2.final
826 1.1_M2.rc1
827 .
828 .
829 .
830 yocto-2.5
831 yocto-2.5.1
832 yocto-2.5.2
833 yocto-2.5.3
834 yocto-2.6
835 yocto-2.6.1
836 yocto-2.6.2
837 yocto-2.7
838 yocto_1.5_M5.rc8
839
840
Andrew Geissler517393d2023-01-13 08:55:19 -0600841#. *Check out the Branch:*
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500842 ::
843
844 $ git checkout tags/yocto-&DISTRO; -b my_yocto_&DISTRO;
845 Switched to a new branch 'my_yocto_&DISTRO;'
846 $ git branch
847 master
848 * my_yocto_&DISTRO;
849
850 The previous command creates and
851 checks out a local branch named "my_yocto_&DISTRO;", which is based on
852 the commit in the upstream poky repository that has the same tag. In
853 this example, the files you have available locally as a result of the
854 ``checkout`` command are a snapshot of the "&DISTRO_NAME_NO_CAP;"
855 development branch at the point where Yocto Project &DISTRO; was
856 released.