dev-manual-start.xml 38 KB

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