introduction.xml 52 KB

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