brief-yoctoprojectqs.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <!DOCTYPE article 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. <article id='brief-yocto-project-qs-intro'>
  5. <articleinfo>
  6. <title>Yocto Project Quick Build</title>
  7. <copyright>
  8. <year>&COPYRIGHT_YEAR;</year>
  9. <holder>Linux Foundation</holder>
  10. </copyright>
  11. <legalnotice>
  12. <para>
  13. Permission is granted to copy, distribute and/or modify this document under
  14. the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
  15. </para>
  16. </legalnotice>
  17. <abstract>
  18. <imagedata fileref="figures/yocto-project-transp.png"
  19. width="6in" depth="1in"
  20. align="right" scale="25" />
  21. </abstract>
  22. </articleinfo>
  23. <section id='brief-welcome'>
  24. <title>Welcome!</title>
  25. <para>
  26. Welcome!
  27. This short document steps you through the process for a typical
  28. image build using the Yocto Project.
  29. You will use Yocto Project to build a reference embedded OS
  30. called Poky.
  31. <note>
  32. The examples in this paper assume you are using a native Linux
  33. system running a recent Ubuntu Linux distribution.
  34. If the machine you want to use
  35. Yocto Project on to build an image is not a native Linux
  36. system, you can still perform these steps by using CROss
  37. PlatformS (CROPS) and setting up a Poky container.
  38. See the
  39. <ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-to-use-crops'>Setting Up to Use CROss PlatformS (CROPS)</ulink>"
  40. section in the Yocto Project Development Tasks Manual for more
  41. information.
  42. </note>
  43. </para>
  44. <para>
  45. If you want more conceptual or background information on the
  46. Yocto Project, see the
  47. <ulink url='&YOCTO_DOCS_OM_URL;'>Yocto Project Overview and Concepts Manual</ulink>.
  48. </para>
  49. </section>
  50. <section id='brief-compatible-distro'>
  51. <title>Compatible Linux Distribution</title>
  52. <para>
  53. Make sure your build system meets the following requirements:
  54. <itemizedlist>
  55. <listitem><para>
  56. 50 Gbytes of free disk space
  57. </para></listitem>
  58. <listitem><para>
  59. Runs a supported Linux distribution (i.e. recent releases of
  60. Fedora, openSUSE, CentOS, Debian, or Ubuntu). For a list of
  61. Linux distributions that support the Yocto Project, see the
  62. "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>"
  63. section in the Yocto Project Reference Manual.
  64. </para></listitem>
  65. <listitem><para>
  66. <itemizedlist>
  67. <listitem><para>
  68. Git 1.8.3.1 or greater
  69. </para></listitem>
  70. <listitem><para>
  71. tar 1.27 or greater
  72. </para></listitem>
  73. <listitem><para>
  74. Python 3.4.0 or greater.
  75. </para></listitem>
  76. </itemizedlist>
  77. If your build host does not meet any of these three listed
  78. version requirements, you can take steps to prepare the
  79. system so that you can still use the Yocto Project.
  80. See the
  81. "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
  82. section in the Yocto Project Reference Manual for information.
  83. </para></listitem>
  84. </itemizedlist>
  85. </para>
  86. </section>
  87. <section id='brief-build-system-packages'>
  88. <title>Build System Packages</title>
  89. <para>
  90. You must install essential host packages on your
  91. development host.
  92. The following command installs the host packages based on an
  93. Ubuntu distribution:
  94. <note>
  95. For host package requirements on all supported Linux
  96. distributions, see the
  97. "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
  98. section in the Yocto Project Reference Manual.
  99. </note>
  100. <literallayout class='monospaced'>
  101. $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; libsdl1.2-dev xterm
  102. </literallayout>
  103. </para>
  104. </section>
  105. <section id='brief-use-git-to-clone-poky'>
  106. <title>Use Git to Clone Poky</title>
  107. <para>
  108. Once you complete the setup instructions for your machine,
  109. you need to get a copy of the Poky repository on your build
  110. system.
  111. Use the following commands to clone the Poky
  112. repository and then checkout the &DISTRO_REL_TAG; release:
  113. <literallayout class='monospaced'>
  114. $ git clone git://git.yoctoproject.org/poky
  115. Cloning into 'poky'...
  116. remote: Counting objects: 361782, done.
  117. remote: Compressing objects: 100% (87100/87100), done.
  118. remote: Total 361782 (delta 268619), reused 361439 (delta 268277)
  119. Receiving objects: 100% (361782/361782), 131.94 MiB | 6.88 MiB/s, done.
  120. Resolving deltas: 100% (268619/268619), done.
  121. Checking connectivity... done.
  122. $ git checkout tags/yocto-2.5 -b my-yocto-2.5
  123. </literallayout>
  124. The previous Git checkout command creates a local branch
  125. named my-&DISTRO_REL_TAG;. The files available to you in that
  126. branch exactly match the repository's files in the
  127. "&DISTRO_NAME_NO_CAP;" development branch at the time of the
  128. Yocto Project &DISTRO; release.
  129. </para>
  130. <para>
  131. For more options and information about accessing Yocto
  132. Project related repositories, see the
  133. "<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-yocto-project-source-files'>Working With Yocto Project Source Files</ulink>"
  134. section in the Yocto Project Development Tasks Manual.
  135. </para>
  136. </section>
  137. <section id='brief-building-your-image'>
  138. <title>Building Your Image</title>
  139. <para>
  140. Use the following steps to build your image.
  141. The OpenEmbedded build system creates an entire Linux
  142. distribution, including the toolchain, from source.
  143. <note>
  144. <itemizedlist>
  145. <listitem><para>
  146. If you are working behind a firewall and your build
  147. host is not set up for proxies, you could encounter
  148. problems with the build process when fetching source
  149. code (e.g. fetcher failures or Git failures).
  150. </para></listitem>
  151. <listitem><para>
  152. If you do not know your proxy settings, consult your
  153. local network infrastructure resources and get that
  154. information.
  155. A good starting point could also be to check your
  156. web browser settings.
  157. Finally, you can find more information on the
  158. "<ulink url='https://wiki.yoctoproject.org/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>"
  159. page of the Yocto Project Wiki.
  160. </para></listitem>
  161. </itemizedlist>
  162. </note>
  163. </para>
  164. <para>
  165. <orderedlist>
  166. <listitem><para>
  167. <emphasis>Initialize the Build Environment:</emphasis>
  168. Run the
  169. <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
  170. environment setup script to define the OpenEmbedded
  171. build environment on your build host.
  172. <literallayout class='monospaced'>
  173. $ source &OE_INIT_FILE;
  174. </literallayout>
  175. Among other things, the script creates the
  176. <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
  177. which is <filename>build</filename> in this case
  178. and is located in the
  179. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
  180. After the script runs, your current working directory
  181. is set to the Build Directory.
  182. Later, when the build completes, the Build Directory
  183. contains all the files created during the build.
  184. </para></listitem>
  185. <listitem><para>
  186. <emphasis>Examine Your Local Configuration File:</emphasis>
  187. When you set up the build environment, a local
  188. configuration file named
  189. <filename>local.conf</filename> becomes available in
  190. a <filename>conf</filename> subdirectory of the
  191. Build Directory.
  192. For this example, the defaults are set to build
  193. for a <filename>qemux86</filename> target, which is
  194. suitable for emulation.
  195. The package manager used is set to the RPM package
  196. manager.
  197. <tip>
  198. You can significantly speed up your build and guard
  199. against fetcher failures by using mirrors.
  200. To use mirrors, add these lines to your
  201. <filename>local.conf</filename> file in the Build
  202. directory:
  203. <literallayout class='monospaced'>
  204. SSTATE_MIRRORS = "\
  205. file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \
  206. file://.* http://sstate.yoctoproject.org/&YOCTO_DOC_VERSION_MINUS_ONE;/PATH;downloadfilename=PATH \n \
  207. file://.* http://sstate.yoctoproject.org/&YOCTO_DOC_VERSION;/PATH;downloadfilename=PATH \n \
  208. "
  209. </literallayout>
  210. The previous examples showed how to add sstate
  211. paths for Yocto Project &YOCTO_DOC_VERSION_MINUS_ONE;,
  212. &YOCTO_DOC_VERSION;, and a development area.
  213. For a complete index of sstate locations, see
  214. <ulink url='http://sstate.yoctoproject.org/'></ulink>.
  215. </tip>
  216. </para></listitem>
  217. <listitem><para>
  218. <emphasis>Start the Build:</emphasis>
  219. Continue with the following command to build an OS image
  220. for the target, which is
  221. <filename>core-image-sato</filename> in this example:
  222. <literallayout class='monospaced'>
  223. $ bitbake core-image-sato
  224. </literallayout>
  225. For information on using the
  226. <filename>bitbake</filename> command, see the
  227. "<ulink url='&YOCTO_DOCS_OM_URL;#usingpoky-components-bitbake'>BitBake</ulink>"
  228. section in the Yocto Project Overview and Concepts Manual,
  229. or see the
  230. "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-command'>BitBake Command</ulink>"
  231. section in the BitBake User Manual.
  232. </para></listitem>
  233. <listitem><para>
  234. <emphasis>Simulate Your Image Using QEMU:</emphasis>
  235. Once this particular image is built, you can start
  236. QEMU, which is a Quick EMUlator that ships with
  237. the Yocto Project:
  238. <literallayout class='monospaced'>
  239. $ runqemu qemux86
  240. </literallayout>
  241. If you want to learn more about running QEMU, see the
  242. "<ulink url="&YOCTO_DOCS_DEV_URL;#dev-manual-qemu">Using the Quick EMUlator (QEMU)</ulink>"
  243. chapter in the Yocto Project Development Tasks Manual.
  244. </para></listitem>
  245. <listitem><para>
  246. <emphasis>Exit QEMU:</emphasis>
  247. Exit QEMU by either clicking on the shutdown icon or by
  248. typing <filename>Ctrl-C</filename> in the QEMU
  249. transcript window from which you evoked QEMU.
  250. </para></listitem>
  251. </orderedlist>
  252. </para>
  253. </section>
  254. <section id='brief-where-to-go-next'>
  255. <title>Where To Go Next</title>
  256. <para>
  257. Now that you have experienced using the Yocto Project, you might
  258. be asking yourself "What now?"
  259. The Yocto Project has many sources of information including
  260. the website, wiki pages, and user manuals:
  261. <itemizedlist>
  262. <listitem><para>
  263. <emphasis>Website:</emphasis>
  264. The
  265. <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
  266. provides background information, the latest builds,
  267. breaking news, full development documentation, and
  268. access to a rich Yocto Project Development Community
  269. into which you can tap.
  270. </para></listitem>
  271. <listitem><para>
  272. <emphasis>Developer Screencast:</emphasis>
  273. The
  274. <ulink url='http://vimeo.com/36450321'>Getting Started with the Yocto Project - New Developer Screencast Tutorial</ulink>
  275. provides a 30-minute video created for users unfamiliar
  276. with the Yocto Project but familiar with Linux build
  277. hosts.
  278. While this screencast is somewhat dated, the
  279. introductory and fundamental concepts are useful for
  280. the beginner.
  281. </para></listitem>
  282. <listitem><para>
  283. <emphasis>Yocto Project Overview and Concepts Manual:</emphasis>
  284. The
  285. <ulink url='&YOCTO_DOCS_OM_URL;'>Yocto Project Overview and Concepts Manual</ulink>
  286. is a great place to start to learn about the
  287. Yocto Project.
  288. This manual introduces you to the Yocto Project and its
  289. development environment.
  290. The manual also provides conceptual information for
  291. various aspects of the Yocto Project.
  292. </para></listitem>
  293. <listitem><para>
  294. <emphasis>Yocto Project Wiki:</emphasis>
  295. The
  296. <ulink url='&YOCTO_WIKI_URL;'>Yocto Project Wiki</ulink>
  297. provides additional information on where to go next
  298. when ramping up with the Yocto Project, release
  299. information, project planning, and QA information.
  300. </para></listitem>
  301. <listitem><para>
  302. <emphasis>Yocto Project Mailing Lists:</emphasis>
  303. Related mailing lists provide a forum for discussion,
  304. patch submission and announcements.
  305. Several mailing lists exist and are grouped according
  306. to areas of concern.
  307. See the
  308. "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing lists</ulink>"
  309. section in the Yocto Project Reference Manual for a
  310. complete list of Yocto Project mailing lists.
  311. </para></listitem>
  312. <listitem><para>
  313. <emphasis>Comprehensive List of Links and Other Documentation:</emphasis>
  314. The
  315. "<ulink url='&YOCTO_DOCS_REF_URL;#resources-links-and-related-documentation'>Links and Related Documentation</ulink>"
  316. section in the Yocto Project Reference Manual provides a
  317. comprehensive list of all related links and other
  318. user documentation.
  319. </para></listitem>
  320. </itemizedlist>
  321. </para>
  322. </section>
  323. </article>
  324. <!--
  325. vim: expandtab tw=80 ts=4
  326. -->