introduction.xml 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075
  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='ref-manual-intro'>
  5. <title>Introduction</title>
  6. <section id='ref-welcome'>
  7. <title>Welcome</title>
  8. <para>
  9. Welcome to the Yocto Project Reference Manual.
  10. This manual provides reference information for the current release
  11. of the Yocto Project.
  12. This manual is best used after you have an understanding
  13. of the basics of the Yocto Project.
  14. The manual is neither meant to be read as a starting point to the
  15. Yocto Project nor read from start to finish.
  16. Use this manual to find concepts, variable definitions, class
  17. descriptions, and so forth as needed during the course of using
  18. the Yocto Project.
  19. </para>
  20. <para>
  21. For introductory information on the Yocto Project, see the
  22. <ulink url='&YOCTO_HOME_URL;/ecosystem/yocto-project-backgrounders'>Yocto Project Backgrounders</ulink>
  23. on the
  24. <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> and the
  25. "<link linkend='yp-intro'>Introducing the Yocto Project Development Environment</link>"
  26. section.
  27. </para>
  28. <para>
  29. If you want to use the Yocto Project to test run building an image
  30. without having to understand concepts, work through the
  31. <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>.
  32. You can find "how-to" information in the
  33. <ulink url='&YOCTO_DOCS_DEV_URL;'>Yocto Project Development Manual</ulink>.
  34. <note><title>Tip</title>
  35. For more information about the Yocto Project Documentation set,
  36. see the
  37. "<link linkend='resources-links-and-related-documentation'>Links and Related Documentation</link>"
  38. section.
  39. </note>
  40. </para>
  41. </section>
  42. <section id='yp-intro'>
  43. <title>Introducing the Yocto Project Development Environment</title>
  44. <para>
  45. The Yocto Project is an open-source collaboration project whose
  46. focus is for developers of embedded Linux systems.
  47. Among other things, the Yocto Project uses an
  48. <link linkend='build-system-term'>OpenEmbedded build system</link>.
  49. The build system, which is based on the OpenEmbedded (OE) project and
  50. uses the
  51. <link linkend='bitbake-term'>BitBake</link> tool, constructs complete
  52. Linux images for architectures based on ARM, MIPS, PowerPC, x86 and
  53. x86-64.
  54. <note>
  55. Historically, the OpenEmbedded build system, which is the
  56. combination of BitBake and OE components, formed a reference
  57. build host that was known as
  58. "<link linkend='poky'>Poky</link>" (<emphasis>Pah</emphasis>-kee).
  59. The term "Poky", as used throughout the Yocto Project Documentation
  60. set, can have different meanings.
  61. </note>
  62. The Yocto Project provides various ancillary tools for the embedded
  63. developer and also features the Sato reference User Interface, which
  64. is optimized for stylus-driven, low-resolution screens.
  65. </para>
  66. <mediaobject>
  67. <imageobject>
  68. <imagedata fileref="figures/YP-flow-diagram.png"
  69. format="PNG" align='center' width="8in"/>
  70. </imageobject>
  71. </mediaobject>
  72. <para>
  73. Here are some highlights for the Yocto Project:
  74. </para>
  75. <itemizedlist>
  76. <listitem><para>
  77. Provides a recent Linux kernel along with a set of system
  78. commands and libraries suitable for the embedded
  79. environment.
  80. </para></listitem>
  81. <listitem><para>
  82. Makes available system components such as X11, GTK+, Qt,
  83. Clutter, and SDL (among others) so you can create a rich user
  84. experience on devices that have display hardware.
  85. For devices that do not have a display or where you wish to
  86. use alternative UI frameworks, these components need not be
  87. installed.
  88. </para></listitem>
  89. <listitem><para>
  90. Creates a focused and stable core compatible with the
  91. OpenEmbedded project with which you can easily and reliably
  92. build and develop.
  93. </para></listitem>
  94. <listitem><para>
  95. Fully supports a wide range of hardware and device emulation
  96. through the Quick EMUlator (QEMU).
  97. </para></listitem>
  98. <listitem><para>
  99. Provides a layer mechanism that allows you to easily extend
  100. the system, make customizations, and keep them organized.
  101. </para></listitem>
  102. </itemizedlist>
  103. <para>
  104. You can use the Yocto Project to generate images for many kinds
  105. of devices.
  106. As mentioned earlier, the Yocto Project supports creation of
  107. reference images that you can boot within and emulate using QEMU.
  108. The standard example machines target QEMU full-system
  109. emulation for 32-bit and 64-bit variants of x86, ARM, MIPS, and
  110. PowerPC architectures.
  111. Beyond emulation, you can use the layer mechanism to extend
  112. support to just about any platform that Linux can run on and that
  113. a toolchain can target.
  114. </para>
  115. <para>
  116. Another Yocto Project feature is the Sato reference User
  117. Interface.
  118. This optional UI that is based on GTK+ is intended for devices with
  119. restricted screen sizes and is included as part of the
  120. OpenEmbedded Core layer so that developers can test parts of the
  121. software stack.
  122. </para>
  123. <para>
  124. While the Yocto Project does not provide a strict testing framework,
  125. it does provide or generate for you artifacts that let you perform
  126. target-level and emulated testing and debugging.
  127. Additionally, if you are an
  128. <trademark class='trade'>Eclipse</trademark> IDE user, you can
  129. install an Eclipse Yocto Plug-in to allow you to develop within that
  130. familiar environment.
  131. </para>
  132. <para>
  133. By default, using the Yocto Project to build an image creates a Poky
  134. distribution.
  135. However, you can create your own distribution by providing key
  136. <link link='metadata'>Metadata</link>.
  137. A good example is Angstrom, which has had a distribution
  138. based on the Yocto Project since its inception.
  139. Other examples include commercial distributions like
  140. <ulink url='https://www.yoctoproject.org/organization/wind-river-systems'>Wind River Linux</ulink>,
  141. <ulink url='https://www.yoctoproject.org/organization/mentor-graphics'>Mentor Embedded Linux</ulink>,
  142. <ulink url='https://www.yoctoproject.org/organization/enea-ab'>ENEA Linux</ulink>
  143. and <ulink url='https://www.yoctoproject.org/ecosystem/member-organizations'>others</ulink>.
  144. See the "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-your-own-distribution'>Creating Your Own Distribution</ulink>"
  145. section in the Yocto Project Development Manual for more information.
  146. </para>
  147. </section>
  148. <section id='intro-requirements'>
  149. <title>System Requirements</title>
  150. <para>
  151. For general Yocto Project system requirements, see the
  152. "<ulink url='&YOCTO_DOCS_QS_URL;#yp-resources'>Setting Up to Use the Yocto Project</ulink>" section
  153. in the Yocto Project Quick Start.
  154. The remainder of this section provides details on system requirements
  155. not covered in the Yocto Project Quick Start.
  156. </para>
  157. <section id='detailed-supported-distros'>
  158. <title>Supported Linux Distributions</title>
  159. <para>
  160. Currently, the Yocto Project is supported on the following
  161. distributions:
  162. <note>
  163. <para>
  164. Yocto Project releases are tested against the stable Linux
  165. distributions in the following list.
  166. The Yocto Project should work on other distributions but
  167. validation is not performed against them.
  168. </para>
  169. <para>
  170. In particular, the Yocto Project does not support
  171. and currently has no plans to support
  172. rolling-releases or development distributions due to their
  173. constantly changing nature.
  174. We welcome patches and bug reports, but keep in mind that
  175. our priority is on the supported platforms listed below.
  176. </para>
  177. <para>
  178. If you encounter problems, please go to
  179. <ulink url='&YOCTO_BUGZILLA_URL;'>Yocto Project Bugzilla</ulink>
  180. and submit a bug.
  181. We are interested in hearing about your experience.
  182. </para>
  183. </note>
  184. <itemizedlist>
  185. <!--
  186. <listitem><para>Ubuntu 10.04</para></listitem>
  187. <listitem><para>Ubuntu 11.10</para></listitem>
  188. <listitem><para>Ubuntu 12.04 (LTS)</para></listitem>
  189. <listitem><para>Ubuntu 13.10</para></listitem> -->
  190. <listitem><para>Ubuntu 14.04 (LTS)</para></listitem>
  191. <listitem><para>Ubuntu 14.10</para></listitem>
  192. <listitem><para>Ubuntu 15.04</para></listitem>
  193. <listitem><para>Ubuntu 15.10</para></listitem>
  194. <listitem><para>Ubuntu 16.04</para></listitem>
  195. <!-- <listitem><para>Fedora 16 (Verne)</para></listitem>
  196. <listitem><para>Fedora 17 (Spherical)</para></listitem>
  197. <listitem><para>Fedora release 19 (Schrödinger's Cat)</para></listitem>
  198. <listitem><para>Fedora release 20 (Heisenbug)</para></listitem> -->
  199. <listitem><para>Fedora release 22</para></listitem>
  200. <listitem><para>Fedora release 23</para></listitem>
  201. <listitem><para>Fedora release 24</para></listitem>
  202. <!-- <listitem><para>CentOS release 5.6 (Final)</para></listitem>
  203. <listitem><para>CentOS release 5.7 (Final)</para></listitem>
  204. <listitem><para>CentOS release 5.8 (Final)</para></listitem>
  205. <listitem><para>CentOS release 6.3 (Final)</para></listitem>
  206. <listitem><para>CentOS release 6.x</para></listitem> -->
  207. <listitem><para>CentOS release 7.x</para></listitem>
  208. <!-- <listitem><para>Debian GNU/Linux 6.0 (Squeeze)</para></listitem>
  209. <listitem><para>Debian GNU/Linux 7.x (Wheezy)</para></listitem> -->
  210. <listitem><para>Debian GNU/Linux 8.x (Jessie)</para></listitem>
  211. <!-- <listitem><para>Debian GNU/Linux 7.1 (Wheezy)</para></listitem>
  212. <listitem><para>Debian GNU/Linux 7.2 (Wheezy)</para></listitem>
  213. <listitem><para>Debian GNU/Linux 7.3 (Wheezy)</para></listitem>
  214. <listitem><para>Debian GNU/Linux 7.4 (Wheezy)</para></listitem>
  215. <listitem><para>Debian GNU/Linux 7.5 (Wheezy)</para></listitem>
  216. <listitem><para>Debian GNU/Linux 7.6 (Wheezy)</para></listitem> -->
  217. <!-- <listitem><para>openSUSE 11.4</para></listitem>
  218. <listitem><para>openSUSE 12.1</para></listitem>
  219. <listitem><para>openSUSE 12.2</para></listitem>
  220. <listitem><para>openSUSE 12.3</para></listitem>
  221. <listitem><para>openSUSE 13.1</para></listitem> -->
  222. <listitem><para>openSUSE 13.2</para></listitem>
  223. <listitem><para>openSUSE 42.1</para></listitem>
  224. </itemizedlist>
  225. </para>
  226. <note>
  227. While the Yocto Project Team attempts to ensure all Yocto Project
  228. releases are one hundred percent compatible with each officially
  229. supported Linux distribution, instances might exist where you
  230. encounter a problem while using the Yocto Project on a specific
  231. distribution.
  232. </note>
  233. </section>
  234. <section id='required-packages-for-the-host-development-system'>
  235. <title>Required Packages for the Host Development System</title>
  236. <para>
  237. The list of packages you need on the host development system can
  238. be large when covering all build scenarios using the Yocto Project.
  239. This section provides required packages according to
  240. Linux distribution and function.
  241. </para>
  242. <section id='ubuntu-packages'>
  243. <title>Ubuntu and Debian</title>
  244. <para>
  245. The following list shows the required packages by function
  246. given a supported Ubuntu or Debian Linux distribution:
  247. <note>
  248. If your build system has the
  249. <filename>oss4-dev</filename> package installed, you
  250. might experience QEMU build failures due to the package
  251. installing its own custom
  252. <filename>/usr/include/linux/soundcard.h</filename> on
  253. the Debian system.
  254. If you run into this situation, either of the following
  255. solutions exist:
  256. <literallayout class='monospaced'>
  257. $ sudo apt-get build-dep qemu
  258. $ sudo apt-get remove oss4-dev
  259. </literallayout>
  260. </note>
  261. <itemizedlist>
  262. <listitem><para><emphasis>Essentials:</emphasis>
  263. Packages needed to build an image on a headless
  264. system:
  265. <literallayout class='monospaced'>
  266. $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL;
  267. </literallayout></para></listitem>
  268. <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
  269. Packages recommended if the host system has graphics
  270. support or if you are going to use the Eclipse
  271. IDE:
  272. <literallayout class='monospaced'>
  273. $ sudo apt-get install libsdl1.2-dev xterm
  274. </literallayout></para></listitem>
  275. <listitem><para><emphasis>Documentation:</emphasis>
  276. Packages needed if you are going to build out the
  277. Yocto Project documentation manuals:
  278. <literallayout class='monospaced'>
  279. $ sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto
  280. </literallayout></para></listitem>
  281. <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
  282. Packages needed if you are going to run
  283. <filename>oe-selftest</filename>:
  284. <literallayout class='monospaced'>
  285. $ sudo apt-get install python-git
  286. </literallayout>
  287. </para></listitem>
  288. </itemizedlist>
  289. </para>
  290. </section>
  291. <section id='fedora-packages'>
  292. <title>Fedora Packages</title>
  293. <para>
  294. The following list shows the required packages by function
  295. given a supported Fedora Linux distribution:
  296. <itemizedlist>
  297. <listitem><para><emphasis>Essentials:</emphasis>
  298. Packages needed to build an image for a headless
  299. system:
  300. <literallayout class='monospaced'>
  301. $ sudo dnf install &FEDORA_HOST_PACKAGES_ESSENTIAL;
  302. </literallayout></para></listitem>
  303. <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
  304. Packages recommended if the host system has graphics
  305. support or if you are going to use the Eclipse
  306. IDE:
  307. <literallayout class='monospaced'>
  308. $ sudo dnf install SDL-devel xterm
  309. </literallayout></para></listitem>
  310. <listitem><para><emphasis>Documentation:</emphasis>
  311. Packages needed if you are going to build out the
  312. Yocto Project documentation manuals:
  313. <literallayout class='monospaced'>
  314. $ sudo dnf install make docbook-style-dsssl docbook-style-xsl \
  315. docbook-dtds docbook-utils fop libxslt dblatex xmlto xsltproc
  316. </literallayout></para></listitem>
  317. <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
  318. Packages needed if you are going to run
  319. <filename>oe-selftest</filename>:
  320. <literallayout class='monospaced'>
  321. $ sudo dnf install python3-GitPython
  322. </literallayout>
  323. </para></listitem>
  324. </itemizedlist>
  325. </para>
  326. </section>
  327. <section id='opensuse-packages'>
  328. <title>openSUSE Packages</title>
  329. <para>
  330. The following list shows the required packages by function
  331. given a supported openSUSE Linux distribution:
  332. <itemizedlist>
  333. <listitem><para><emphasis>Essentials:</emphasis>
  334. Packages needed to build an image for a headless
  335. system:
  336. <literallayout class='monospaced'>
  337. $ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL;
  338. </literallayout></para></listitem>
  339. <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
  340. Packages recommended if the host system has graphics
  341. support or if you are going to use the Eclipse
  342. IDE:
  343. <literallayout class='monospaced'>
  344. $ sudo zypper install libSDL-devel xterm
  345. </literallayout></para></listitem>
  346. <listitem><para><emphasis>Documentation:</emphasis>
  347. Packages needed if you are going to build out the
  348. Yocto Project documentation manuals:
  349. <literallayout class='monospaced'>
  350. $ sudo zypper install make fop xsltproc dblatex xmlto
  351. </literallayout></para></listitem>
  352. <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
  353. Packages needed if you are going to run
  354. <filename>oe-selftest</filename>:
  355. <literallayout class='monospaced'>
  356. $ sudo zypper install python-GitPython
  357. </literallayout></para></listitem>
  358. </itemizedlist>
  359. </para>
  360. </section>
  361. <section id='centos-packages'>
  362. <title>CentOS Packages</title>
  363. <para>
  364. The following list shows the required packages by function
  365. given a supported CentOS Linux distribution:
  366. <note>
  367. For CentOS 6.x, some of the versions of the components
  368. provided by the distribution are too old (e.g. Git, Python,
  369. and tar).
  370. It is recommended that you install the buildtools in order
  371. to provide versions that will work with the OpenEmbedded
  372. build system.
  373. For information on how to install the buildtools tarball,
  374. see the
  375. "<link linkend='required-git-tar-and-python-versions'>Required Git, Tar, and Python Versions</link>"
  376. section.
  377. </note>
  378. <itemizedlist>
  379. <listitem><para><emphasis>Essentials:</emphasis>
  380. Packages needed to build an image for a headless
  381. system:
  382. <literallayout class='monospaced'>
  383. $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
  384. </literallayout>
  385. <note><title>Notes</title>
  386. <itemizedlist>
  387. <listitem><para>
  388. Extra Packages for Enterprise Linux
  389. (i.e. <filename>epel-release</filename>)
  390. is a collection of packages from Fedora
  391. built on RHEL/CentOS for easy installation
  392. of packages not included in enterprise
  393. Linux by default.
  394. You need to install these packages
  395. separately.
  396. </para></listitem>
  397. <listitem><para>
  398. The <filename>makecache</filename> command
  399. consumes additional Metadata from
  400. <filename>epel-release</filename>.
  401. </para></listitem>
  402. </itemizedlist>
  403. </note>
  404. </para></listitem>
  405. <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
  406. Packages recommended if the host system has graphics
  407. support or if you are going to use the Eclipse
  408. IDE:
  409. <literallayout class='monospaced'>
  410. $ sudo yum install SDL-devel xterm
  411. </literallayout></para></listitem>
  412. <listitem><para><emphasis>Documentation:</emphasis>
  413. Packages needed if you are going to build out the
  414. Yocto Project documentation manuals:
  415. <literallayout class='monospaced'>
  416. $ sudo yum install make docbook-style-dsssl docbook-style-xsl \
  417. docbook-dtds docbook-utils fop libxslt dblatex xmlto xsltproc
  418. </literallayout></para></listitem>
  419. <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
  420. Packages needed if you are going to run
  421. <filename>oe-selftest</filename>:
  422. <literallayout class='monospaced'>
  423. $ sudo yum install GitPython
  424. </literallayout>
  425. </para></listitem>
  426. </itemizedlist>
  427. </para>
  428. </section>
  429. </section>
  430. <section id='required-git-tar-and-python-versions'>
  431. <title>Required Git, tar, and Python Versions</title>
  432. <para>
  433. In order to use the build system, your host development system
  434. must meet the following version requirements for Git, tar, and
  435. Python:
  436. <itemizedlist>
  437. <listitem><para>Git 1.8.3.1 or greater</para></listitem>
  438. <listitem><para>tar 1.27 or greater</para></listitem>
  439. <listitem><para>Python 3.4.0 or greater</para></listitem>
  440. </itemizedlist>
  441. </para>
  442. <para>
  443. If your host development system does not meet all these requirements,
  444. you can resolve this by installing a <filename>buildtools</filename>
  445. tarball that contains these tools.
  446. You can get the tarball one of two ways: download a pre-built
  447. tarball or use BitBake to build the tarball.
  448. </para>
  449. <section id='downloading-a-pre-built-buildtools-tarball'>
  450. <title>Downloading a Pre-Built <filename>buildtools</filename> Tarball</title>
  451. <para>
  452. Downloading and running a pre-built buildtools installer is
  453. the easiest of the two methods by which you can get these tools:
  454. <orderedlist>
  455. <listitem><para>
  456. Locate and download the <filename>*.sh</filename> at
  457. <ulink url='&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;/buildtools/'></ulink>.
  458. </para></listitem>
  459. <listitem><para>
  460. Execute the installation script.
  461. Here is an example:
  462. <literallayout class='monospaced'>
  463. $ sh poky-glibc-x86_64-buildtools-tarball-x86_64-buildtools-nativesdk-standalone-&DISTRO;.sh
  464. </literallayout>
  465. During execution, a prompt appears that allows you to
  466. choose the installation directory.
  467. For example, you could choose the following:
  468. <literallayout class='monospaced'>
  469. /home/<replaceable>your-username</replaceable>/buildtools
  470. </literallayout>
  471. </para></listitem>
  472. <listitem><para>
  473. Source the tools environment setup script by using a
  474. command like the following:
  475. <literallayout class='monospaced'>
  476. $ source /home/<replaceable>your_username</replaceable>/buildtools/environment-setup-i586-poky-linux
  477. </literallayout>
  478. Of course, you need to supply your installation directory and be
  479. sure to use the right file (i.e. i585 or x86-64).
  480. </para>
  481. <para>
  482. After you have sourced the setup script,
  483. the tools are added to <filename>PATH</filename>
  484. and any other environment variables required to run the
  485. tools are initialized.
  486. The results are working versions versions of Git, tar,
  487. Python and <filename>chrpath</filename>.
  488. </para></listitem>
  489. </orderedlist>
  490. </para>
  491. </section>
  492. <section id='building-your-own-buildtools-tarball'>
  493. <title>Building Your Own <filename>buildtools</filename> Tarball</title>
  494. <para>
  495. Building and running your own buildtools installer applies
  496. only when you have a build host that can already run BitBake.
  497. In this case, you use that machine to build the
  498. <filename>.sh</filename> file and then
  499. take steps to transfer and run it on a
  500. machine that does not meet the minimal Git, tar, and Python
  501. requirements.
  502. </para>
  503. <para>
  504. Here are the steps to take to build and run your own
  505. buildtools installer:
  506. <orderedlist>
  507. <listitem><para>
  508. On the machine that is able to run BitBake,
  509. be sure you have set up your build environment with
  510. the setup script
  511. (<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
  512. or
  513. <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
  514. </para></listitem>
  515. <listitem><para>
  516. Run the BitBake command to build the tarball:
  517. <literallayout class='monospaced'>
  518. $ bitbake buildtools-tarball
  519. </literallayout>
  520. <note>
  521. The
  522. <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>
  523. variable in your <filename>local.conf</filename> file
  524. determines whether you build tools for a 32-bit
  525. or 64-bit system.
  526. </note>
  527. Once the build completes, you can find the
  528. <filename>.sh</filename> file that installs
  529. the tools in the <filename>tmp/deploy/sdk</filename>
  530. subdirectory of the
  531. <link linkend='build-directory'>Build Directory</link>.
  532. The installer file has the string "buildtools"
  533. in the name.
  534. </para></listitem>
  535. <listitem><para>
  536. Transfer the <filename>.sh</filename> file from the
  537. build host to the machine that does not meet the
  538. Git, tar, or Python requirements.
  539. </para></listitem>
  540. <listitem><para>
  541. On the machine that does not meet the requirements,
  542. run the <filename>.sh</filename> file
  543. to install the tools.
  544. Here is an example:
  545. <literallayout class='monospaced'>
  546. $ sh poky-glibc-x86_64-buildtools-tarball-x86_64-buildtools-nativesdk-standalone-&DISTRO;.sh
  547. </literallayout>
  548. During execution, a prompt appears that allows you to
  549. choose the installation directory.
  550. For example, you could choose the following:
  551. <literallayout class='monospaced'>
  552. /home/<replaceable>your_username</replaceable>/buildtools
  553. </literallayout>
  554. </para></listitem>
  555. <listitem><para>
  556. Source the tools environment setup script by using a
  557. command like the following:
  558. <literallayout class='monospaced'>
  559. $ source /home/<replaceable>your_username</replaceable>/buildtools/environment-setup-i586-poky-linux
  560. </literallayout>
  561. Of course, you need to supply your installation directory and be
  562. sure to use the right file (i.e. i585 or x86-64).
  563. </para>
  564. <para>
  565. After you have sourced the setup script,
  566. the tools are added to <filename>PATH</filename>
  567. and any other environment variables required to run the
  568. tools are initialized.
  569. The results are working versions versions of Git, tar,
  570. Python and <filename>chrpath</filename>.
  571. </para></listitem>
  572. </orderedlist>
  573. </para>
  574. </section>
  575. </section>
  576. </section>
  577. <section id='intro-getit'>
  578. <title>Obtaining the Yocto Project</title>
  579. <para>
  580. The Yocto Project development team makes the Yocto Project available through a number
  581. of methods:
  582. <itemizedlist>
  583. <listitem><para><emphasis>Source Repositories:</emphasis>
  584. Working from a copy of the upstream
  585. <filename>poky</filename> repository is the
  586. preferred method for obtaining and using a Yocto Project
  587. release.
  588. You can view the Yocto Project Source Repositories at
  589. <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.
  590. In particular, you can find the
  591. <filename>poky</filename> repository at
  592. <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/'></ulink>.
  593. </para></listitem>
  594. <listitem><para><emphasis>Releases:</emphasis> Stable, tested
  595. releases are available as tarballs through
  596. <ulink url='&YOCTO_DL_URL;/releases/yocto/'/>.</para></listitem>
  597. <listitem><para><emphasis>Nightly Builds:</emphasis> These
  598. tarball releases are available at
  599. <ulink url='&YOCTO_AB_NIGHTLY_URL;'/>.
  600. These builds include Yocto Project releases, SDK installation
  601. scripts, and experimental builds.
  602. </para></listitem>
  603. <listitem><para><emphasis>Yocto Project Website:</emphasis> You can
  604. find tarball releases of the Yocto Project and supported BSPs
  605. at the
  606. <ulink url='&YOCTO_HOME_URL;'>Yocto Project website</ulink>.
  607. Along with these downloads, you can find lots of other
  608. information at this site.
  609. </para></listitem>
  610. </itemizedlist>
  611. </para>
  612. </section>
  613. <section id='intro-getit-dev'>
  614. <title>Development Checkouts</title>
  615. <para>
  616. Development using the Yocto Project requires a local
  617. <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
  618. You can set up the Source Directory by cloning a copy of the upstream
  619. <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>poky</ulink> Git repository.
  620. For information on how to do this, see the
  621. "<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-yocto-project-source-files'>Working With Yocto Project Source Files</ulink>"
  622. section in the Yocto Project Development Manual.
  623. </para>
  624. </section>
  625. <section id='yocto-project-terms'>
  626. <title>Yocto Project Terms</title>
  627. <para>
  628. Following is a list of terms and definitions users new to the Yocto
  629. Project development environment might find helpful.
  630. While some of these terms are universal, the list includes them
  631. just in case:
  632. <itemizedlist>
  633. <listitem><para>
  634. <emphasis>Append Files:</emphasis>
  635. Files that append build information to a recipe file.
  636. Append files are known as BitBake append files and
  637. <filename>.bbappend</filename> files.
  638. The OpenEmbedded build system expects every append file to have
  639. a corresponding recipe (<filename>.bb</filename>) file.
  640. Furthermore, the append file and corresponding recipe file
  641. must use the same root filename.
  642. The filenames can differ only in the file type suffix used
  643. (e.g.
  644. <filename>formfactor_0.0.bb</filename> and
  645. <filename>formfactor_0.0.bbappend</filename>).</para>
  646. <para>Information in append files extends or overrides the
  647. information in the similarly-named recipe file.
  648. For an example of an append file in use, see the
  649. "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files</ulink>"
  650. section in the Yocto Project Development Manual.
  651. <note>
  652. Append files can also use wildcard patterns in their
  653. version numbers so they can be applied to more than one
  654. version of the underlying recipe file.
  655. </note>
  656. </para></listitem>
  657. <listitem><para id='bitbake-term'>
  658. <emphasis>BitBake:</emphasis>
  659. The task executor and scheduler used by the OpenEmbedded build
  660. system to build images.
  661. For more information on BitBake, see the
  662. <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
  663. </para></listitem>
  664. <listitem>
  665. <para id='build-directory'>
  666. <emphasis>Build Directory:</emphasis>
  667. This term refers to the area used by the OpenEmbedded build
  668. system for builds.
  669. The area is created when you <filename>source</filename> the
  670. setup environment script that is found in the Source Directory
  671. (i.e. <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
  672. or
  673. <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
  674. The
  675. <link linkend='var-TOPDIR'><filename>TOPDIR</filename></link>
  676. variable points to the Build Directory.</para>
  677. <para>You have a lot of flexibility when creating the Build
  678. Directory.
  679. Following are some examples that show how to create the
  680. directory.
  681. The examples assume your
  682. <link linkend='source-directory'>Source Directory</link> is
  683. named <filename>poky</filename>:
  684. <itemizedlist>
  685. <listitem><para>Create the Build Directory inside your
  686. Source Directory and let the name of the Build
  687. Directory default to <filename>build</filename>:
  688. <literallayout class='monospaced'>
  689. $ cd $HOME/poky
  690. $ source &OE_INIT_FILE;
  691. </literallayout>
  692. </para></listitem>
  693. <listitem><para>Create the Build Directory inside your
  694. home directory and specifically name it
  695. <filename>test-builds</filename>:
  696. <literallayout class='monospaced'>
  697. $ cd $HOME
  698. $ source poky/&OE_INIT_FILE; test-builds
  699. </literallayout>
  700. </para></listitem>
  701. <listitem><para>
  702. Provide a directory path and specifically name the
  703. Build Directory.
  704. Any intermediate folders in the pathname must exist.
  705. This next example creates a Build Directory named
  706. <filename>YP-&POKYVERSION;</filename>
  707. in your home directory within the existing
  708. directory <filename>mybuilds</filename>:
  709. <literallayout class='monospaced'>
  710. $cd $HOME
  711. $ source $HOME/poky/&OE_INIT_FILE; $HOME/mybuilds/YP-&POKYVERSION;
  712. </literallayout>
  713. </para></listitem>
  714. </itemizedlist>
  715. <note>
  716. By default, the Build Directory contains
  717. <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>,
  718. which is a temporary directory the build system uses for
  719. its work.
  720. <filename>TMPDIR</filename> cannot be under NFS.
  721. Thus, by default, the Build Directory cannot be under NFS.
  722. However, if you need the Build Directory to be under NFS,
  723. you can set this up by setting <filename>TMPDIR</filename>
  724. in your <filename>local.conf</filename> file
  725. to use a local drive.
  726. Doing so effectively separates <filename>TMPDIR</filename>
  727. from <filename>TOPDIR</filename>, which is the Build
  728. Directory.
  729. </note>
  730. </para></listitem>
  731. <listitem><para>
  732. <emphasis>Classes:</emphasis>
  733. Files that provide for logic encapsulation and inheritance so
  734. that commonly used patterns can be defined once and then
  735. easily used in multiple recipes.
  736. For reference information on the Yocto Project classes, see the
  737. "<link linkend='ref-classes'>Classes</link>" chapter.
  738. Class files end with the <filename>.bbclass</filename>
  739. filename extension.
  740. </para></listitem>
  741. <listitem><para>
  742. <emphasis>Configuration File:</emphasis>
  743. Configuration information in various <filename>.conf</filename>
  744. files provides global definitions of variables.
  745. The <filename>conf/local.conf</filename> configuration file in
  746. the
  747. <link linkend='build-directory'>Build Directory</link>
  748. contains user-defined variables that affect every build.
  749. The <filename>meta-poky/conf/distro/poky.conf</filename>
  750. configuration file defines Yocto "distro" configuration
  751. variables used only when building with this policy.
  752. Machine configuration files, which
  753. are located throughout the
  754. <link linkend='source-directory'>Source Directory</link>, define
  755. variables for specific hardware and are only used when building
  756. for that target (e.g. the
  757. <filename>machine/beaglebone.conf</filename> configuration
  758. file defines variables for the Texas Instruments ARM Cortex-A8
  759. development board).
  760. Configuration files end with a <filename>.conf</filename>
  761. filename extension.
  762. </para></listitem>
  763. <listitem><para id='cross-development-toolchain'>
  764. <emphasis>Cross-Development Toolchain:</emphasis>
  765. In general, a cross-development toolchain is a collection of
  766. software development tools and utilities that run on one
  767. architecture and allow you to develop software for a
  768. different, or targeted, architecture.
  769. These toolchains contain cross-compilers, linkers, and
  770. debuggers that are specific to the target architecture.</para>
  771. <para>The Yocto Project supports two different cross-development
  772. toolchains:
  773. <itemizedlist>
  774. <listitem><para>
  775. A toolchain only used by and within
  776. BitBake when building an image for a target
  777. architecture.
  778. </para></listitem>
  779. <listitem><para>A relocatable toolchain used outside of
  780. BitBake by developers when developing applications
  781. that will run on a targeted device.
  782. </para></listitem>
  783. </itemizedlist></para>
  784. <para>Creation of these toolchains is simple and automated.
  785. For information on toolchain concepts as they apply to the
  786. Yocto Project, see the
  787. "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
  788. section.
  789. You can also find more information on using the
  790. relocatable toolchain in the
  791. <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>.
  792. </para></listitem>
  793. <listitem><para>
  794. <emphasis>Image:</emphasis>
  795. An image is an artifact of the BitBake build process given
  796. a collection of recipes and related Metadata.
  797. Images are the binary output that run on specific hardware or
  798. QEMU and are used for specific use-cases.
  799. For a list of the supported image types that the Yocto Project
  800. provides, see the
  801. "<link linkend='ref-images'>Images</link>"
  802. chapter.
  803. </para></listitem>
  804. <listitem><para>
  805. <emphasis>Layer:</emphasis>
  806. A collection of recipes representing the core,
  807. a BSP, or an application stack.
  808. For a discussion specifically on BSP Layers, see the
  809. "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
  810. section in the Yocto Project Board Support Packages (BSP)
  811. Developer's Guide.
  812. </para></listitem>
  813. <listitem><para id='metadata'>
  814. <emphasis>Metadata:</emphasis>
  815. The files that BitBake parses when building an image.
  816. In general, Metadata includes recipes, classes, and
  817. configuration files.
  818. In the context of the kernel ("kernel Metadata"),
  819. it refers to Metadata in the <filename>meta</filename>
  820. branches of the kernel source Git repositories.
  821. </para></listitem>
  822. <listitem><para id='oe-core'>
  823. <emphasis>OE-Core:</emphasis>
  824. A core set of Metadata originating with OpenEmbedded (OE)
  825. that is shared between OE and the Yocto Project.
  826. This Metadata is found in the <filename>meta</filename>
  827. directory of the
  828. <link linkend='source-directory'>Source Directory</link>.
  829. </para></listitem>
  830. <listitem><para id='build-system-term'>
  831. <emphasis>OpenEmbedded Build System:</emphasis>
  832. The build system specific to the Yocto Project.
  833. The OpenEmbedded build system is based on another project known
  834. as "Poky", which uses
  835. <link linkend='bitbake-term'>BitBake</link> as the task
  836. executor.
  837. Throughout the Yocto Project documentation set, the
  838. OpenEmbedded build system is sometimes referred to simply
  839. as "the build system".
  840. If other build systems, such as a host or target build system
  841. are referenced, the documentation clearly states the
  842. difference.
  843. <note>
  844. For some historical information about Poky, see the
  845. <link linkend='poky'>Poky</link> term.
  846. </note>
  847. </para></listitem>
  848. <listitem><para>
  849. <emphasis>Package:</emphasis>
  850. In the context of the Yocto Project, this term refers to a
  851. recipe's packaged output produced by BitBake (i.e. a
  852. "baked recipe").
  853. A package is generally the compiled binaries produced from the
  854. recipe's sources.
  855. You "bake" something by running it through BitBake.</para>
  856. <para>It is worth noting that the term "package" can,
  857. in general, have subtle meanings.
  858. For example, the packages referred to in the
  859. "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Build Host Packages</ulink>"
  860. section in the Yocto Project Quick Start are compiled binaries
  861. that, when installed, add functionality to your Linux
  862. distribution.</para>
  863. <para>Another point worth noting is that historically within
  864. the Yocto Project, recipes were referred to as packages - thus,
  865. the existence of several BitBake variables that are seemingly
  866. mis-named,
  867. (e.g. <link linkend='var-PR'><filename>PR</filename></link>,
  868. <link linkend='var-PV'><filename>PV</filename></link>, and
  869. <link linkend='var-PE'><filename>PE</filename></link>).
  870. </para></listitem>
  871. <listitem><para>
  872. <emphasis>Package Groups:</emphasis>
  873. Arbitrary groups of software Recipes.
  874. You use package groups to hold recipes that, when built,
  875. usually accomplish a single task.
  876. For example, a package group could contain the recipes for a
  877. company’s proprietary or value-add software.
  878. Or, the package group could contain the recipes that enable
  879. graphics.
  880. A package group is really just another recipe.
  881. Because package group files are recipes, they end with the
  882. <filename>.bb</filename> filename extension.
  883. </para></listitem>
  884. <listitem><para id='poky'>
  885. <emphasis>Poky:</emphasis>
  886. The term "poky", which is pronounced
  887. <emphasis>Pah</emphasis>-kee, can mean several things:
  888. <itemizedlist>
  889. <listitem><para>
  890. In its most general sense, poky is an open-source
  891. project that was initially developed by OpenedHand.
  892. OpenedHand developed poky off of the existing
  893. OpenEmbedded build system to create a commercially
  894. supportable build system for embedded Linux.
  895. After Intel Corporation acquired OpenedHand, the
  896. poky project became the basis for the Yocto Project's
  897. build system.
  898. </para></listitem>
  899. <listitem><para>
  900. Within the Yocto Project
  901. <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink>,
  902. "poky" exists as a separate Git
  903. repository from which you can clone to yield a local
  904. Git repository that is a copy on your host system.
  905. Thus, "poky" can refer to the upstream or
  906. local copy of the files used for development within
  907. the Yocto Project.
  908. </para></listitem>
  909. <listitem><para>
  910. Finally, "poky" can refer to the default
  911. <link linkend='var-DISTRO'><filename>DISTRO</filename></link>
  912. (i.e. distribution) created when you use the Yocto
  913. Project in conjunction with the
  914. <filename>poky</filename> repository to build an image.
  915. </para></listitem>
  916. </itemizedlist>
  917. </para></listitem>
  918. <listitem><para>
  919. <emphasis>Recipe:</emphasis>
  920. A set of instructions for building packages.
  921. A recipe describes where you get source code, which patches
  922. to apply, how to configure the source, how to compile it and so on.
  923. Recipes also describe dependencies for libraries or for other
  924. recipes.
  925. Recipes represent the logical unit of execution, the software
  926. to build, the images to build, and use the
  927. <filename>.bb</filename> file extension.
  928. </para></listitem>
  929. <listitem>
  930. <para id='source-directory'>
  931. <emphasis>Source Directory:</emphasis>
  932. This term refers to the directory structure created as a result
  933. of creating a local copy of the <filename>poky</filename> Git
  934. repository <filename>git://git.yoctoproject.org/poky</filename>
  935. or expanding a released <filename>poky</filename> tarball.
  936. <note>
  937. Creating a local copy of the <filename>poky</filename>
  938. Git repository is the recommended method for setting up
  939. your Source Directory.
  940. </note>
  941. Sometimes you might hear the term "poky directory" used to refer
  942. to this directory structure.
  943. <note>
  944. The OpenEmbedded build system does not support file or
  945. directory names that contain spaces.
  946. Be sure that the Source Directory you use does not contain
  947. these types of names.
  948. </note></para>
  949. <para>The Source Directory contains BitBake, Documentation,
  950. Metadata and other files that all support the Yocto Project.
  951. Consequently, you must have the Source Directory in place on
  952. your development system in order to do any development using
  953. the Yocto Project.</para>
  954. <para>When you create a local copy of the Git repository, you
  955. can name the repository anything you like.
  956. Throughout much of the documentation, "poky"
  957. is used as the name of the top-level folder of the local copy of
  958. the poky Git repository.
  959. So, for example, cloning the <filename>poky</filename> Git
  960. repository results in a local Git repository whose top-level
  961. folder is also named "poky".</para>
  962. <para>While it is not recommended that you use tarball expansion
  963. to set up the Source Directory, if you do, the top-level
  964. directory name of the Source Directory is derived from the
  965. Yocto Project release tarball.
  966. For example, downloading and unpacking
  967. <filename>&YOCTO_POKY_TARBALL;</filename> results in a
  968. Source Directory whose root folder is named
  969. <filename>&YOCTO_POKY;</filename>.</para>
  970. <para>It is important to understand the differences between the
  971. Source Directory created by unpacking a released tarball as
  972. compared to cloning
  973. <filename>git://git.yoctoproject.org/poky</filename>.
  974. When you unpack a tarball, you have an exact copy of the files
  975. based on the time of release - a fixed release point.
  976. Any changes you make to your local files in the Source Directory
  977. are on top of the release and will remain local only.
  978. On the other hand, when you clone the <filename>poky</filename>
  979. Git repository, you have an active development repository with
  980. access to the upstream repository's branches and tags.
  981. In this case, any local changes you make to the local
  982. Source Directory can be later applied to active development
  983. branches of the upstream <filename>poky</filename> Git
  984. repository.</para>
  985. <para>For more information on concepts related to Git
  986. repositories, branches, and tags, see the
  987. "<link linkend='repositories-tags-and-branches'>Repositories, Tags, and Branches</link>"
  988. section.
  989. </para></listitem>
  990. <listitem><para><emphasis>Task:</emphasis>
  991. A unit of execution for BitBake (e.g.
  992. <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>,
  993. <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>,
  994. <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>,
  995. and so forth).
  996. </para></listitem>
  997. <listitem><para id='toaster-term'><emphasis>Toaster:</emphasis>
  998. A web interface to the Yocto Project's
  999. <link linkend='build-system-term'>OpenEmbedded Build System</link>.
  1000. The interface enables you to configure and run your builds.
  1001. Information about builds is collected and stored in a database.
  1002. For information on Toaster, see the
  1003. <ulink url='&YOCTO_DOCS_TOAST_URL;'>Yocto Project Toaster Manual</ulink>.
  1004. </para></listitem>
  1005. <listitem><para>
  1006. <emphasis>Upstream:</emphasis>
  1007. A reference to source code or repositories
  1008. that are not local to the development system but located in a
  1009. master area that is controlled by the maintainer of the source
  1010. code.
  1011. For example, in order for a developer to work on a particular
  1012. piece of code, they need to first get a copy of it from an
  1013. "upstream" source.
  1014. </para></listitem>
  1015. </itemizedlist>
  1016. </para>
  1017. </section>
  1018. </chapter>
  1019. <!--
  1020. vim: expandtab tw=80 ts=4
  1021. -->