yocto-project-qs.xml 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  1. <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  2. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
  3. [<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
  4. <article id='yocto-project-qs-intro'>
  5. <articleinfo>
  6. <title>Yocto Project Quick Start</title>
  7. <copyright>
  8. <year>&COPYRIGHT_YEAR;</year>
  9. <holder>Linux Foundation</holder>
  10. </copyright>
  11. <legalnotice>
  12. <para>
  13. Permission is granted to copy, distribute and/or modify this document under
  14. the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
  15. </para>
  16. <note><title>Manual Notes</title>
  17. <itemizedlist>
  18. <listitem><para>
  19. For the latest version of the Yocto Project Quick
  20. Start associated with this Yocto Project release
  21. (version &YOCTO_DOC_VERSION;),
  22. see the Yocto Project Quick Start from the
  23. <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>.
  24. </para></listitem>
  25. <listitem><para>
  26. This version of the manual is version
  27. &YOCTO_DOC_VERSION;.
  28. For later releases of the Yocto Project (if they exist),
  29. go to the
  30. <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
  31. and use the drop-down "Active Releases" button
  32. and choose the Yocto Project version for which you want
  33. the manual.
  34. </para></listitem>
  35. <listitem><para>
  36. For an in-development version of the Yocto Project
  37. Quick Start, see
  38. <ulink url='&YOCTO_DOCS_URL;/latest/yocto-project-qs/yocto-project-qs.html'></ulink>.
  39. </para></listitem>
  40. </itemizedlist>
  41. </note>
  42. </legalnotice>
  43. <abstract>
  44. <imagedata fileref="figures/yocto-project-transp.png"
  45. width="6in" depth="1in"
  46. align="right" scale="25" />
  47. </abstract>
  48. </articleinfo>
  49. <section id='welcome'>
  50. <title>Welcome!</title>
  51. <para>
  52. Welcome to the Yocto Project!
  53. The Yocto Project is an open-source collaboration project whose
  54. focus is developers of embedded Linux systems.
  55. Among other things, the Yocto Project uses a build host based
  56. on the OpenEmbedded (OE) project, which uses the
  57. <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
  58. tool, to construct complete Linux images.
  59. The BitBake and OE components combine together to form
  60. a reference build host, historically known as
  61. <ulink url='&YOCTO_DOCS_REF_URL;#poky'>Poky</ulink>
  62. (<emphasis>Pah</emphasis>-kee).
  63. </para>
  64. <para>
  65. This quick start is written so that you can quickly get a
  66. build host set up to use the Yocto Project and then build some
  67. Linux images.
  68. Rather than go into great detail about the Yocto Project and its
  69. many capabilities, this quick start provides the minimal
  70. information you need to try out the Yocto Project using either a
  71. supported Linux build host or a build host set up to use
  72. <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
  73. which leverages
  74. <ulink url='https://www.docker.com/'>Docker Containers</ulink>.
  75. </para>
  76. <para>
  77. Reading and using the quick start should result in you having a
  78. basic understanding of what the Yocto Project is and how to use
  79. some of its core components.
  80. You will also have worked through steps to produce two images:
  81. one that runs on the emulator (QEMU) and one that boots on actual
  82. hardware (i.e. MinnowBoard Turbot).
  83. The examples highlight the ease with which you can use the
  84. Yocto Project to create images for multiple types of hardware.
  85. </para>
  86. <para>
  87. The following list directs you to key sections of this
  88. quick start:
  89. <itemizedlist>
  90. <listitem><para>
  91. <ulink url='http://www.yoctoproject.org/docs/2.4/yocto-project-qs/yocto-project-qs.html#yp-resources'>Setting Up to Use the Yocto Project</ulink>
  92. </para></listitem>
  93. <listitem><para>
  94. <ulink url='http://www.yoctoproject.org/docs/2.4/yocto-project-qs/yocto-project-qs.html#building-an-image-for-emulation'>Building an Image for Emulation</ulink>
  95. </para></listitem>
  96. <listitem><para>
  97. <ulink url='http://www.yoctoproject.org/docs/2.4/yocto-project-qs/yocto-project-qs.html#building-an-image-for-hardware'>Building an Image for Hardware</ulink>
  98. </para></listitem>
  99. </itemizedlist>
  100. <!--
  101. <note>
  102. If you do not have a system that runs Linux and you want to give
  103. the Yocto Project a test run, you might consider using the Yocto
  104. Project Build Appliance.
  105. The Build Appliance allows you to build and boot a custom
  106. embedded Linux image with the Yocto Project using a non-Linux
  107. development system.
  108. See the
  109. <ulink url='https://www.yoctoproject.org/tools-resources/projects/build-appliance'>Yocto Project Build Appliance</ulink>
  110. for more information.
  111. </note>
  112. -->
  113. </para>
  114. <para>
  115. For more detailed information on the Yocto Project, you can
  116. reference these resources:
  117. <itemizedlist>
  118. <listitem><para>
  119. <emphasis>Website:</emphasis>
  120. The
  121. <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
  122. provides bacground information, the latest builds, breaking
  123. news, full development documentation, and access to a rich
  124. Yocto Project Development Community into which you can tap.
  125. </para></listitem>
  126. <listitem><para>
  127. <emphasis>Yocto Project Development Environment Overview:</emphasis>
  128. The
  129. "<ulink url='&YOCTO_DOCS_REF_URL;#yp-intro'>Introducing the Yocto Project Development Environment</ulink>"
  130. section presents an overview of the Yocto Project
  131. development environment.
  132. </para></listitem>
  133. <listitem><para>
  134. <emphasis>FAQs:</emphasis>
  135. Lists commonly asked Yocto Project questions and answers.
  136. You can find two FAQs:
  137. <ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>Yocto Project FAQ</ulink>
  138. on a wiki, and the
  139. "<ulink url='&YOCTO_DOCS_REF_URL;#faq'>FAQ</ulink>"
  140. chapter in the Yocto Project Reference Manual.
  141. </para></listitem>
  142. <listitem><para>
  143. <emphasis>Developer Screencast:</emphasis>
  144. The
  145. <ulink url='http://vimeo.com/36450321'>Getting Started with the Yocto Project - New Developer Screencast Tutorial</ulink>
  146. provides a 30-minute video created for users unfamiliar
  147. with the Yocto Project but familiar with Linux build
  148. hosts.
  149. While this screencast is somewhat dated, the introductory
  150. and fundamental concepts are useful for the beginner.
  151. </para></listitem>
  152. <listitem><para>
  153. <emphasis>Comprehensive List of Links and Other Documentation:</emphasis>
  154. The
  155. "<ulink url='&YOCTO_DOCS_REF_URL;#resources-links-and-related-documentation'>Links and Related Documentation</ulink>"
  156. section in the Yocto Project Reference Manual provides a
  157. comprehensive list of related links and documentation.
  158. </para></listitem>
  159. </itemizedlist>
  160. </para>
  161. </section>
  162. <section id='yp-resources'>
  163. <title>Setting Up to Use the Yocto Project</title>
  164. <para>
  165. Setting up to use the Yocto Project involves getting your build
  166. host ready.
  167. If you have a native Linux machine that runs a Yocto Project
  168. supported distribution as described by the
  169. "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>"
  170. section in the Yocto Project Reference Manual, you can prepare
  171. that machine as your build host.
  172. See the
  173. "<link linkend='qs-native-linux-build-host'>Using a Native Linux Machine</link>"
  174. section for more information.
  175. </para>
  176. <para>
  177. If you do not want to use the Yocto Project on a native Linux
  178. machine, you can prepare your build host to use
  179. <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
  180. which leverages
  181. <ulink url='https://www.docker.com/'>Docker Containers</ulink>.
  182. You can set up a build host for Windows, Mac, and Linux
  183. machines.
  184. See the
  185. "<link linkend='qs-crops-build-host'>Using CROPS and Containers</link>"
  186. section for more information.
  187. </para>
  188. <section id='qs-crops-build-host'>
  189. <title>Using CROPS and Containers</title>
  190. <para>
  191. Follow these steps to get your build host set up with a
  192. Poky container that you can use to complete the build
  193. examples further down in the Quick Start:
  194. <orderedlist>
  195. <listitem><para>
  196. <emphasis>Set Up to use CROss PlatformS (CROPS):</emphasis>
  197. Work through the first six steps of the procedure
  198. in the
  199. "<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-to-use-crops'>Setting Up to Use CROss PlatformS (CROPS)</ulink>"
  200. section of the Yocto Project Development Tasks Manual.
  201. </para></listitem>
  202. <listitem><para>
  203. <emphasis>Set Up the Poky Container to Use the Yocto Project:</emphasis>
  204. Go to
  205. <ulink url='https://github.com/crops/poky-container/blob/master/README.md'></ulink>
  206. and follow the directions to set up the Poky container
  207. on your build host.</para>
  208. <para>Once you complete the setup instructions for your
  209. machine, you need to get a copy of the
  210. <filename>poky</filename> repository on your build
  211. host.
  212. See the
  213. "<link linkend='releases'>Yocto Project Release</link>"
  214. section to continue.
  215. </para></listitem>
  216. </orderedlist>
  217. </para>
  218. </section>
  219. <section id='qs-native-linux-build-host'>
  220. <title>Using a Native Linux Machine</title>
  221. <para>
  222. The following list shows what you need in order to use a
  223. Linux-based build host to use the Yocto Project to build images:
  224. </para>
  225. <itemizedlist>
  226. <listitem><para><emphasis>Build Host</emphasis>
  227. A build host with a minimum of 50 Gbytes of free disk
  228. space that is running a supported Linux distribution (i.e.
  229. recent releases of Fedora, openSUSE, CentOS, Debian, or
  230. Ubuntu).
  231. </para></listitem>
  232. <listitem><para><emphasis>Build Host Packages</emphasis>
  233. Appropriate packages installed on the build host.
  234. </para></listitem>
  235. </itemizedlist>
  236. <section id='the-linux-distro'>
  237. <title>The Linux Distribution</title>
  238. <para>
  239. The Yocto Project team verifies each release against recent
  240. versions of the most popular Linux distributions that
  241. provide stable releases.
  242. In general, if you have the current release minus one of the
  243. following distributions, you should have no problems.
  244. <itemizedlist>
  245. <listitem><para>
  246. Ubuntu
  247. </para></listitem>
  248. <listitem><para>
  249. Fedora
  250. </para></listitem>
  251. <listitem><para>
  252. openSUSE
  253. </para></listitem>
  254. <listitem><para>
  255. CentOS
  256. </para></listitem>
  257. <listitem><para>
  258. Debian
  259. </para></listitem>
  260. </itemizedlist>
  261. For a more detailed list of distributions that support the
  262. Yocto Project, see the
  263. "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>"
  264. section in the Yocto Project Reference Manual.
  265. </para>
  266. <para>
  267. The OpenEmbedded build system should be able to run on any
  268. modern distribution that has the following versions for
  269. Git, tar, and Python.
  270. <itemizedlist>
  271. <listitem><para>
  272. Git 1.8.3.1 or greater
  273. </para></listitem>
  274. <listitem><para>
  275. tar 1.27 or greater
  276. </para></listitem>
  277. <listitem><para>
  278. Python 3.4.0 or greater.
  279. </para></listitem>
  280. </itemizedlist>
  281. If your build host does not meet any of these three listed
  282. version requirements, you can take steps to prepare the
  283. system so that you can still use the Yocto Project.
  284. See the
  285. "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
  286. section in the Yocto Project Reference Manual for information.
  287. </para>
  288. </section>
  289. <section id='packages'>
  290. <title>The Build Host Packages</title>
  291. <para>
  292. Required build host packages vary depending on your
  293. build machine and what you want to do with the Yocto Project.
  294. For example, if you want to build an image that can run
  295. on QEMU in graphical mode (a minimal, basic build
  296. requirement), then the build host package requirements
  297. are different than if you want to build an image on a headless
  298. system or build out the Yocto Project documentation set.
  299. </para>
  300. <para>
  301. Collectively, the number of required packages is large
  302. if you want to be able to cover all cases.
  303. <note>
  304. In general, you need to have root access and then install
  305. the required packages.
  306. Thus, the commands in the following section may or may
  307. not work depending on whether or not your Linux
  308. distribution has <filename>sudo</filename> installed.
  309. </note>
  310. </para>
  311. <para>
  312. The following list shows the required packages needed to build
  313. an image that runs on QEMU in graphical mode (e.g. essential
  314. plus graphics support).
  315. For lists of required packages for other scenarios, see the
  316. "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
  317. section in the Yocto Project Reference Manual.
  318. <itemizedlist>
  319. <listitem><para><emphasis>Ubuntu and Debian</emphasis>
  320. <literallayout class='monospaced'>
  321. $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; libsdl1.2-dev xterm
  322. </literallayout>
  323. </para></listitem>
  324. <listitem><para><emphasis>Fedora</emphasis>
  325. <literallayout class='monospaced'>
  326. $ sudo dnf install &FEDORA_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
  327. </literallayout>
  328. </para></listitem>
  329. <listitem><para><emphasis>OpenSUSE</emphasis>
  330. <literallayout class='monospaced'>
  331. $ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL; libSDL-devel xterm
  332. </literallayout>
  333. </para></listitem>
  334. <listitem><para><emphasis>CentOS</emphasis>
  335. <literallayout class='monospaced'>
  336. $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
  337. </literallayout>
  338. <note><title>Notes</title>
  339. <itemizedlist>
  340. <listitem><para>
  341. CentOS 6.x users need to ensure that the
  342. required versions of Git, tar and Python
  343. are available.
  344. For details, See the
  345. "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
  346. section in the Yocto Project Reference
  347. Manual for information.
  348. </para></listitem>
  349. <listitem><para>
  350. Extra Packages for Enterprise Linux
  351. (i.e. <filename>epel-release</filename>)
  352. is a collection of packages from Fedora
  353. built on RHEL/CentOS for easy installation
  354. of packages not included in enterprise
  355. Linux by default.
  356. You need to install these packages
  357. separately.
  358. </para></listitem>
  359. <listitem><para>
  360. The <filename>makecache</filename> command
  361. consumes additional Metadata from
  362. <filename>epel-release</filename>.
  363. </para></listitem>
  364. </itemizedlist>
  365. </note>
  366. </para></listitem>
  367. </itemizedlist>
  368. </para>
  369. </section>
  370. <para>
  371. Once you complete the setup instructions for your
  372. machine, you need to get a copy of the
  373. <filename>poky</filename> repository on your build
  374. host.
  375. Continue with the
  376. "<link linkend='releases'>Yocto Project Release</link>"
  377. section.
  378. </para>
  379. </section>
  380. <section id='releases'>
  381. <title>Yocto Project Release</title>
  382. <para>
  383. Now that your build host has the right packages (native
  384. Linux machine) or you have the Poky container set up
  385. (CROPS), you need to get a copy of the Yocto Project.
  386. It is recommended that you get the latest Yocto Project release
  387. by setting up (cloning in
  388. <ulink url='&YOCTO_DOCS_REF_URL;#git'>Git</ulink> terms) a
  389. local copy of the <filename>poky</filename> Git repository on
  390. your build host and then checking out the latest release.
  391. Doing so allows you to easily update to newer Yocto Project
  392. releases as well as contribute back to the Yocto Project.
  393. </para>
  394. <para>
  395. Here is an example from a native Linux machine that is
  396. running Ubuntu.
  397. <note>
  398. If your build host is using a Poky container, you can
  399. use the same Git commands.
  400. </note>
  401. The example clones the <filename>poky</filename> repository
  402. and then checks out the latest Yocto Project Release by tag
  403. (i.e. <filename>&DISTRO_REL_TAG;</filename>):
  404. <literallayout class='monospaced'>
  405. $ git clone git://git.yoctoproject.org/poky
  406. Cloning into 'poky'...
  407. remote: Counting objects: 361782, done.
  408. remote: Compressing objects: 100% (87100/87100), done.
  409. remote: Total 361782 (delta 268619), reused 361439 (delta 268277)
  410. Receiving objects: 100% (361782/361782), 131.94 MiB | 6.88 MiB/s, done.
  411. Resolving deltas: 100% (268619/268619), done.
  412. Checking connectivity... done.
  413. $ git checkout tags/&DISTRO_REL_TAG; -b poky_&DISTRO;
  414. </literallayout>
  415. </para>
  416. <para>
  417. The previous Git <filename>checkout</filename> command
  418. creates a local branch named
  419. <filename>poky_&DISTRO;</filename>.
  420. The files available to you in that branch exactly match the
  421. repository's files in the
  422. <filename>&DISTRO_NAME_NO_CAP;</filename>
  423. development branch at the time of the Yocto Project &DISTRO;
  424. release.
  425. <note>
  426. Rather than checking out the entire development branch
  427. of a release (i.e. the tip), which could be continuously
  428. changing while you are doing your development, you would
  429. check out a branch based on a release tag. Doing so
  430. provides you with an unchanging, stable set of files.
  431. </note>
  432. </para>
  433. <para>
  434. For more options and information about accessing Yocto
  435. Project related repositories, see the
  436. "<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-yocto-project-source-files'>Working With Yocto Project Source Files</ulink>"
  437. section in the Yocto Project Development Tasks Manual.
  438. </para>
  439. </section>
  440. </section>
  441. <section id='qs-building-images'>
  442. <title>Building Images</title>
  443. <para>
  444. You are now ready to give the Yocto Project a try.
  445. For this example, you will be using the command line to build
  446. your images.
  447. <note>
  448. A graphical user interface to the Yocto Project is available
  449. through Toaster.
  450. See the
  451. <ulink url='&YOCTO_DOCS_TOAST_URL;'>Toaster User Manual</ulink>
  452. for more information.
  453. </note>
  454. </para>
  455. <para>
  456. The remainder of this quick start steps you through the
  457. following:
  458. <itemizedlist>
  459. <listitem><para>
  460. Build a <filename>qemux86</filename> reference image
  461. and run it in the QEMU emulator.
  462. </para></listitem>
  463. <listitem><para>
  464. Easily change configurations so that you can quickly
  465. create a second image that you can load onto bootable
  466. media and actually boot target hardware.
  467. This example uses the MinnowBoard
  468. Turbot-compatible boards.
  469. </para></listitem>
  470. </itemizedlist>
  471. <note>
  472. The steps in the following two sections do not provide detail,
  473. but rather provide minimal, working commands and examples
  474. designed to just get you started.
  475. For more details, see the appropriate manuals in the
  476. <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project manual set</ulink>.
  477. </note>
  478. </para>
  479. <section id='building-an-image-for-emulation'>
  480. <title>Building an Image for Emulation</title>
  481. <para>
  482. Use the following commands to build your image.
  483. The OpenEmbedded build system creates an entire Linux
  484. distribution, including the toolchain, from source.
  485. <note><title>Note about Network Proxies</title>
  486. <para>
  487. By default, the build process searches for source code
  488. using a pre-determined order through a set of
  489. locations.
  490. If you are working behind a firewall and your build
  491. host is not set up for proxies, you could encounter
  492. problems with the build process when fetching source
  493. code (e.g. fetcher failures or Git failures).
  494. </para>
  495. <para>
  496. If you do not know your proxy settings, consult your
  497. local network infrastructure resources and get that
  498. information.
  499. A good starting point could also be to check your web
  500. browser settings.
  501. Finally, you can find more information on using the
  502. Yocto Project behind a firewall in the Yocto Project
  503. Reference Manual
  504. <ulink url='&YOCTO_DOCS_REF_URL;#how-does-the-yocto-project-obtain-source-code-and-will-it-work-behind-my-firewall-or-proxy-server'>FAQ</ulink>
  505. and on the
  506. "<ulink url='https://wiki.yoctoproject.org/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>"
  507. wiki page.
  508. </para>
  509. </note>
  510. </para>
  511. <para>
  512. <orderedlist>
  513. <listitem><para>
  514. <emphasis>Be Sure Your Build Host is Set Up:</emphasis>
  515. The steps to build an image in this section depend on
  516. your build host being properly set up.
  517. Be sure you have worked through the requirements
  518. described in the
  519. "<link linkend='yp-resources'>Setting Up to Use the Yocto Project</link>"
  520. section.
  521. </para></listitem>
  522. <listitem><para>
  523. <emphasis>Check Out Your Branch:</emphasis>
  524. Be sure you are in the
  525. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
  526. (e.g. <filename>poky</filename>) and then check out
  527. the branch associated with the latest Yocto Project
  528. Release:
  529. <literallayout class='monospaced'>
  530. $ cd ~/poky
  531. $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
  532. </literallayout>
  533. Git's <filename>checkout</filename> command checks out
  534. the current Yocto Project release into a local branch
  535. whose name matches the release (i.e.
  536. <filename>&DISTRO_NAME_NO_CAP;</filename>).
  537. The local branch tracks the upstream branch of the
  538. same name.
  539. Creating your own branch based on the released
  540. branch ensures you are using the latest files for
  541. that release.
  542. </para></listitem>
  543. <listitem><para>
  544. <emphasis>Initialize the Build Environment:</emphasis>
  545. Run the
  546. <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
  547. environment setup script to define the OpenEmbedded
  548. build environment on your build host.
  549. <literallayout class='monospaced'>
  550. $ source &OE_INIT_FILE;
  551. </literallayout>
  552. Among other things, the script creates the
  553. <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
  554. which is <filename>build</filename> in this case
  555. and is located in the
  556. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
  557. After the script runs, your current working directory
  558. is set to the Build Directory.
  559. Later, when the build completes, the Build Directory
  560. contains all the files created during the build.
  561. </para></listitem>
  562. <listitem><para>
  563. <emphasis>Examine Your Local Configuration File:</emphasis>
  564. When you set up the build environment, a local
  565. configuration file named
  566. <filename>local.conf</filename> becomes available in
  567. a <filename>conf</filename> subdirectory of the
  568. Build Directory.
  569. Before using BitBake to start the build, you can
  570. look at this file and be sure your general
  571. configurations are how you want them:
  572. <itemizedlist>
  573. <listitem><para>
  574. To help conserve disk space during builds,
  575. you can add the following statement to your
  576. project's configuration file, which for this
  577. example is
  578. <filename>poky/build/conf/local.conf</filename>.
  579. Adding this statement deletes the work
  580. directory used for building a recipe once the
  581. recipe is built.
  582. <literallayout class='monospaced'>
  583. INHERIT += "rm_work"
  584. </literallayout>
  585. </para></listitem>
  586. <listitem><para>
  587. By default, the target machine for the build is
  588. <filename>qemux86</filename>,
  589. which produces an image that can be used in
  590. the QEMU emulator and is targeted at an
  591. <trademark class='registered'>Intel</trademark>
  592. 32-bit based architecture.
  593. Further on in this example, this default is
  594. easily changed through the
  595. <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
  596. variable so that you can quickly
  597. build an image for a different machine.
  598. </para></listitem>
  599. <listitem><para>
  600. Another consideration before you build is the
  601. package manager used when creating the image.
  602. The default <filename>local.conf</filename>
  603. file selects the RPM package manager.
  604. You can control this configuration by using the
  605. <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink></filename>
  606. variable.</para>
  607. <para>Selection of the package manager is separate
  608. from whether package management is used at runtime
  609. in the target image.</para>
  610. <para>For additional package manager selection
  611. information, see the
  612. "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-package'><filename>package.bbclass</filename></ulink>"
  613. section in the Yocto Project Reference Manual.
  614. </para></listitem>
  615. </itemizedlist>
  616. </para></listitem>
  617. <listitem><para>
  618. <emphasis>Start the Build:</emphasis>
  619. Continue with the following command to build an OS image
  620. for the target, which is
  621. <filename>core-image-sato</filename> in this example:
  622. <note>
  623. Depending on the number of processors and cores, the
  624. amount of RAM, the speed of your Internet connection
  625. and other factors, the build process could take
  626. several hours the first time you run it.
  627. Subsequent builds run much faster since parts of the
  628. build are cached.
  629. </note>
  630. <literallayout class='monospaced'>
  631. $ bitbake core-image-sato
  632. </literallayout>
  633. <note>
  634. <para>
  635. If you experience a build error due to resources
  636. temporarily being unavailable and it appears you
  637. should not be having this issue, it might be due
  638. to the combination of a 4.3+ Linux kernel and
  639. <filename>systemd</filename> version 228+
  640. (i.e. see this
  641. <ulink url='http://unix.stackexchange.com/questions/253903/creating-threads-fails-with-resource-temporarily-unavailable-with-4-3-kernel'>link</ulink>
  642. for information).
  643. </para>
  644. <para>
  645. To work around this issue, you can try either
  646. of the following:
  647. <itemizedlist>
  648. <listitem><para>
  649. Try the build again.
  650. </para></listitem>
  651. <listitem><para>
  652. Modify the "DefaultTasksMax"
  653. <filename>systemd</filename> parameter
  654. by uncommenting it and setting it to
  655. "infinity".
  656. You can find this parameter in the
  657. <filename>system.conf</filename> file
  658. located in
  659. <filename>/etc/systemd</filename>
  660. on most systems.
  661. </para></listitem>
  662. </itemizedlist>
  663. </para>
  664. </note>
  665. For information on using the
  666. <filename>bitbake</filename> command, see the
  667. "<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>"
  668. section in the Yocto Project Reference Manual, or see the
  669. "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-command'>BitBake Command</ulink>"
  670. section in the BitBake User Manual.
  671. For information on other targets, see the
  672. "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
  673. chapter in the Yocto Project Reference Manual.
  674. </para></listitem>
  675. <listitem><para>
  676. <emphasis>Simulate Your Image Using QEMU:</emphasis>
  677. Once this particular image is built, you can start QEMU
  678. and run the image:
  679. <literallayout class='monospaced'>
  680. $ runqemu qemux86
  681. </literallayout>
  682. If you want to learn more about running QEMU, see the
  683. "<ulink url="&YOCTO_DOCS_DEV_URL;#dev-manual-qemu">Using the Quick EMUlator (QEMU)</ulink>"
  684. chapter in the Yocto Project Development Tasks Manual.
  685. </para></listitem>
  686. <listitem><para>
  687. <emphasis>Exit QEMU:</emphasis>
  688. Exit QEMU by either clicking on the shutdown icon or by
  689. typing <filename>Ctrl-C</filename> in the QEMU
  690. transcript window from which you evoked QEMU.
  691. </para></listitem>
  692. </orderedlist>
  693. </para>
  694. </section>
  695. <section id='building-an-image-for-hardware'>
  696. <title>Building an Image for Hardware</title>
  697. <para id='qs-minnowboard-example'>
  698. The following steps show how easy it is to set up to build an
  699. image for a new machine.
  700. These steps build an image for the MinnowBoard Turbot, which is
  701. supported by the Yocto Project and the
  702. <filename>meta-intel</filename> <filename>intel-corei7-64</filename>
  703. and <filename>intel-core2-32</filename> Board Support Packages
  704. (BSPs).
  705. <note>
  706. The MinnowBoard Turbot ships with 64-bit firmware.
  707. If you want to use the board in 32-bit mode, you must
  708. download the
  709. <ulink url='http://firmware.intel.com/projects/minnowboard-max'>32-bit firmware</ulink>.
  710. </note>
  711. </para>
  712. <para>
  713. <orderedlist>
  714. <listitem><para>
  715. <emphasis>Create a Local Copy of the
  716. <filename>meta-intel</filename> Repository:</emphasis>
  717. Building an image for the MinnowBoard Turbot requires
  718. the
  719. <filename>meta-intel</filename> layer.
  720. Use the <filename>git clone</filename> command to create
  721. a local copy of the repository inside your
  722. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>,
  723. which is <filename>poky</filename> in this example:
  724. <literallayout class='monospaced'>
  725. $ cd $HOME/poky
  726. $ git clone git://git.yoctoproject.org/meta-intel
  727. Cloning into 'meta-intel'...
  728. remote: Counting objects: 14039, done.
  729. remote: Compressing objects: 100% (4471/4471), done.
  730. remote: Total 14039 (delta 8130), reused 13837 (delta 7947)
  731. Receiving objects: 100% (14039/14039), 4.27 MiB | 3.98 MiB/s, done.
  732. Resolving deltas: 100% (8130/8130), done.
  733. Checking connectivity... done.
  734. </literallayout>
  735. By default when you clone a Git repository, the
  736. "master" branch is checked out.
  737. Before you build your image that uses the
  738. <filename>meta-intel</filename> layer, you must be
  739. sure that both repositories
  740. (<filename>meta-intel</filename> and
  741. <filename>poky</filename>) are using the same releases.
  742. Because you used the <filename>&DISTRO_REL_TAG;</filename>
  743. tag when you checked out the <filename>poky</filename>
  744. repository by tag, you should use a
  745. <filename>meta-intel</filename>
  746. tag that corresponds with the release you used for
  747. <filename>poky</filename>.
  748. Consequently, you need to checkout out the
  749. "<filename>&METAINTELVERSION;-&DISTRO_NAME_NO_CAP;-&YOCTO_DOC_VERSION;</filename>"
  750. branch after cloning <filename>meta-intel</filename>:
  751. <literallayout class='monospaced'>
  752. $ cd $HOME/poky/meta-intel
  753. $ git checkout tags/&METAINTELVERSION;-&DISTRO_NAME_NO_CAP;-&YOCTO_DOC_VERSION; -b meta-intel-&DISTRO_NAME_NO_CAP;-&YOCTO_DOC_VERSION;
  754. Switched to a new branch 'meta-intel-&DISTRO_NAME_NO_CAP;-&YOCTO_DOC_VERSION;'
  755. </literallayout>
  756. The previous Git <filename>checkout</filename> command
  757. creates a local branch named
  758. <filename>meta-intel-&DISTRO_NAME_NO_CAP;-&YOCTO_DOC_VERSION;</filename>.
  759. You have the option to name your local branch whatever
  760. you want by providing any name you like for
  761. "meta-intel-&DISTRO_NAME_NO_CAP;-&YOCTO_DOC_VERSION;"
  762. in the above example.
  763. </para></listitem>
  764. <listitem><para>
  765. <emphasis>Configure the Build:</emphasis>
  766. To configure the build, you edit the
  767. <filename>bblayers.conf</filename> and
  768. <filename>local.conf</filename> files, both of which are
  769. located in the <filename>build/conf</filename> directory.
  770. </para>
  771. <para>Here is a quick way to make the edits.
  772. The first command uses the
  773. <filename>bitbake-layers add-layer</filename> command
  774. to add the <filename>meta-intel</filename>
  775. layer, which contains the <filename>intel-core*</filename>
  776. BSPs to the build.
  777. The second command selects the BSP by setting the
  778. <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
  779. variable.
  780. <literallayout class='monospaced'>
  781. $ cd $HOME/poky/build
  782. $ bitbake-layers add-layer "$HOME/poky/meta-intel"
  783. $ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
  784. </literallayout>
  785. <note><title>Notes</title>
  786. <para>
  787. If you want a 64-bit build, use the following:
  788. <literallayout class='monospaced'>
  789. $ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
  790. </literallayout>
  791. </para>
  792. <para>
  793. If you want 32-bit images, use the following:
  794. <literallayout class='monospaced'>
  795. $ echo 'MACHINE = "intel-core2-32"' >> conf/local.conf
  796. </literallayout>
  797. </para>
  798. </note>
  799. </para></listitem>
  800. <listitem><para>
  801. <emphasis>Build an Image for MinnowBoard
  802. Turbot:</emphasis>
  803. The type of image you build depends on your goals.
  804. For example, the previous build created a
  805. <filename>core-image-sato</filename> image, which is an
  806. image with Sato support.
  807. It is possible to build many image types for the
  808. MinnowBoard Turbot.
  809. Some possibilities are <filename>core-image-base</filename>,
  810. which is a console-only image.
  811. Another choice could be a
  812. <filename>core-image-full-cmdline</filename>, which is
  813. another console-only image but has more full-features
  814. Linux system functionality installed.
  815. For types of images you can build using the Yocto
  816. Project, see the
  817. "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
  818. chapter in the Yocto Project Reference Manual.</para>
  819. <para>Because configuration changes are minimal to set up
  820. for this second build, the OpenEmbedded build system can
  821. re-use files from previous builds as much as possible.
  822. Re-using files means this second build will be much faster
  823. than an initial build.
  824. For this example, the <filename>core-image-base</filename>
  825. image is built:
  826. <literallayout class='monospaced'>
  827. $ bitbake core-image-base
  828. </literallayout>
  829. <note>
  830. <para>
  831. If you experience a build error due to resources
  832. temporarily being unavailable and it appears you
  833. should not be having this issue, it might be due
  834. to the combination of a 4.3+ Linux kernel and
  835. <filename>systemd</filename> version 228+
  836. (i.e. see this
  837. <ulink url='http://unix.stackexchange.com/questions/253903/creating-threads-fails-with-resource-temporarily-unavailable-with-4-3-kernel'>link</ulink>
  838. for information).
  839. </para>
  840. <para>
  841. To work around this issue, you can try either
  842. of the following:
  843. <itemizedlist>
  844. <listitem><para>
  845. Try the build again.
  846. </para></listitem>
  847. <listitem><para>
  848. Modify the "DefaultTasksMax"
  849. <filename>systemd</filename> parameter
  850. by uncommenting it and setting it to
  851. "infinity".
  852. You can find this parameter in the
  853. <filename>system.conf</filename> file
  854. located in
  855. <filename>/etc/systemd</filename>
  856. on most systems.
  857. </para></listitem>
  858. </itemizedlist>
  859. </para>
  860. </note>
  861. Once the build completes, the resulting console-only image
  862. is located in the Build Directory here:
  863. <literallayout class='monospaced'>
  864. tmp/deploy/images/intel-corei7-64/core-image-base-intel-corei7-64.wic
  865. </literallayout>
  866. </para></listitem>
  867. <listitem><para>
  868. <emphasis>Write the Image:</emphasis>
  869. You can write the image just built to a bootable media
  870. (e.g. a USB key, SATA drive, SD card, etc.) using the
  871. <filename>dd</filename> utility:
  872. <literallayout class='monospaced'>
  873. $ sudo dd if=tmp/deploy/images/intel-corei7-64/core-image-base-intel-corei7-64.wic of=TARGET_DEVICE
  874. </literallayout>
  875. In the previous command, the
  876. <filename>TARGET_DEVICE</filename> is the device node in
  877. the host machine (e.g. <filename>/dev/sdc</filename>, which
  878. is most likely a USB stick, or
  879. <filename>/dev/mmcblk0</filename>, which is most likely an
  880. SD card).
  881. </para></listitem>
  882. <listitem><para>
  883. <emphasis>Boot the Hardware:</emphasis>
  884. With the boot device provisioned, you can insert the
  885. media into the MinnowBoard Turbot and boot the hardware.
  886. The board should automatically detect the media and boot to
  887. the bootloader and subsequently the operating system.
  888. </para>
  889. <para>If the board does not boot automatically, you can
  890. boot it manually from the EFI shell as follows:
  891. <literallayout class='monospaced'>
  892. Shell> connect -r
  893. Shell> map -r
  894. Shell> fs0:
  895. Shell> bootx64
  896. </literallayout>
  897. <note>
  898. For a 32-bit image use the following:
  899. <literallayout class='monospaced'>
  900. Shell> bootia32
  901. </literallayout>
  902. </note>
  903. </para></listitem>
  904. </orderedlist>
  905. </para>
  906. </section>
  907. </section>
  908. <section id='qs-next-steps'>
  909. <title>Next Steps</title>
  910. <para>
  911. If you completed all the steps in the previous section then
  912. congratulations!
  913. What now?
  914. </para>
  915. <para>
  916. Depending on what you primary interests are with the Yocto Project,
  917. you could consider any of the following:
  918. <itemizedlist>
  919. <listitem><para>
  920. <emphasis>Visit the Yocto Project Web Site:</emphasis>
  921. The official
  922. <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink>
  923. web site contains information on the entire project.
  924. Visiting this site is a good way to familiarize yourself
  925. with the overall project.
  926. </para></listitem>
  927. <listitem><para>
  928. <emphasis>Look Through the
  929. <ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-intro'>Yocto Project Development Tasks Manual</ulink>:</emphasis>
  930. This manual contains procedural information grouped to
  931. help you get set up, work with layers, customize images,
  932. write new recipes, work with libraries, and use QEMU.
  933. The information is task-based and spans the breadth of the
  934. Yocto Project.
  935. </para></listitem>
  936. <listitem><para>
  937. <emphasis>Look Through the
  938. <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-intro'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>:</emphasis>
  939. This manual describes how to use both the
  940. <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-using-the-standard-sdk'>standard SDK</ulink>
  941. and the
  942. <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>extensible SDK</ulink>,
  943. which are used primarily for application development.
  944. This manual also provides example workflows
  945. that use the popular <trademark class='trade'>Eclipse</trademark>
  946. development environment and that use <filename>devtool</filename>.
  947. See the
  948. "<ulink url='&YOCTO_DOCS_SDK_URL;#workflow-using-eclipse'>Workflow using Eclipse™</ulink>"
  949. and
  950. "<ulink url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'>Using <filename>devtool</filename> in your SDK Workflow</ulink>"
  951. sections for more information.
  952. </para></listitem>
  953. <listitem><para>
  954. <emphasis>Learn About Kernel Development:</emphasis>
  955. If you want to see how to work with the kernel and
  956. understand Yocto Linux kernels, see the
  957. <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#kernel-dev-intro'>Yocto Project Linux Kernel Development Manual</ulink>.
  958. This manual provides information on how to patch the
  959. kernel, modify kernel recipes, and configure the kernel.
  960. </para></listitem>
  961. <listitem><para>
  962. <emphasis>Learn About Board Support Packages (BSPs):</emphasis>
  963. If you want to learn about BSPs, see the
  964. <ulink url='&YOCTO_DOCS_BSP_URL;#bsp'>Yocto Project Board Support Packages (BSP) Developer's Guide</ulink>.
  965. This manual also provides an example BSP creation workflow.
  966. See the
  967. <ulink url='&YOCTO_DOCS_BSP_URL;#developing-a-board-support-package-bsp'>"Developing a Board Support Package (BSP)</ulink>"
  968. section.
  969. </para></listitem>
  970. <listitem><para>
  971. <emphasis>Learn About Toaster:</emphasis>
  972. Toaster is a web interface to the Yocto Project's
  973. OpenEmbedded build system.
  974. If you are interested in using this type of interface to
  975. create images, see the
  976. <ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-intro'>Toaster User Manual</ulink>.
  977. </para></listitem>
  978. <listitem><para>
  979. <emphasis>Have Available the
  980. <ulink url='&YOCTO_DOCS_REF_URL;#ref-manual-intro'>Yocto Project Reference Manual:</ulink></emphasis>
  981. Unlike the rest of the Yocto Project manual set, this manual
  982. is comprised of material suited for reference rather than
  983. procedures.
  984. You can get
  985. <ulink url='&YOCTO_DOCS_REF_URL;#usingpoky'>build details</ulink>,
  986. a
  987. <ulink url='&YOCTO_DOCS_REF_URL;#development-concepts'>closer look</ulink>
  988. at how the pieces of the Yocto Project development
  989. environment work together, information on various
  990. <ulink url='&YOCTO_DOCS_REF_URL;#technical-details'>technical details</ulink>,
  991. guidance on
  992. <ulink url='&YOCTO_DOCS_REF_URL;#migration'>migrating to a newer Yocto Project release</ulink>,
  993. reference material on the
  994. <ulink url='&YOCTO_DOCS_REF_URL;#ref-structure'>directory structure</ulink>,
  995. <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes'>classes</ulink>,
  996. and
  997. <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks'>tasks</ulink>.
  998. The Yocto Project Reference Manual also contains a fairly
  999. comprehensive
  1000. <ulink url='&YOCTO_DOCS_REF_URL;#ref-variables-glossary'>glossary of variables</ulink>
  1001. used within the Yocto Project.
  1002. </para></listitem>
  1003. </itemizedlist>
  1004. </para>
  1005. </section>
  1006. </article>
  1007. <!--
  1008. vim: expandtab tw=80 ts=4
  1009. -->