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