yocto-project-qs.xml 53 KB

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