yocto-project-qs.xml 55 KB

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