dev-manual-start.xml 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  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. <section id='setting-up-a-native-linux-host'>
  26. <title>Setting Up a Native Linux Host</title>
  27. <para>
  28. Follow these steps to prepare a native Linux machine as your
  29. Yocto Project development host:
  30. <orderedlist>
  31. <listitem><para>
  32. <emphasis>Use a Supported Linux Distribution:</emphasis>
  33. You should have a reasonably current Linux-based host
  34. system.
  35. You will have the best results with a recent release of
  36. Fedora, openSUSE, Debian, Ubuntu, or CentOS as these
  37. releases are frequently tested against the Yocto Project
  38. and officially supported.
  39. For a list of the distributions under validation and their
  40. status, see the
  41. "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section
  42. in the Yocto Project Reference Manual and the wiki page at
  43. <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>.
  44. </para></listitem>
  45. <listitem><para>
  46. <emphasis>Have Enough Free Memory:</emphasis>
  47. You should have at least 50 Gbytes of free disk space
  48. for building images.
  49. </para></listitem>
  50. <listitem><para>
  51. <emphasis>Meet Minimal Version Requirements:</emphasis>
  52. The OpenEmbedded build system should be able to run on any
  53. modern distribution that has the following versions for
  54. Git, tar, and Python.
  55. <itemizedlist>
  56. <listitem><para>
  57. Git 1.8.3.1 or greater
  58. </para></listitem>
  59. <listitem><para>
  60. tar 1.27 or greater
  61. </para></listitem>
  62. <listitem><para>
  63. Python 3.4.0 or greater.
  64. </para></listitem>
  65. </itemizedlist>
  66. If your build host does not meet any of these three listed
  67. version requirements, you can take steps to prepare the
  68. system so that you can still use the Yocto Project.
  69. See the
  70. "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
  71. section in the Yocto Project Reference Manual for
  72. information.
  73. </para></listitem>
  74. <listitem><para>
  75. <emphasis>Install Development Host Packages:</emphasis>
  76. Required development host packages vary depending on your
  77. build machine and what you want to do with the Yocto
  78. Project.
  79. Collectively, the number of required packages is large
  80. if you want to be able to cover all cases.</para>
  81. <para>For lists of required packages for all scenarios,
  82. see the
  83. "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
  84. section in the Yocto Project Reference Manual.
  85. </para></listitem>
  86. </orderedlist>
  87. </para>
  88. </section>
  89. <section id='setting-up-to-use-crops'>
  90. <title>Setting Up to Use CROss PlatformS (CROPS)</title>
  91. <para>
  92. With
  93. <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
  94. which leverages
  95. <ulink url='https://www.docker.com/'>Docker Containers</ulink>,
  96. you can create a Yocto Project development environment that
  97. is operating system agnostic.
  98. You can set up a container in which you can develop using the
  99. Yocto Project on a Windows, Mac, or Linux machine.
  100. </para>
  101. <para>
  102. Follow these general steps to prepare a Windows, Mac, or Linux
  103. machine as your Yocto Project development host:
  104. <orderedlist>
  105. <listitem><para>
  106. <emphasis>Go to the Docker Installation Site:</emphasis>
  107. <ulink url='https://www.docker.com/what-docker'>Docker</ulink>
  108. is a software container platform that you need to install
  109. on the host development machine.
  110. To start the installation process, see the
  111. <ulink url='https://docs.docker.com/engine/installation/'>Docker Installation</ulink>
  112. site.
  113. </para></listitem>
  114. <listitem><para>
  115. <emphasis>Choose Your Docker Edition:</emphasis>
  116. Docker comes in several editions.
  117. For the Yocto Project, the stable community edition
  118. (i.e. "Docker CE Stable") is adequate.
  119. You can learn more about the Docker editions from the
  120. site.
  121. </para></listitem>
  122. <listitem><para>
  123. <emphasis>Go the Install Site for Your Platform:</emphasis>
  124. Click the link for the Docker edition associated with
  125. your development host machine's native software.
  126. For example, if your machine is running Microsoft
  127. Windows Version 10 and you want the Docker CE Stable
  128. edition, click that link under "Supported Platforms".
  129. </para></listitem>
  130. <listitem><para>
  131. <emphasis>Understand What You Need:</emphasis>
  132. The install page has pre-requisites your machine must
  133. meet.
  134. Be sure you read through this page and make sure your
  135. machine meets the requirements to run Docker.
  136. If your machine does not meet the requirements, the page
  137. has instructions to handle exceptions.
  138. For example, to run Docker on Windows 10, you must have
  139. the pro version of the operating system.
  140. If you have the home version, you need to install the
  141. <ulink url='https://docs.docker.com/toolbox/overview/#ready-to-get-started'>Docker Toolbox</ulink>.
  142. </para>
  143. <para>Another example is that a Windows machine needs to
  144. have Microsoft Hyper-V.
  145. If you have a legacy version of the the Microsoft
  146. operating system or for any other reason you do not have
  147. Microsoft Hyper-V, you would have to enter the BIOS and
  148. enable virtualization.
  149. </para></listitem>
  150. <listitem><para>
  151. <emphasis>Install the Software:</emphasis>
  152. Once you have understood all the pre-requisites, you can
  153. download and install the appropriate software.
  154. Follow the instructions for your specific machine and
  155. the type of the software you need to install.
  156. </para></listitem>
  157. <listitem><para>
  158. <emphasis>Optionally Orient Yourself With Dockers:</emphasis>
  159. If you are unfamiliar with Dockers and the container
  160. concept, you can learn more here -
  161. <ulink url='https://docs.docker.com/get-started/'></ulink>.
  162. You should be able to launch Docker or the Docker Toolbox
  163. and have a terminal shell on your development host.
  164. </para></listitem>
  165. <listitem><para>
  166. <emphasis>Set Up the Containers to Use the Yocto Project:</emphasis>
  167. Go to
  168. <ulink url='https://github.com/crops/docker-win-mac-docs/wiki'></ulink>
  169. and follow the directions for your particular
  170. development host (i.e. Linux, Mac, or Windows).</para>
  171. <para>Once you complete the setup instructions for your
  172. machine, you have the Poky, Extensible SDK, and Toaster
  173. containers available.
  174. You can click those links from the page and learn more
  175. about using each of those containers.
  176. </para></listitem>
  177. </orderedlist>
  178. Once you have a container set up, everything is in place to
  179. develop just as if you were running on a native Linux machine.
  180. If you are going to use the Poky container, see the
  181. "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
  182. section.
  183. If you are going to use the Extensible SDK container, see the
  184. "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
  185. Chapter in the Yocto Project Software Development Kit (SDK)
  186. Developer's Guide.
  187. If you are going to use the Toaster container, see the
  188. "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
  189. section in the Toaster User Manual.
  190. </para>
  191. </section>
  192. <section id='setting-up-bsp-layers'>
  193. <title>Setting Up BSP Layers</title>
  194. <para>
  195. This section describes how to set up a layer for a Board Support
  196. Package (BSP).
  197. For structural information on BSPs, see the
  198. <ulink url='&YOCTO_DOCS_BSP_URL;#bsp-guide'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
  199. <orderedlist>
  200. <listitem><para>
  201. <emphasis>Determine the BSP Layer You Want:</emphasis>
  202. The Yocto Project supports many BSPs, which are maintained in
  203. their own layers or in layers designed to contain several
  204. BSPs.
  205. To get an idea of machine support through BSP layers, you can
  206. look at the
  207. <ulink url='&YOCTO_RELEASE_DL_URL;/machines'>index of machines</ulink>
  208. for the release.
  209. <note>
  210. The Yocto Project uses the following BSP layer naming
  211. scheme:
  212. <literallayout class='monospaced'>
  213. meta-<replaceable>bsp_name</replaceable>
  214. </literallayout>
  215. where <replaceable>bsp_name</replaceable> is the recognized
  216. BSP name.
  217. Here is an example:
  218. <literallayout class='monospaced'>
  219. meta-raspberrypi
  220. </literallayout>
  221. See the
  222. "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
  223. section in the Yocto Project Board Support Package (BSP)
  224. Developer's Guide for more information on BSP Layers.
  225. </note>
  226. </para></listitem>
  227. <listitem><para>
  228. <emphasis>Optionally Set Up the <filename>meta-intel</filename> BSP Layer:</emphasis>
  229. If your hardware is based on current Intel CPUs and devices,
  230. you can leverage this BSP layer.
  231. For details on the <filename>meta-intel</filename> BSP layer,
  232. see the layer's
  233. <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/tree/README'><filename>README</filename></ulink>
  234. file.
  235. <orderedlist>
  236. <listitem><para>
  237. <emphasis>Navigate to Your Source Directory:</emphasis>
  238. Typically, you set up the
  239. <filename>meta-intel</filename> Git repository
  240. inside the
  241. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
  242. (e.g. <filename>poky</filename>).
  243. </para></listitem>
  244. <listitem><para>
  245. <emphasis>Clone the Layer:</emphasis>
  246. <literallayout class='monospaced'>
  247. $ git clone git://git.yoctoproject.org/meta-intel.git
  248. Cloning into 'meta-intel'...
  249. remote: Counting objects: 14224, done.
  250. remote: Compressing objects: 100% (4591/4591), done.
  251. remote: Total 14224 (delta 8245), reused 13985 (delta 8006)
  252. Receiving objects: 100% (14224/14224), 4.29 MiB | 2.90 MiB/s, done.
  253. Resolving deltas: 100% (8245/8245), done.
  254. Checking connectivity... done.
  255. </literallayout>
  256. </para></listitem>
  257. <listitem><para>
  258. <emphasis>Check Out the Proper Branch:</emphasis>
  259. The branch you check out for
  260. <filename>meta-intel</filename> must match the same
  261. branch you are using for the Yocto Project release
  262. (e.g. &DISTRO_NAME_NO_CAP;):
  263. <literallayout class='monospaced'>
  264. $ git checkout <replaceable>branch_name</replaceable>
  265. </literallayout>
  266. For an example on how to discover branch names and
  267. checkout on a branch, see the
  268. "<link linkend='checking-out-by-branch-in-poky'>Checking Out By Branch in Poky</link>"
  269. section.
  270. </para></listitem>
  271. </orderedlist>
  272. </para></listitem>
  273. <listitem><para>
  274. <emphasis>Optionally Set Up an Alternative BSP Layer:</emphasis>
  275. If your hardware can be more closely leveraged to an
  276. existing BSP not within the <filename>meta-intel</filename>
  277. BSP layer, you can clone that BSP layer.</para>
  278. <para>The process is identical to the process used for the
  279. <filename>meta-intel</filename> layer except for the layer's
  280. name.
  281. For example, if you determine that your hardware most
  282. closely matches the <filename>meta-minnow</filename>,
  283. clone that layer:
  284. <literallayout class='monospaced'>
  285. $ git clone git://git.yoctoproject.org/meta-minnow
  286. Cloning into 'meta-minnow'...
  287. remote: Counting objects: 456, done.
  288. remote: Compressing objects: 100% (283/283), done.
  289. remote: Total 456 (delta 163), reused 384 (delta 91)
  290. Receiving objects: 100% (456/456), 96.74 KiB | 0 bytes/s, done.
  291. Resolving deltas: 100% (163/163), done.
  292. Checking connectivity... done.
  293. </literallayout>
  294. </para></listitem>
  295. </orderedlist>
  296. </para>
  297. </section>
  298. <section id='local-kernel-files'>
  299. <title>Setting Up to Work on a Kernel</title>
  300. <para>
  301. Kernel development is best accomplished using
  302. <ulink url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'><filename>devtool</filename></ulink>
  303. and not through traditional kernel workflow methods.
  304. This section provides procedures to set up for both.
  305. </para>
  306. <section id='getting-ready-to-develop-using-devtool'>
  307. <title>Getting Ready to Develop using <filename>devtool</filename></title>
  308. <para role='writernotes'>
  309. Need the updated wiki stuff here
  310. </para>
  311. </section>
  312. <section id='getting-ready-for-traditional-kernel-development'>
  313. <title>Getting Ready for Traditional Kernel Development</title>
  314. <para>
  315. For traditional kernel development using the Yocto
  316. Project, you need to establish local copies of the
  317. kernel source.
  318. You can find Git repositories of supported Yocto Project
  319. kernels organized under "Yocto Linux Kernel" in the Yocto
  320. Project Source Repositories at
  321. <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.
  322. </para>
  323. <para>
  324. This setup can involve creating a bare clone of the
  325. Yocto Project kernel and then copying that cloned
  326. repository.
  327. You can create the bare clone and the copy of the bare
  328. clone anywhere you like.
  329. For simplicity, it is recommended that you create these
  330. structures outside of the
  331. <ulink url='&YOCTO_DOCS_REF_URL;source-directory'>Source Directory</ulink>,
  332. which is usually named <filename>poky</filename>.
  333. </para>
  334. <para>
  335. The following steps show how to create a bare clone of the
  336. <filename>linux-yocto-4.4</filename> kernel and then
  337. create a copy of that clone:
  338. <note>
  339. When you have a local Yocto Project kernel Git
  340. repository, you can reference that repository rather than
  341. the upstream Git repository as part of the
  342. <filename>clone</filename> command.
  343. Doing so can speed up the process.
  344. </note>
  345. <orderedlist>
  346. <listitem><para>
  347. <emphasis>Create the Bare Clone:</emphasis>
  348. In the following example, the bare clone is named
  349. <filename>linux-yocto-4.4.git</filename>:
  350. <literallayout class='monospaced'>
  351. $ git clone &dash;&dash;bare git://git.yoctoproject.org/linux-yocto-4.4 linux-yocto-4.4.git
  352. Cloning into bare repository 'linux-yocto-4.4.git'...
  353. remote: Counting objects: 4543903, done.
  354. remote: Compressing objects: 100% (695618/695618), done.
  355. remote: Total 4543903 (delta 3818435), reused 4541724 (delta 3816256)
  356. Receiving objects: 100% (4543903/4543903), 801.08 MiB | 6.55 MiB/s, done.
  357. Resolving deltas: 100% (3818435/3818435), done.
  358. Checking connectivity... done.
  359. </literallayout>
  360. </para></listitem>
  361. <listitem><para>
  362. <emphasis>Create the Copy of the Bare Clone:</emphasis>
  363. In the following command, the copy of the bare clone
  364. is named <filename>my-linux-yocto-4.4-work</filename>:
  365. <literallayout class='monospaced'>
  366. $ git clone linux-yocto-4.4.git my-linux-yocto-4.4-work
  367. Cloning into 'my-linux-yocto-4.4-work'...
  368. done.
  369. Checking out files: 100% (52221/52221), done.
  370. </literallayout>
  371. </para></listitem>
  372. <listitem><para>
  373. <emphasis>Cloning the <filename>meta-yocto-kernel-extras</filename> Repository:</emphasis>
  374. The <filename>meta-yocto-kernel-extras</filename> Git
  375. repository contains Metadata needed only if you are
  376. modifying and building the kernel image.
  377. In particular, it contains the kernel BitBake append
  378. (<filename>.bbappend</filename>) files that you edit to
  379. point to your locally modified kernel source files and to
  380. build the kernel image.
  381. Pointing to these local files is much more efficient than
  382. requiring a download of the kernel's source files from
  383. upstream each time you make changes to the kernel.</para>
  384. <para>You can find the
  385. <filename>meta-yocto-kernel-extras</filename> Git
  386. Repository in the "Yocto Metadata Layers" area of the
  387. Yocto Project Source Repositories at
  388. <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.
  389. It is good practice to create this Git repository
  390. inside the Source Directory.</para>
  391. <para>Following is an example that creates the
  392. <filename>meta-yocto-kernel-extras</filename> Git
  393. repository inside the Source Directory, which is named
  394. <filename>poky</filename>, in this case:
  395. <literallayout class='monospaced'>
  396. $ cd ~/poky
  397. $ git clone git://git.yoctoproject.org/meta-yocto-kernel-extras meta-yocto-kernel-extras
  398. Cloning into 'meta-yocto-kernel-extras'...
  399. remote: Counting objects: 727, done.
  400. remote: Compressing objects: 100% (452/452), done.
  401. remote: Total 727 (delta 260), reused 719 (delta 252)
  402. Receiving objects: 100% (727/727), 536.36 KiB | 0 bytes/s, done.
  403. Resolving deltas: 100% (260/260), done.
  404. Checking connectivity... done.
  405. </literallayout>
  406. </para></listitem>
  407. </orderedlist>
  408. </para>
  409. </section>
  410. </section>
  411. <section id='setting-up-to-use-eclipse'>
  412. <title>Setting Up to Use Eclipse</title>
  413. <para>
  414. This section presents the steps needed to set up your host if you
  415. are going to be using the popular
  416. <trademark class='trade'>Eclipse</trademark> IDE.
  417. The steps in this procedure are links to sections in the
  418. Yocto Project Software Development Kit (SDK) Developer's Guide
  419. that provide detailed procedures given the Neon version of
  420. Eclipse.
  421. For procedures on the entire development process using
  422. Eclipse, see the
  423. "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-developing-applications-using-eclipse'>Developing Applications Using Eclipse</ulink>"
  424. section in the Yocto Project Software Development Kit (SDK)
  425. Developer's Guide.
  426. <orderedlist>
  427. <listitem><para>
  428. <emphasis>Install Eclipse:</emphasis>
  429. See the
  430. "<ulink url='&YOCTO_DOCS_SDK_URL;#neon-installing-eclipse-ide'>Installing the Neon Eclipse IDE</ulink>"
  431. section.
  432. </para></listitem>
  433. <listitem><para>
  434. <emphasis>Configure Eclipse:</emphasis>
  435. See the
  436. "<ulink url='&YOCTO_DOCS_SDK_URL;#neon-configuring-the-mars-eclipse-ide'>Configuring the Neon Eclipse IDE</ulink>"
  437. section.
  438. </para></listitem>
  439. <listitem><para>
  440. <emphasis>Configure Eclipse:</emphasis>
  441. See the
  442. "<ulink url='&YOCTO_DOCS_SDK_URL;#neon-installing-the-eclipse-yocto-plug-in'>Installing or Accessing the Neon Eclipse Yocto Plug-in</ulink>"
  443. section.
  444. </para></listitem>
  445. <listitem><para>
  446. <emphasis>Configure Eclipse:</emphasis>
  447. See the
  448. "<ulink url='&YOCTO_DOCS_SDK_URL;#neon-configuring-the-eclipse-yocto-plug-in'>Configuring the Neon Eclipse Yocto Plug-in</ulink>"
  449. section.
  450. </para></listitem>
  451. </orderedlist>
  452. </para>
  453. </section>
  454. </section>
  455. <section id='working-with-yocto-project-source-files'>
  456. <title>Working With Yocto Project Source Files</title>
  457. <para>
  458. This section contains procedures related to locating and securing
  459. Yocto Project files.
  460. You establish and use these local files to work on projects.
  461. <note><title>Notes</title>
  462. <itemizedlist>
  463. <listitem><para>
  464. For concepts and introductory information about Git as it
  465. is used in the Yocto Project, see the
  466. "<ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink>"
  467. section in the Yocto Project Reference Manual.
  468. </para></listitem>
  469. <listitem><para>
  470. For concepts on Yocto Project source repositories, see the
  471. "<ulink url='&YOCTO_DOCS_REF_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
  472. section in the Yocto Project Reference Manual."
  473. </para></listitem>
  474. </itemizedlist>
  475. </note>
  476. </para>
  477. <section id='accessing-source-repositories'>
  478. <title>Accessing Source Repositories</title>
  479. <para>
  480. Yocto Project maintains upstream Git
  481. <ulink url='&YOCTO_DOCS_REF_URL;#source-repositories'>Source Repositories</ulink>
  482. that you can examine and access using a browser-based UI:
  483. <orderedlist>
  484. <listitem><para>
  485. <emphasis>Access Repositories:</emphasis>
  486. Open a browser and go to
  487. <ulink url='&YOCTO_GIT_URL;'></ulink> to access the
  488. GUI-based interface into the Yocto Project source
  489. repositories.
  490. </para></listitem>
  491. <listitem><para>
  492. <emphasis>Select a Repository:</emphasis>
  493. Click on any repository in which you are interested (e.g.
  494. <filename>poky</filename>).
  495. </para></listitem>
  496. <listitem><para>
  497. <emphasis>Find the URL Used to Clone the Repository:</emphasis>
  498. At the bottom of the page, note the URL used to
  499. <ulink url='&YOCTO_DOCS_REF_URL;#git-commands-clone'>clone</ulink>
  500. that repository (e.g.
  501. <filename>&YOCTO_GIT_URL;/poky</filename>).
  502. </para></listitem>
  503. <listitem><para>
  504. <emphasis>Examine Change History of the Repository:</emphasis>
  505. At the top of the page, click on any branch in which you
  506. might be interested (e.g.
  507. <filename>&DISTRO_NAME_NO_CAP;</filename>).
  508. You can then view the commit log or tree view for that
  509. development branch.
  510. </para></listitem>
  511. </orderedlist>
  512. </para>
  513. </section>
  514. <section id='accessing-index-of-releases'>
  515. <title>Accessing Index of Releases</title>
  516. <para>
  517. Yocto Project maintains an Index of Releases area that contains
  518. related files that contribute to the Yocto Project.
  519. Rather than Git repositories, these files represent snapshot
  520. tarballs.
  521. <note><title>Tip</title>
  522. The recommended method for accessing Yocto Project
  523. components is to use Git to clone a repository and work from
  524. within that local repository.
  525. The procedure in this section exists should you desire a
  526. tarball snapshot of any given component.
  527. </note>
  528. <orderedlist>
  529. <listitem><para>
  530. <emphasis>Access the Index of Releases:</emphasis>
  531. Open a browser and go to
  532. <ulink url='&YOCTO_DL_URL;/releases'></ulink> to access the
  533. Index of Releases.
  534. The list represents released components (e.g.
  535. <filename>eclipse-plugin</filename>,
  536. <filename>sato</filename>, and so on).
  537. <note>
  538. The <filename>yocto</filename> directory contains the
  539. full array of released Poky tarballs.
  540. The <filename>poky</filename> directory in the
  541. Index of Releases was historically used for very
  542. early releases and exists for retroactive
  543. completeness only.
  544. </note>
  545. </para></listitem>
  546. <listitem><para>
  547. <emphasis>Select a Component:</emphasis>
  548. Click on any released component in which you are interested
  549. (e.g. <filename>yocto</filename>).
  550. </para></listitem>
  551. <listitem><para>
  552. <emphasis>Find the Tarball:</emphasis>
  553. Drill down to find the associated tarball.
  554. For example, click on <filename>yocto-2.3</filename> to
  555. view files associated with the Yocto Project 2.3
  556. release (e.g. <filename>poky-pyro-17.0.0tar.bz2</filename>,
  557. which is the released Poky tarball).
  558. </para></listitem>
  559. <listitem><para>
  560. <emphasis>Download the Tarball:</emphasis>
  561. Click a tarball to download and save a snapshot of a
  562. given component.
  563. </para></listitem>
  564. </orderedlist>
  565. </para>
  566. </section>
  567. <section id='using-the-downloads-page'>
  568. <title>Using the Downloads Page</title>
  569. <para>
  570. The
  571. <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
  572. uses a "Downloads" area from which you can locate and download
  573. tarballs of any Yocto Project release.
  574. Rather than Git repositories, these files represent snapshot
  575. tarballs.
  576. <note><title>Tip</title>
  577. The recommended method for accessing Yocto Project
  578. components is to use Git to clone a repository and work from
  579. within that local repository.
  580. The procedure in this section exists should you desire a
  581. tarball snapshot of any given component.
  582. </note>
  583. <orderedlist>
  584. <listitem><para>
  585. <emphasis>Go to the Yocto Project Website:</emphasis>
  586. Open The
  587. <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
  588. in your browser.
  589. </para></listitem>
  590. <listitem><para>
  591. <emphasis>Get to the Downloads Area:</emphasis>
  592. Click the "Downloads" tab.
  593. </para></listitem>
  594. <listitem><para>
  595. <emphasis>Select the Type of Files:</emphasis>
  596. Click the type of files you want (i.e "Build System",
  597. "Tools", or "Board Support Packages (BSPs)".
  598. </para></listitem>
  599. <listitem><para>
  600. <emphasis>Locate and Download the Tarball:</emphasis>
  601. From the list of releases, locate the appropriate
  602. download link and download the files.
  603. </para></listitem>
  604. </orderedlist>
  605. </para>
  606. </section>
  607. <section id='cloning-the-poky-repository'>
  608. <title>Cloning the <filename>poky</filename> Repository</title>
  609. <para>
  610. To use the Yocto Project, you need a release of the Yocto Project
  611. locally installed on your development system.
  612. The locally installed set of files is referred to as the
  613. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
  614. in the Yocto Project documentation.
  615. </para>
  616. <para>
  617. You create your Source Directory by using
  618. <ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink> to clone a local
  619. copy of the upstream <filename>poky</filename> repository.
  620. <note><title>Tip</title>
  621. The preferred method of getting the Yocto Project Source
  622. Directory set up is to clone the repository.
  623. </note>
  624. Working from a copy of the upstream repository allows you
  625. to contribute back into the Yocto Project or simply work with
  626. the latest software on a development branch.
  627. Because Git maintains and creates an upstream repository with
  628. a complete history of changes and you are working with a local
  629. clone of that repository, you have access to all the Yocto
  630. Project development branches and tag names used in the upstream
  631. repository.
  632. </para>
  633. <para>
  634. Follow these steps to create a local version of the
  635. upstream
  636. <ulink url='&YOCTO_DOCS_REF_URL;#poky'><filename>poky</filename></ulink>
  637. Git repository.
  638. <orderedlist>
  639. <listitem><para>
  640. <emphasis>Set Your Directory:</emphasis>
  641. Be in the directory where you want to create your local
  642. copy of poky.
  643. </para></listitem>
  644. <listitem><para>
  645. <emphasis>Clone the Repository:</emphasis>
  646. The following command clones the repository and uses
  647. the default name "poky" for your local repository:
  648. <literallayout class='monospaced'>
  649. $ git clone git://git.yoctoproject.org/poky
  650. Cloning into 'poky'...
  651. remote: Counting objects: 367178, done.
  652. remote: Compressing objects: 100% (88161/88161), done.
  653. remote: Total 367178 (delta 272761), reused 366942 (delta 272525)
  654. Receiving objects: 100% (367178/367178), 133.26 MiB | 6.40 MiB/s, done.
  655. Resolving deltas: 100% (272761/272761), done.
  656. Checking connectivity... done.
  657. </literallayout>
  658. Unless you specify a specific development branch or
  659. tag name, Git clones the "master" branch, which results
  660. in a snapshot of the latest development changes for
  661. "master".</para>
  662. <para>Once the repository is created, you can change to
  663. that directory and check its status.
  664. Here, the single "master" branch exists on your system
  665. and by default, it is checked out:
  666. <literallayout class='monospaced'>
  667. $ cd ~/poky
  668. $ git status
  669. On branch master
  670. Your branch is up-to-date with 'origin/master'.
  671. nothing to commit, working directory clean
  672. $ git branch
  673. * master
  674. </literallayout>
  675. Your local repository of poky is identical to the
  676. upstream poky repository at the time from which it was
  677. cloned.
  678. </para></listitem>
  679. </orderedlist>
  680. </para>
  681. </section>
  682. <section id='checking-out-by-branch-in-poky'>
  683. <title>Checking Out by Branch in Poky</title>
  684. <para>
  685. When you clone the upstream poky repository, you have access to
  686. all its development branches.
  687. Each development branch in a repository is unique as it forks
  688. off the "master" branch.
  689. To see and use the files of a particular development branch
  690. locally, you need to know the branch name and then specifically
  691. check out that development branch.
  692. <note>
  693. Checking out an active development branch by branch name
  694. gives you a snapshot of that particular branch at the time
  695. you check it out.
  696. Further development on top of the branch that occurs after
  697. check it out can occur.
  698. </note>
  699. <orderedlist>
  700. <listitem><para>
  701. <emphasis>Switch to the Poky Directory:</emphasis>
  702. If you have a local poky Git repository, switch to that
  703. directory.
  704. If you do not have the local copy of poky, see the
  705. "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
  706. section.
  707. </para></listitem>
  708. <listitem><para>
  709. <emphasis>Determine Existing Branch Names:</emphasis>
  710. <literallayout class='monospaced'>
  711. $ git branch -a
  712. * master
  713. remotes/origin/1.1_M1
  714. remotes/origin/1.1_M2
  715. remotes/origin/1.1_M3
  716. remotes/origin/1.1_M4
  717. remotes/origin/1.2_M1
  718. remotes/origin/1.2_M2
  719. remotes/origin/1.2_M3
  720. .
  721. .
  722. .
  723. remotes/origin/master-next
  724. remotes/origin/master-next2
  725. remotes/origin/morty
  726. remotes/origin/pinky
  727. remotes/origin/purple
  728. remotes/origin/pyro
  729. </literallayout>
  730. </para></listitem>
  731. <listitem><para>
  732. <emphasis>Checkout the Branch:</emphasis>
  733. Checkout the development branch in which you want to work.
  734. For example, to access the files for the Yocto Project
  735. 2.3 Release (Pyro), use the following command:
  736. <literallayout class='monospaced'>
  737. $ git checkout -b pyro origin/pyro
  738. Branch pyro set up to track remote branch pyro from origin.
  739. Switched to a new branch 'pyro'
  740. </literallayout>
  741. The previous command checks out the "pyro" development
  742. branch and reports that the branch is tracking the upstream
  743. "origin/pyro" branch.</para>
  744. <para>The following command displays the branches
  745. that are now part of your local poky repository.
  746. The asterisk character indicates the branch that is
  747. currently checked out for work:
  748. <literallayout class='monospaced'>
  749. $ git branch
  750. master
  751. * pyro
  752. </literallayout>
  753. </para></listitem>
  754. </orderedlist>
  755. </para>
  756. </section>
  757. <section id='checkout-out-by-tag-in-poky'>
  758. <title>Checking Out by Tag in Poky</title>
  759. <para>
  760. Similar to branches, the upstream repository uses tags
  761. to mark specific commits associated with significant points in
  762. a development branch (i.e. a release point or stage of a
  763. release).
  764. You might want to set up a local branch based on one of those
  765. points in the repository.
  766. The process is similar to checking out by branch name except you
  767. use tag names.
  768. <note>
  769. Checking out a branch based on a tag gives you a
  770. stable set of files not affected by development on the
  771. branch above the tag.
  772. </note>
  773. <orderedlist>
  774. <listitem><para>
  775. <emphasis>Switch to the Poky Directory:</emphasis>
  776. If you have a local poky Git repository, switch to that
  777. directory.
  778. If you do not have the local copy of poky, see the
  779. "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
  780. section.
  781. </para></listitem>
  782. <listitem><para>
  783. <emphasis>Fetch the Tag Names:</emphasis>
  784. To checkout the branch based on a tag name, you need to
  785. fetch the upstream tags into your local repository:
  786. <literallayout class='monospaced'>
  787. $ git fetch --tags
  788. $
  789. </literallayout>
  790. </para></listitem>
  791. <listitem><para>
  792. <emphasis>List the Tag Names:</emphasis>
  793. You can list the tag names now:
  794. <literallayout class='monospaced'>
  795. $ git tag
  796. 1.1_M1.final
  797. 1.1_M1.rc1
  798. 1.1_M1.rc2
  799. 1.1_M2.final
  800. 1.1_M2.rc1
  801. .
  802. .
  803. .
  804. yocto-2.2
  805. yocto-2.2.1
  806. yocto-2.3
  807. yocto_1.5_M5.rc8
  808. </literallayout>
  809. </para></listitem>
  810. <listitem><para>
  811. <emphasis>Checkout the Branch:</emphasis>
  812. <literallayout class='monospaced'>
  813. $ git checkout tags/2.2_M2 -b my_yocto_2.2_M2
  814. Switched to a new branch 'my_yocto_2.2_M2'
  815. $ git branch
  816. master
  817. * my_yocto_2.2_M2
  818. </literallayout>
  819. The previous command creates and checks out a local
  820. branch named "my_yocto_2.2_M2", which is based on
  821. the commit in the upstream poky repository that has
  822. the same tag.
  823. In this example, the files you have available locally
  824. as a result of the <filename>checkout</filename>
  825. command are a snapshot of the
  826. "morty" development branch at the point where
  827. milestone two was reached.
  828. </para></listitem>
  829. </orderedlist>
  830. </para>
  831. </section>
  832. </section>
  833. <section id='performing-a-simple-build'>
  834. <title>Performing a Simple Build</title>
  835. <para>
  836. Several methods exist that allow you to build an image within the
  837. Yocto Project.
  838. This procedure shows how to build an image using BitBake from a
  839. Linux host.
  840. <note><title>Notes</title>
  841. <itemizedlist>
  842. <listitem><para>
  843. For information on how to build an image using
  844. <ulink url='&YOCTO_DOCS_REF_URL;#toaster-term'>Toaster</ulink>,
  845. see the
  846. <ulink url='&YOCTO_DOCS_TOAST_URL;'>Yocto Project Toaster Manual</ulink>.
  847. </para></listitem>
  848. <listitem><para>
  849. For information on how to use
  850. <filename>devtool</filename> to build images, see the
  851. "<ulink url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'>Using <filename>devtool</filename> in Your SDK Workflow</ulink>"
  852. section in the Yocto Project Software Development Kit
  853. (SDK) Developer's Guide.
  854. </para></listitem>
  855. </itemizedlist>
  856. </note>
  857. </para>
  858. <para>
  859. The build process creates an entire Linux distribution from source
  860. and places it in your
  861. <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
  862. under <filename>tmp/deploy/images</filename>.
  863. For detailed information on the build process using BitBake, see the
  864. "<ulink url='&YOCTO_DOCS_REF_URL;#images-dev-environment'>Images</ulink>"
  865. section in the Yocto Project Reference Manual.
  866. You can also reference the
  867. "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
  868. section in the Yocto Project Quick Start.
  869. </para>
  870. <para>
  871. The following figure and list overviews the build process:
  872. <imagedata fileref="figures/bitbake-build-flow.png" width="7in" depth="6in" align="center" scalefit="1" />
  873. <orderedlist>
  874. <listitem><para>
  875. <emphasis>Set Up Your Host Development System to Support
  876. Development Using the Yocto Project:</emphasis>
  877. See the
  878. "<ulink url='&YOCTO_DOCS_QS_URL;#the-linux-distro'>The Linux Distribution</ulink>"
  879. and the
  880. "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>"
  881. sections both in the Yocto Project Quick Start for
  882. build host requirements.
  883. </para></listitem>
  884. <listitem><para>
  885. <emphasis>Set Up Your Source Directories:</emphasis>
  886. Make sure you have set up the Source Directory described in the
  887. "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
  888. section.
  889. </para></listitem>
  890. <listitem><para>
  891. <emphasis>Initialize the Build Environment:</emphasis>
  892. Initialize the build environment by sourcing a build
  893. environment script (i.e.
  894. <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
  895. or
  896. <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>).
  897. </para></listitem>
  898. <listitem><para>
  899. <emphasis>Make Sure Your <filename>local.conf</filename>
  900. File is Correct:</emphasis>
  901. Ensure the <filename>conf/local.conf</filename> configuration
  902. file, which is found in the
  903. <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
  904. is set up how you want it.
  905. This file defines many aspects of the build environment
  906. including the target machine architecture through the
  907. <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'>MACHINE</ulink></filename> variable,
  908. the packaging format used during the build
  909. (<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>),
  910. and a centralized tarball download directory through the
  911. <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'>DL_DIR</ulink></filename> variable.
  912. </para></listitem>
  913. <listitem><para>
  914. <emphasis>Build the Image:</emphasis>
  915. Build the image using the <filename>bitbake</filename> command.
  916. For example, the following command builds the
  917. <filename>core-image-minimal</filename> image:
  918. <literallayout class='monospaced'>
  919. $ bitbake core-image-minimal
  920. </literallayout>
  921. For information on BitBake, see the
  922. <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
  923. </para></listitem>
  924. </orderedlist>
  925. </para>
  926. </section>
  927. <!--
  928. <section id='using-pre-built-binaries-and-qemu'>
  929. <title>Using Pre-Built Binaries and QEMU</title>
  930. <para>
  931. Another option you have to get started is to use pre-built binaries.
  932. The Yocto Project provides many types of binaries with each release.
  933. See the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
  934. chapter in the Yocto Project Reference Manual
  935. for descriptions of the types of binaries that ship with a Yocto Project
  936. release.
  937. </para>
  938. <para>
  939. Using a pre-built binary is ideal for developing software
  940. applications to run on your target hardware.
  941. To do this, you need to be able to access the appropriate
  942. cross-toolchain tarball for the architecture on which you are
  943. developing.
  944. If you are using an SDK type image, the image ships with the complete
  945. toolchain native to the architecture (i.e. a toolchain designed to
  946. run on the
  947. <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>).
  948. If you are not using an SDK type image, you need to separately download
  949. and install the stand-alone Yocto Project cross-toolchain tarball.
  950. See the
  951. "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-appendix-obtain'>Obtaining the SDK</ulink>"
  952. appendix in the Yocto Project Software Development Kit (SDK)
  953. Developer's Guide for more information on locating and installing
  954. cross-toolchains.
  955. </para>
  956. <para>
  957. Regardless of the type of image you are using, you need to download the pre-built kernel
  958. that you will boot in the QEMU emulator and then download and extract the target root
  959. filesystem for your target machine’s architecture.
  960. You can get architecture-specific binaries and file systems from
  961. <ulink url='&YOCTO_MACHINES_DL_URL;'>machines</ulink>.
  962. You can get installation scripts for stand-alone toolchains from
  963. <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchains</ulink>.
  964. Once you have all your files, you set up the environment to emulate the hardware
  965. by sourcing an environment setup script.
  966. Finally, you start the QEMU emulator.
  967. You can find details on all these steps in the
  968. <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
  969. You can learn more about using QEMU with the Yocto Project in the
  970. "<link linkend='dev-manual-qemu'>Using the Quick EMUlator (QEMU)</link>"
  971. section.
  972. </para>
  973. </section>
  974. -->
  975. </chapter>
  976. <!--
  977. vim: expandtab tw=80 ts=4
  978. -->