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; ] > |
| 4 | |
| 5 | <chapter id='dev-manual-start'> |
| 6 | |
| 7 | <title>Getting Started with the Yocto Project</title> |
| 8 | |
| 9 | <para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 10 | This chapter provides procedures related to getting set up to use the |
| 11 | Yocto Project. |
| 12 | For a more front-to-end process that takes you from minimally preparing |
| 13 | a build host through building an image, see the |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>. |
| 15 | </para> |
| 16 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 17 | <section id='setting-up-the-development-host-to-use-the-yocto-project'> |
| 18 | <title>Setting Up the Development Host to Use the Yocto Project</title> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | |
| 20 | <para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 21 | This section provides procedures to set up your development host to |
| 22 | use the Yocto Project. |
| 23 | You can use the Yocto Project on a native Linux development host or |
| 24 | you can use |
| 25 | <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>, |
| 26 | which leverages |
| 27 | <ulink url='https://www.docker.com/'>Docker Containers</ulink>, |
| 28 | to prepare any Linux, Mac, or Windows development host. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 29 | </para> |
| 30 | |
| 31 | <para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 32 | Once your development host is set up to use the Yocto Project, |
| 33 | further steps are necessary depending on what you want to |
| 34 | accomplish. |
| 35 | See the following references for information on how to prepare for |
| 36 | Board Support Package (BSP) development, kernel development, and |
| 37 | development using the <trademark class='trade'>Eclipse</trademark> IDE: |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 38 | <itemizedlist> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 39 | <listitem><para> |
| 40 | <emphasis>BSP Development:</emphasis> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 41 | See the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 42 | "<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] | 43 | section in the Yocto Project Board Support Package (BSP) |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 44 | Developer's Guide. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 45 | </para></listitem> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 46 | <listitem><para> |
| 47 | <emphasis>Kernel Development:</emphasis> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | See the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 49 | "<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>" |
| 50 | section in the Yocto Project Linux Kernel Development Manual. |
| 51 | </para></listitem> |
| 52 | <listitem><para> |
| 53 | <emphasis>Eclipse Development:</emphasis> |
| 54 | See the |
| 55 | "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-eclipse-project'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></ulink>" |
| 56 | Chapter in the Yocto Project Application Development and the |
| 57 | Extensible Software Development Kit (eSDK) manual. |
| 58 | </para></listitem> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 59 | </itemizedlist> |
| 60 | </para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 61 | |
| 62 | <section id='setting-up-a-native-linux-host'> |
| 63 | <title>Setting Up a Native Linux Host</title> |
| 64 | |
| 65 | <para> |
| 66 | Follow these steps to prepare a native Linux machine as your |
| 67 | Yocto Project development host: |
| 68 | <orderedlist> |
| 69 | <listitem><para> |
| 70 | <emphasis>Use a Supported Linux Distribution:</emphasis> |
| 71 | You should have a reasonably current Linux-based host |
| 72 | system. |
| 73 | You will have the best results with a recent release of |
| 74 | Fedora, openSUSE, Debian, Ubuntu, or CentOS as these |
| 75 | releases are frequently tested against the Yocto Project |
| 76 | and officially supported. |
| 77 | For a list of the distributions under validation and their |
| 78 | status, see the |
| 79 | "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section |
| 80 | in the Yocto Project Reference Manual and the wiki page at |
| 81 | <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>. |
| 82 | </para></listitem> |
| 83 | <listitem><para> |
| 84 | <emphasis>Have Enough Free Memory:</emphasis> |
| 85 | You should have at least 50 Gbytes of free disk space |
| 86 | for building images. |
| 87 | </para></listitem> |
| 88 | <listitem><para> |
| 89 | <emphasis>Meet Minimal Version Requirements:</emphasis> |
| 90 | The OpenEmbedded build system should be able to run on any |
| 91 | modern distribution that has the following versions for |
| 92 | Git, tar, and Python. |
| 93 | <itemizedlist> |
| 94 | <listitem><para> |
| 95 | Git 1.8.3.1 or greater |
| 96 | </para></listitem> |
| 97 | <listitem><para> |
| 98 | tar 1.27 or greater |
| 99 | </para></listitem> |
| 100 | <listitem><para> |
| 101 | Python 3.4.0 or greater. |
| 102 | </para></listitem> |
| 103 | </itemizedlist> |
| 104 | If your build host does not meet any of these three listed |
| 105 | version requirements, you can take steps to prepare the |
| 106 | system so that you can still use the Yocto Project. |
| 107 | See the |
| 108 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>" |
| 109 | section in the Yocto Project Reference Manual for |
| 110 | information. |
| 111 | </para></listitem> |
| 112 | <listitem><para> |
| 113 | <emphasis>Install Development Host Packages:</emphasis> |
| 114 | Required development host packages vary depending on your |
| 115 | build machine and what you want to do with the Yocto |
| 116 | Project. |
| 117 | Collectively, the number of required packages is large |
| 118 | if you want to be able to cover all cases.</para> |
| 119 | |
| 120 | <para>For lists of required packages for all scenarios, |
| 121 | see the |
| 122 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>" |
| 123 | section in the Yocto Project Reference Manual. |
| 124 | </para></listitem> |
| 125 | </orderedlist> |
| 126 | Once you have completed the previous steps, you are ready to |
| 127 | continue using a given development path on your native Linux |
| 128 | machine. |
| 129 | If you are going to use BitBake, see the |
| 130 | "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>" |
| 131 | section. |
| 132 | If you are going to use the Extensible SDK, see the |
| 133 | "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>" |
| 134 | Chapter in the Yocto Project Application Development and the |
| 135 | Extensible Software Development Kit (eSDK) manual. |
| 136 | If you want to work on the kernel, see the |
| 137 | <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>. |
| 138 | If you are going to use Toaster, see the |
| 139 | "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>" |
| 140 | section in the Toaster User Manual. |
| 141 | </para> |
| 142 | </section> |
| 143 | |
| 144 | <section id='setting-up-to-use-crops'> |
| 145 | <title>Setting Up to Use CROss PlatformS (CROPS)</title> |
| 146 | |
| 147 | <para> |
| 148 | With |
| 149 | <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>, |
| 150 | which leverages |
| 151 | <ulink url='https://www.docker.com/'>Docker Containers</ulink>, |
| 152 | you can create a Yocto Project development environment that |
| 153 | is operating system agnostic. |
| 154 | You can set up a container in which you can develop using the |
| 155 | Yocto Project on a Windows, Mac, or Linux machine. |
| 156 | </para> |
| 157 | |
| 158 | <para> |
| 159 | Follow these general steps to prepare a Windows, Mac, or Linux |
| 160 | machine as your Yocto Project development host: |
| 161 | <orderedlist> |
| 162 | <listitem><para> |
| 163 | <emphasis>Go to the Docker Installation Site:</emphasis> |
| 164 | <ulink url='https://www.docker.com/what-docker'>Docker</ulink> |
| 165 | is a software container platform that you need to install |
| 166 | on the host development machine. |
| 167 | To start the installation process, see the |
| 168 | <ulink url='https://docs.docker.com/engine/installation/'>Docker Installation</ulink> |
| 169 | site. |
| 170 | </para></listitem> |
| 171 | <listitem><para> |
| 172 | <emphasis>Choose Your Docker Edition:</emphasis> |
| 173 | Docker comes in several editions. |
| 174 | For the Yocto Project, the stable community edition |
| 175 | (i.e. "Docker CE Stable") is adequate. |
| 176 | You can learn more about the Docker editions from the |
| 177 | site. |
| 178 | </para></listitem> |
| 179 | <listitem><para> |
| 180 | <emphasis>Go the Install Site for Your Platform:</emphasis> |
| 181 | Click the link for the Docker edition associated with |
| 182 | your development host machine's native software. |
| 183 | For example, if your machine is running Microsoft |
| 184 | Windows Version 10 and you want the Docker CE Stable |
| 185 | edition, click that link under "Supported Platforms". |
| 186 | </para></listitem> |
| 187 | <listitem><para> |
| 188 | <emphasis>Understand What You Need:</emphasis> |
| 189 | The install page has pre-requisites your machine must |
| 190 | meet. |
| 191 | Be sure you read through this page and make sure your |
| 192 | machine meets the requirements to run Docker. |
| 193 | If your machine does not meet the requirements, the page |
| 194 | has instructions to handle exceptions. |
| 195 | For example, to run Docker on Windows 10, you must have |
| 196 | the pro version of the operating system. |
| 197 | If you have the home version, you need to install the |
| 198 | <ulink url='https://docs.docker.com/toolbox/overview/#ready-to-get-started'>Docker Toolbox</ulink>. |
| 199 | </para> |
| 200 | |
| 201 | <para>Another example is that a Windows machine needs to |
| 202 | have Microsoft Hyper-V. |
| 203 | If you have a legacy version of the the Microsoft |
| 204 | operating system or for any other reason you do not have |
| 205 | Microsoft Hyper-V, you would have to enter the BIOS and |
| 206 | enable virtualization. |
| 207 | </para></listitem> |
| 208 | <listitem><para> |
| 209 | <emphasis>Install the Software:</emphasis> |
| 210 | Once you have understood all the pre-requisites, you can |
| 211 | download and install the appropriate software. |
| 212 | Follow the instructions for your specific machine and |
| 213 | the type of the software you need to install. |
| 214 | </para></listitem> |
| 215 | <listitem><para> |
| 216 | <emphasis>Optionally Orient Yourself With Dockers:</emphasis> |
| 217 | If you are unfamiliar with Dockers and the container |
| 218 | concept, you can learn more here - |
| 219 | <ulink url='https://docs.docker.com/get-started/'></ulink>. |
| 220 | You should be able to launch Docker or the Docker Toolbox |
| 221 | and have a terminal shell on your development host. |
| 222 | </para></listitem> |
| 223 | <listitem><para> |
| 224 | <emphasis>Set Up the Containers to Use the Yocto Project:</emphasis> |
| 225 | Go to |
| 226 | <ulink url='https://github.com/crops/docker-win-mac-docs/wiki'></ulink> |
| 227 | and follow the directions for your particular |
| 228 | development host (i.e. Linux, Mac, or Windows).</para> |
| 229 | |
| 230 | <para>Once you complete the setup instructions for your |
| 231 | machine, you have the Poky, Extensible SDK, and Toaster |
| 232 | containers available. |
| 233 | You can click those links from the page and learn more |
| 234 | about using each of those containers. |
| 235 | </para></listitem> |
| 236 | </orderedlist> |
| 237 | Once you have a container set up, everything is in place to |
| 238 | develop just as if you were running on a native Linux machine. |
| 239 | If you are going to use the Poky container, see the |
| 240 | "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>" |
| 241 | section. |
| 242 | If you are going to use the Extensible SDK container, see the |
| 243 | "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>" |
| 244 | Chapter in the Yocto Project Application Development and the |
| 245 | Extensible Software Development Kit (eSDK) manual. |
| 246 | If you are going to use the Toaster container, see the |
| 247 | "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>" |
| 248 | section in the Toaster User Manual. |
| 249 | </para> |
| 250 | </section> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 251 | </section> |
| 252 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 253 | <section id='working-with-yocto-project-source-files'> |
| 254 | <title>Working With Yocto Project Source Files</title> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 255 | |
| 256 | <para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 257 | This section contains procedures related to locating and securing |
| 258 | Yocto Project files. |
| 259 | You establish and use these local files to work on projects. |
| 260 | <note><title>Notes</title> |
| 261 | <itemizedlist> |
| 262 | <listitem><para> |
| 263 | For concepts and introductory information about Git as it |
| 264 | is used in the Yocto Project, see the |
| 265 | "<ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink>" |
| 266 | section in the Yocto Project Reference Manual. |
| 267 | </para></listitem> |
| 268 | <listitem><para> |
| 269 | For concepts on Yocto Project source repositories, see the |
| 270 | "<ulink url='&YOCTO_DOCS_REF_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>" |
| 271 | section in the Yocto Project Reference Manual." |
| 272 | </para></listitem> |
| 273 | </itemizedlist> |
| 274 | </note> |
| 275 | </para> |
| 276 | |
| 277 | <section id='accessing-source-repositories'> |
| 278 | <title>Accessing Source Repositories</title> |
| 279 | |
| 280 | <para> |
| 281 | Yocto Project maintains upstream Git |
| 282 | <ulink url='&YOCTO_DOCS_REF_URL;#source-repositories'>Source Repositories</ulink> |
| 283 | that you can examine and access using a browser-based UI: |
| 284 | <orderedlist> |
| 285 | <listitem><para> |
| 286 | <emphasis>Access Repositories:</emphasis> |
| 287 | Open a browser and go to |
| 288 | <ulink url='&YOCTO_GIT_URL;'></ulink> to access the |
| 289 | GUI-based interface into the Yocto Project source |
| 290 | repositories. |
| 291 | </para></listitem> |
| 292 | <listitem><para> |
| 293 | <emphasis>Select a Repository:</emphasis> |
| 294 | Click on any repository in which you are interested (e.g. |
| 295 | <filename>poky</filename>). |
| 296 | </para></listitem> |
| 297 | <listitem><para> |
| 298 | <emphasis>Find the URL Used to Clone the Repository:</emphasis> |
| 299 | At the bottom of the page, note the URL used to |
| 300 | <ulink url='&YOCTO_DOCS_REF_URL;#git-commands-clone'>clone</ulink> |
| 301 | that repository (e.g. |
| 302 | <filename>&YOCTO_GIT_URL;/poky</filename>). |
| 303 | </para></listitem> |
| 304 | <listitem><para> |
| 305 | <emphasis>Examine Change History of the Repository:</emphasis> |
| 306 | At the top of the page, click on any branch in which you |
| 307 | might be interested (e.g. |
| 308 | <filename>&DISTRO_NAME_NO_CAP;</filename>). |
| 309 | You can then view the commit log or tree view for that |
| 310 | development branch. |
| 311 | </para></listitem> |
| 312 | </orderedlist> |
| 313 | </para> |
| 314 | </section> |
| 315 | |
| 316 | <section id='accessing-index-of-releases'> |
| 317 | <title>Accessing Index of Releases</title> |
| 318 | |
| 319 | <para> |
| 320 | Yocto Project maintains an Index of Releases area that contains |
| 321 | related files that contribute to the Yocto Project. |
| 322 | Rather than Git repositories, these files represent snapshot |
| 323 | tarballs. |
| 324 | <note><title>Tip</title> |
| 325 | The recommended method for accessing Yocto Project |
| 326 | components is to use Git to clone a repository and work from |
| 327 | within that local repository. |
| 328 | The procedure in this section exists should you desire a |
| 329 | tarball snapshot of any given component. |
| 330 | </note> |
| 331 | <orderedlist> |
| 332 | <listitem><para> |
| 333 | <emphasis>Access the Index of Releases:</emphasis> |
| 334 | Open a browser and go to |
| 335 | <ulink url='&YOCTO_DL_URL;/releases'></ulink> to access the |
| 336 | Index of Releases. |
| 337 | The list represents released components (e.g. |
| 338 | <filename>eclipse-plugin</filename>, |
| 339 | <filename>sato</filename>, and so on). |
| 340 | <note> |
| 341 | The <filename>yocto</filename> directory contains the |
| 342 | full array of released Poky tarballs. |
| 343 | The <filename>poky</filename> directory in the |
| 344 | Index of Releases was historically used for very |
| 345 | early releases and exists for retroactive |
| 346 | completeness only. |
| 347 | </note> |
| 348 | </para></listitem> |
| 349 | <listitem><para> |
| 350 | <emphasis>Select a Component:</emphasis> |
| 351 | Click on any released component in which you are interested |
| 352 | (e.g. <filename>yocto</filename>). |
| 353 | </para></listitem> |
| 354 | <listitem><para> |
| 355 | <emphasis>Find the Tarball:</emphasis> |
| 356 | Drill down to find the associated tarball. |
| 357 | For example, click on <filename>yocto-&DISTRO;</filename> to |
| 358 | view files associated with the Yocto Project &DISTRO; |
| 359 | release (e.g. <filename>poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;.tar.bz2</filename>, |
| 360 | which is the released Poky tarball). |
| 361 | </para></listitem> |
| 362 | <listitem><para> |
| 363 | <emphasis>Download the Tarball:</emphasis> |
| 364 | Click a tarball to download and save a snapshot of a |
| 365 | given component. |
| 366 | </para></listitem> |
| 367 | </orderedlist> |
| 368 | </para> |
| 369 | </section> |
| 370 | |
| 371 | <section id='using-the-downloads-page'> |
| 372 | <title>Using the Downloads Page</title> |
| 373 | |
| 374 | <para> |
| 375 | The |
| 376 | <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> |
| 377 | uses a "Downloads" area from which you can locate and download |
| 378 | tarballs of any Yocto Project release. |
| 379 | Rather than Git repositories, these files represent snapshot |
| 380 | tarballs. |
| 381 | <note><title>Tip</title> |
| 382 | The recommended method for accessing Yocto Project |
| 383 | components is to use Git to clone a repository and work from |
| 384 | within that local repository. |
| 385 | The procedure in this section exists should you desire a |
| 386 | tarball snapshot of any given component. |
| 387 | </note> |
| 388 | <orderedlist> |
| 389 | <listitem><para> |
| 390 | <emphasis>Go to the Yocto Project Website:</emphasis> |
| 391 | Open The |
| 392 | <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> |
| 393 | in your browser. |
| 394 | </para></listitem> |
| 395 | <listitem><para> |
| 396 | <emphasis>Get to the Downloads Area:</emphasis> |
| 397 | Click the "Downloads" tab. |
| 398 | </para></listitem> |
| 399 | <listitem><para> |
| 400 | <emphasis>Select the Type of Files:</emphasis> |
| 401 | Click the type of files you want (i.e "Build System", |
| 402 | "Tools", or "Board Support Packages (BSPs)". |
| 403 | </para></listitem> |
| 404 | <listitem><para> |
| 405 | <emphasis>Locate and Download the Tarball:</emphasis> |
| 406 | From the list of releases, locate the appropriate |
| 407 | download link and download the files. |
| 408 | </para></listitem> |
| 409 | </orderedlist> |
| 410 | </para> |
| 411 | </section> |
| 412 | |
| 413 | <section id='cloning-the-poky-repository'> |
| 414 | <title>Cloning the <filename>poky</filename> Repository</title> |
| 415 | |
| 416 | <para> |
| 417 | To use the Yocto Project, you need a release of the Yocto Project |
| 418 | locally installed on your development system. |
| 419 | The locally installed set of files is referred to as the |
| 420 | <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink> |
| 421 | in the Yocto Project documentation. |
| 422 | </para> |
| 423 | |
| 424 | <para> |
| 425 | You create your Source Directory by using |
| 426 | <ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink> to clone a local |
| 427 | copy of the upstream <filename>poky</filename> repository. |
| 428 | <note><title>Tip</title> |
| 429 | The preferred method of getting the Yocto Project Source |
| 430 | Directory set up is to clone the repository. |
| 431 | </note> |
| 432 | Working from a copy of the upstream repository allows you |
| 433 | to contribute back into the Yocto Project or simply work with |
| 434 | the latest software on a development branch. |
| 435 | Because Git maintains and creates an upstream repository with |
| 436 | a complete history of changes and you are working with a local |
| 437 | clone of that repository, you have access to all the Yocto |
| 438 | Project development branches and tag names used in the upstream |
| 439 | repository. |
| 440 | </para> |
| 441 | |
| 442 | <para> |
| 443 | Follow these steps to create a local version of the |
| 444 | upstream |
| 445 | <ulink url='&YOCTO_DOCS_REF_URL;#poky'><filename>poky</filename></ulink> |
| 446 | Git repository. |
| 447 | <orderedlist> |
| 448 | <listitem><para> |
| 449 | <emphasis>Set Your Directory:</emphasis> |
| 450 | Be in the directory where you want to create your local |
| 451 | copy of poky. |
| 452 | </para></listitem> |
| 453 | <listitem><para> |
| 454 | <emphasis>Clone the Repository:</emphasis> |
| 455 | The following command clones the repository and uses |
| 456 | the default name "poky" for your local repository: |
| 457 | <literallayout class='monospaced'> |
| 458 | $ git clone git://git.yoctoproject.org/poky |
| 459 | Cloning into 'poky'... |
| 460 | remote: Counting objects: 367178, done. |
| 461 | remote: Compressing objects: 100% (88161/88161), done. |
| 462 | remote: Total 367178 (delta 272761), reused 366942 (delta 272525) |
| 463 | Receiving objects: 100% (367178/367178), 133.26 MiB | 6.40 MiB/s, done. |
| 464 | Resolving deltas: 100% (272761/272761), done. |
| 465 | Checking connectivity... done. |
| 466 | </literallayout> |
| 467 | Unless you specify a specific development branch or |
| 468 | tag name, Git clones the "master" branch, which results |
| 469 | in a snapshot of the latest development changes for |
| 470 | "master". |
| 471 | For information on how to check out a specific |
| 472 | development branch or on how to check out a local |
| 473 | branch based on a tag name, see the |
| 474 | "<link linkend='checking-out-by-branch-in-poky'>Checking Out By Branch in Poky</link>" |
| 475 | and |
| 476 | <link linkend='checkout-out-by-tag-in-poky'>Checking Out By Tag in Poky</link>", |
| 477 | respectively.</para> |
| 478 | |
| 479 | <para>Once the repository is created, you can change to |
| 480 | that directory and check its status. |
| 481 | Here, the single "master" branch exists on your system |
| 482 | and by default, it is checked out: |
| 483 | <literallayout class='monospaced'> |
| 484 | $ cd ~/poky |
| 485 | $ git status |
| 486 | On branch master |
| 487 | Your branch is up-to-date with 'origin/master'. |
| 488 | nothing to commit, working directory clean |
| 489 | $ git branch |
| 490 | * master |
| 491 | </literallayout> |
| 492 | Your local repository of poky is identical to the |
| 493 | upstream poky repository at the time from which it was |
| 494 | cloned. |
| 495 | </para></listitem> |
| 496 | </orderedlist> |
| 497 | </para> |
| 498 | </section> |
| 499 | |
| 500 | <section id='checking-out-by-branch-in-poky'> |
| 501 | <title>Checking Out by Branch in Poky</title> |
| 502 | |
| 503 | <para> |
| 504 | When you clone the upstream poky repository, you have access to |
| 505 | all its development branches. |
| 506 | Each development branch in a repository is unique as it forks |
| 507 | off the "master" branch. |
| 508 | To see and use the files of a particular development branch |
| 509 | locally, you need to know the branch name and then specifically |
| 510 | check out that development branch. |
| 511 | <note> |
| 512 | Checking out an active development branch by branch name |
| 513 | gives you a snapshot of that particular branch at the time |
| 514 | you check it out. |
| 515 | Further development on top of the branch that occurs after |
| 516 | check it out can occur. |
| 517 | </note> |
| 518 | <orderedlist> |
| 519 | <listitem><para> |
| 520 | <emphasis>Switch to the Poky Directory:</emphasis> |
| 521 | If you have a local poky Git repository, switch to that |
| 522 | directory. |
| 523 | If you do not have the local copy of poky, see the |
| 524 | "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>" |
| 525 | section. |
| 526 | </para></listitem> |
| 527 | <listitem><para> |
| 528 | <emphasis>Determine Existing Branch Names:</emphasis> |
| 529 | <literallayout class='monospaced'> |
| 530 | $ git branch -a |
| 531 | * master |
| 532 | remotes/origin/1.1_M1 |
| 533 | remotes/origin/1.1_M2 |
| 534 | remotes/origin/1.1_M3 |
| 535 | remotes/origin/1.1_M4 |
| 536 | remotes/origin/1.2_M1 |
| 537 | remotes/origin/1.2_M2 |
| 538 | remotes/origin/1.2_M3 |
| 539 | . |
| 540 | . |
| 541 | . |
| 542 | remotes/origin/master-next |
| 543 | remotes/origin/master-next2 |
| 544 | remotes/origin/morty |
| 545 | remotes/origin/pinky |
| 546 | remotes/origin/purple |
| 547 | remotes/origin/pyro |
| 548 | remotes/origin/rocko |
| 549 | </literallayout> |
| 550 | </para></listitem> |
| 551 | <listitem><para> |
| 552 | <emphasis>Checkout the Branch:</emphasis> |
| 553 | Checkout the development branch in which you want to work. |
| 554 | For example, to access the files for the Yocto Project |
| 555 | &DISTRO; Release (&DISTRO_NAME;), use the following command: |
| 556 | <literallayout class='monospaced'> |
| 557 | $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP; |
| 558 | Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin. |
| 559 | Switched to a new branch '&DISTRO_NAME_NO_CAP;' |
| 560 | </literallayout> |
| 561 | The previous command checks out the "&DISTRO_NAME_NO_CAP;" |
| 562 | development branch and reports that the branch is tracking |
| 563 | the upstream "origin/&DISTRO_NAME_NO_CAP;" branch.</para> |
| 564 | |
| 565 | <para>The following command displays the branches |
| 566 | that are now part of your local poky repository. |
| 567 | The asterisk character indicates the branch that is |
| 568 | currently checked out for work: |
| 569 | <literallayout class='monospaced'> |
| 570 | $ git branch |
| 571 | master |
| 572 | * &DISTRO_NAME_NO_CAP; |
| 573 | </literallayout> |
| 574 | </para></listitem> |
| 575 | </orderedlist> |
| 576 | </para> |
| 577 | </section> |
| 578 | |
| 579 | <section id='checkout-out-by-tag-in-poky'> |
| 580 | <title>Checking Out by Tag in Poky</title> |
| 581 | |
| 582 | <para> |
| 583 | Similar to branches, the upstream repository uses tags |
| 584 | to mark specific commits associated with significant points in |
| 585 | a development branch (i.e. a release point or stage of a |
| 586 | release). |
| 587 | You might want to set up a local branch based on one of those |
| 588 | points in the repository. |
| 589 | The process is similar to checking out by branch name except you |
| 590 | use tag names. |
| 591 | <note> |
| 592 | Checking out a branch based on a tag gives you a |
| 593 | stable set of files not affected by development on the |
| 594 | branch above the tag. |
| 595 | </note> |
| 596 | <orderedlist> |
| 597 | <listitem><para> |
| 598 | <emphasis>Switch to the Poky Directory:</emphasis> |
| 599 | If you have a local poky Git repository, switch to that |
| 600 | directory. |
| 601 | If you do not have the local copy of poky, see the |
| 602 | "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>" |
| 603 | section. |
| 604 | </para></listitem> |
| 605 | <listitem><para> |
| 606 | <emphasis>Fetch the Tag Names:</emphasis> |
| 607 | To checkout the branch based on a tag name, you need to |
| 608 | fetch the upstream tags into your local repository: |
| 609 | <literallayout class='monospaced'> |
| 610 | $ git fetch --tags |
| 611 | $ |
| 612 | </literallayout> |
| 613 | </para></listitem> |
| 614 | <listitem><para> |
| 615 | <emphasis>List the Tag Names:</emphasis> |
| 616 | You can list the tag names now: |
| 617 | <literallayout class='monospaced'> |
| 618 | $ git tag |
| 619 | 1.1_M1.final |
| 620 | 1.1_M1.rc1 |
| 621 | 1.1_M1.rc2 |
| 622 | 1.1_M2.final |
| 623 | 1.1_M2.rc1 |
| 624 | . |
| 625 | . |
| 626 | . |
| 627 | yocto-2.2 |
| 628 | yocto-2.2.1 |
| 629 | yocto-2.3 |
| 630 | yocto-2.3.1 |
| 631 | yocto-2.4 |
| 632 | yocto_1.5_M5.rc8 |
| 633 | </literallayout> |
| 634 | </para></listitem> |
| 635 | <listitem><para> |
| 636 | <emphasis>Checkout the Branch:</emphasis> |
| 637 | <literallayout class='monospaced'> |
| 638 | $ git checkout tags/&DISTRO; -b my_yocto_&DISTRO; |
| 639 | Switched to a new branch 'my_yocto_&DISTRO;' |
| 640 | $ git branch |
| 641 | master |
| 642 | * my_yocto_&DISTRO; |
| 643 | </literallayout> |
| 644 | The previous command creates and checks out a local |
| 645 | branch named "my_yocto_&DISTRO;", which is based on |
| 646 | the commit in the upstream poky repository that has |
| 647 | the same tag. |
| 648 | In this example, the files you have available locally |
| 649 | as a result of the <filename>checkout</filename> |
| 650 | command are a snapshot of the |
| 651 | "&DISTRO_NAME_NO_CAP;" development branch at the point |
| 652 | where Yocto Project &DISTRO; was released. |
| 653 | </para></listitem> |
| 654 | </orderedlist> |
| 655 | </para> |
| 656 | </section> |
| 657 | </section> |
| 658 | |
| 659 | <section id='performing-a-simple-build'> |
| 660 | <title>Performing a Simple Build</title> |
| 661 | |
| 662 | <para> |
| 663 | Several methods exist that allow you to build an image within the |
| 664 | Yocto Project. |
| 665 | This procedure shows how to build an image using BitBake from a |
| 666 | Linux host. |
| 667 | <note><title>Notes</title> |
| 668 | <itemizedlist> |
| 669 | <listitem><para> |
| 670 | For information on how to build an image using |
| 671 | <ulink url='&YOCTO_DOCS_REF_URL;#toaster-term'>Toaster</ulink>, |
| 672 | see the |
| 673 | <ulink url='&YOCTO_DOCS_TOAST_URL;'>Yocto Project Toaster Manual</ulink>. |
| 674 | </para></listitem> |
| 675 | <listitem><para> |
| 676 | For information on how to use |
| 677 | <filename>devtool</filename> to build images, see the |
| 678 | "<ulink url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'>Using <filename>devtool</filename> in Your SDK Workflow</ulink>" |
| 679 | section in the Yocto Project Application Development and |
| 680 | the Extensible Software Development Kit (eSDK) manual. |
| 681 | </para></listitem> |
| 682 | </itemizedlist> |
| 683 | </note> |
| 684 | </para> |
| 685 | |
| 686 | <para> |
| 687 | The build process creates an entire Linux distribution from source |
| 688 | and places it in your |
| 689 | <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink> |
| 690 | under <filename>tmp/deploy/images</filename>. |
| 691 | For detailed information on the build process using BitBake, see the |
| 692 | "<ulink url='&YOCTO_DOCS_REF_URL;#images-dev-environment'>Images</ulink>" |
| 693 | section in the Yocto Project Reference Manual. |
| 694 | You can also reference the |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 695 | "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>" |
| 696 | section in the Yocto Project Quick Start. |
| 697 | </para> |
| 698 | |
| 699 | <para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 700 | The following figure and list overviews the build process: |
| 701 | <imagedata fileref="figures/bitbake-build-flow.png" width="7in" depth="4in" align="center" scalefit="1" /> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 702 | <orderedlist> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 703 | <listitem><para> |
| 704 | <emphasis>Set up Your Host Development System to Support |
| 705 | Development Using the Yocto Project</emphasis>: |
| 706 | See the |
| 707 | "<ulink url='&YOCTO_DOCS_QS_URL;#yp-resources'>Setting Up to Use the Yocto Project</ulink>" |
| 708 | section in the Yocto Project Quick Start for options on how |
| 709 | to get a build host ready to use the Yocto Project. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 710 | </para></listitem> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 711 | <listitem><para> |
| 712 | <emphasis>Initialize the Build Environment:</emphasis> |
| 713 | Initialize the build environment by sourcing the build |
| 714 | environment script (i.e. |
| 715 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>). |
| 716 | </para></listitem> |
| 717 | <listitem><para> |
| 718 | <emphasis>Make Sure Your <filename>local.conf</filename> |
| 719 | File is Correct:</emphasis> |
| 720 | Ensure the <filename>conf/local.conf</filename> configuration |
| 721 | file, which is found in the |
| 722 | <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>, |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 723 | is set up how you want it. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 724 | This file defines many aspects of the build environment |
| 725 | including the target machine architecture through the |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 726 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'>MACHINE</ulink></filename> variable, |
| 727 | the packaging format used during the build |
| 728 | (<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>), |
| 729 | and a centralized tarball download directory through the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 730 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'>DL_DIR</ulink></filename> variable. |
| 731 | </para></listitem> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 732 | <listitem><para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 733 | <emphasis>Build the Image:</emphasis> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 734 | Build the image using the <filename>bitbake</filename> command. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 735 | For example, the following command builds the |
| 736 | <filename>core-image-minimal</filename> image: |
| 737 | <literallayout class='monospaced'> |
| 738 | $ bitbake core-image-minimal |
| 739 | </literallayout> |
| 740 | For information on BitBake, see the |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 741 | <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>. |
| 742 | </para></listitem> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 743 | </orderedlist> |
| 744 | </para> |
| 745 | </section> |
| 746 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 747 | --> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 748 | </chapter> |
| 749 | <!-- |
| 750 | vim: expandtab tw=80 ts=4 |
| 751 | --> |