yocto-project-qs.xml 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856
  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. This version of the
  20. <emphasis>Yocto Project Quick Start</emphasis>
  21. is for the &YOCTO_DOC_VERSION; release of the
  22. Yocto Project.
  23. To be sure you have the latest version of the manual
  24. for this release, go to the
  25. <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
  26. and select the manual from that site.
  27. Manuals from the site are more up-to-date than manuals
  28. derived from the Yocto Project released TAR files.
  29. </para></listitem>
  30. <listitem><para>
  31. If you located this manual through a web search, the
  32. version of the manual might not be the one you want
  33. (e.g. the search might have returned a manual much
  34. older than the Yocto Project version with which you
  35. are working).
  36. You can see all Yocto Project major releases by
  37. visiting the
  38. <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
  39. page.
  40. If you need a version of this manual for a different
  41. Yocto Project release, visit the
  42. <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
  43. and select the manual set by using the
  44. "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE"
  45. pull-down menus.
  46. </para></listitem>
  47. <listitem><para>
  48. To report any inaccuracies or problems with this
  49. manual, send an email to the Yocto Project
  50. discussion group at
  51. <filename>yocto@yoctoproject.com</filename> or log into
  52. the freenode <filename>#yocto</filename> channel.
  53. </para></listitem>
  54. </itemizedlist>
  55. </note>
  56. </legalnotice>
  57. <abstract>
  58. <imagedata fileref="figures/yocto-project-transp.png"
  59. width="6in" depth="1in"
  60. align="right" scale="25" />
  61. </abstract>
  62. </articleinfo>
  63. <section id='welcome'>
  64. <title>Welcome!</title>
  65. <para>
  66. Welcome to the Yocto Project!
  67. The Yocto Project is an open-source collaboration project whose
  68. focus is developers of embedded Linux systems.
  69. Among other things, the Yocto Project uses a build host based
  70. on the OpenEmbedded (OE) project, which uses the
  71. <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>
  72. tool, to construct complete Linux images.
  73. The BitBake and OE components are combined together to form
  74. a reference build host, historically known as
  75. <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>.
  76. </para>
  77. <para>
  78. If you do not have a system that runs Linux and you want to give
  79. the Yocto Project a test run, you might consider using the Yocto
  80. Project Build Appliance.
  81. The Build Appliance allows you to build and boot a custom embedded
  82. Linux image with the Yocto Project using a non-Linux development
  83. system.
  84. See the
  85. <ulink url='https://www.yoctoproject.org/tools-resources/projects/build-appliance'>Yocto Project Build Appliance</ulink>
  86. for more information.
  87. </para>
  88. <para>
  89. This quick start is written so that you can quickly get a host
  90. build host set up to use the Yocto Project and then build some
  91. Linux images.
  92. Rather than go into great detail about the Yocto Project and its
  93. many capabilities, this quick start provides the minimal
  94. information you need to try out the Yocto Project using a
  95. supported Linux build host.
  96. Reading and using the quick start should result in you having a
  97. basic understanding of what the Yocto Project is and how to use
  98. some of its core components.
  99. You will also have worked through steps to produce two images:
  100. one suitable for emulation and one that can be used on actual
  101. hardware.
  102. The examples highlight the ease with which you can use the
  103. Yocto Project to create images for multiple types of hardware.
  104. </para>
  105. <para>
  106. For more detailed information on the Yocto Project, you can
  107. reference these resources:
  108. <itemizedlist>
  109. <listitem><para><emphasis>Website:</emphasis>
  110. The
  111. <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
  112. provides the latest builds, breaking news, full development
  113. documentation, and access to a rich Yocto Project
  114. Development Community into which you can tap.
  115. </para></listitem>
  116. <listitem><para><emphasis>FAQs:</emphasis>
  117. Lists commonly asked Yocto Project questions and answers.
  118. You can find two FAQs:
  119. <ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>Yocto Project FAQ</ulink>
  120. on a wiki, and the
  121. "<ulink url='&YOCTO_DOCS_REF_URL;#faq'>FAQ</ulink>"
  122. chapter in the Yocto Project Reference Manual.
  123. </para></listitem>
  124. <listitem><para><emphasis>Developer Screencast:</emphasis>
  125. The
  126. <ulink url='http://vimeo.com/36450321'>Getting Started with the Yocto Project - New Developer Screencast Tutorial</ulink>
  127. provides a 30-minute video created for users unfamiliar
  128. with the Yocto Project but familiar with Linux build
  129. hosts.
  130. While this screencast is somewhat dated, the introductory
  131. and fundamental concepts are useful for the beginner.
  132. </para></listitem>
  133. </itemizedlist>
  134. </para>
  135. </section>
  136. <section id='yp-intro'>
  137. <title>Introducing the Yocto Project Development Environment</title>
  138. <para>
  139. The Yocto Project through the OpenEmbedded build system provides an
  140. open source development environment targeting the ARM, MIPS,
  141. PowerPC, and x86 architectures for a variety of platforms
  142. including x86-64 and emulated ones.
  143. You can use components from the Yocto Project to design, develop,
  144. build, debug, simulate, and test the complete software stack using
  145. Linux, the X Window System, GTK+ frameworks, and Qt frameworks.
  146. </para>
  147. <mediaobject>
  148. <imageobject>
  149. <imagedata fileref="figures/yocto-environment.png"
  150. format="PNG" align='center' scalefit='1' width="100%"/>
  151. </imageobject>
  152. <caption>
  153. <para>The Yocto Project Development Environment</para>
  154. </caption>
  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.7.8 or greater
  265. </para></listitem>
  266. <listitem><para>
  267. tar 1.24 or greater
  268. </para></listitem>
  269. <listitem><para>
  270. Python 2.7.3 or greater excluding Python
  271. 3.x, which is not supported.
  272. </para></listitem>
  273. </itemizedlist>
  274. If your build host does not meet any of these three listed
  275. version requirements, you can take steps to prepare the
  276. system so that you can still use the Yocto Project.
  277. See the
  278. "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
  279. section in the Yocto Project Reference Manual for information.
  280. </para>
  281. </section>
  282. <section id='packages'>
  283. <title>The Build Host Packages</title>
  284. <para>
  285. Required build host packages vary depending on your
  286. build machine and what you want to do with the Yocto Project.
  287. For example, if you want to build an image that can run
  288. on QEMU in graphical mode (a minimal, basic build
  289. requirement), then the build host package requirements
  290. are different than if you want to build an image on a headless
  291. system or build out the Yocto Project documentation set.
  292. </para>
  293. <para>
  294. Collectively, the number of required packages is large
  295. if you want to be able to cover all cases.
  296. <note>
  297. In general, you need to have root access and then install
  298. the required packages.
  299. Thus, the commands in the following section may or may
  300. not work depending on whether or not your Linux
  301. distribution has <filename>sudo</filename> installed.
  302. </note>
  303. </para>
  304. <para>
  305. The following list shows the required packages needed to build
  306. an image that runs on QEMU in graphical mode (e.g. essential
  307. plus graphics support).
  308. For lists of required packages for other scenarios, see the
  309. "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
  310. section in the Yocto Project Reference Manual.
  311. <itemizedlist>
  312. <listitem><para><emphasis>Ubuntu and Debian</emphasis>
  313. <literallayout class='monospaced'>
  314. $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; libsdl1.2-dev xterm
  315. </literallayout>
  316. </para></listitem>
  317. <listitem><para><emphasis>Fedora</emphasis>
  318. <literallayout class='monospaced'>
  319. $ sudo dnf install &FEDORA_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
  320. </literallayout>
  321. <note>
  322. This release of the Yocto Project does not support
  323. the Fedora23 distribution.
  324. If, however, you want to use that distribution,
  325. you must install <filename>perl-bignum</filename>
  326. as a required package.
  327. </note>
  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>
  339. CentOS 6.x users need to ensure that the required
  340. versions of Git, tar and Python are available.
  341. For details, See the
  342. "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
  343. section in the Yocto Project Reference Manual for
  344. information.
  345. </note>
  346. </para></listitem>
  347. </itemizedlist>
  348. </para>
  349. </section>
  350. <section id='releases'>
  351. <title>Yocto Project Release</title>
  352. <para>
  353. The last requirement you need to meet before using the
  354. Yocto Project is getting a Yocto Project release.
  355. It is recommended that you get the latest Yocto Project release
  356. by setting up (cloning in
  357. <ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink> terms) a
  358. local copy of the <filename>poky</filename> Git repository on
  359. your build host and then checking out the latest release.
  360. Doing so allows you to easily update to newer Yocto Project
  361. releases as well as contribute back to the Yocto Project.
  362. </para>
  363. <para>
  364. Here is an example from an Ubuntu build host that clones the
  365. <filename>poky</filename> repository and then checks out the
  366. latest Yocto Project Release (i.e. &DISTRO;):
  367. <literallayout class='monospaced'>
  368. $ git clone git://git.yoctoproject.org/poky
  369. Cloning into 'poky'...
  370. remote: Counting objects: 226790, done.
  371. remote: Compressing objects: 100% (57465/57465), done.
  372. remote: Total 226790 (delta 165212), reused 225887 (delta 164327)
  373. Receiving objects: 100% (226790/226790), 100.98 MiB | 263 KiB/s, done.
  374. Resolving deltas: 100% (165212/165212), done.
  375. $ git checkout &DISTRO_NAME;
  376. </literallayout>
  377. You can also get the Yocto Project Files by downloading
  378. Yocto Project releases from the
  379. <ulink url="&YOCTO_HOME_URL;">Yocto Project website</ulink>.
  380. </para>
  381. <para>
  382. For more information on getting set up with the Yocto Project
  383. release, see the
  384. "<ulink url='&YOCTO_DOCS_DEV_URL;#local-yp-release'>Yocto Project Release</ulink>"
  385. item in the Yocto Project Development Manual.
  386. </para>
  387. </section>
  388. </section>
  389. <section id='qs-building-images'>
  390. <title>Building Images</title>
  391. <para>
  392. Now that you have your system requirements in order, you can give
  393. the Yocto Project a try.
  394. This section presents steps that let you do the following:
  395. <itemizedlist>
  396. <listitem><para>
  397. Build a <filename>qemux86</filename> reference image
  398. and run it in the QEMU emulator.
  399. </para></listitem>
  400. <listitem><para>
  401. Easily change configurations so that you can quickly
  402. create a second image, which would be for MinnowBoard
  403. MAX-compatible boards.
  404. </para></listitem>
  405. </itemizedlist>
  406. <note>
  407. The steps in this section do not provide detail, but rather
  408. provide minimal, working commands and examples designed to
  409. just get you started.
  410. For more details, see the appropriate manuals in the
  411. <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project manual set</ulink>.
  412. </note>
  413. </para>
  414. <para>
  415. Use the following commands to build your image.
  416. The OpenEmbedded build system creates an entire Linux
  417. distribution, including the toolchain, from source.
  418. <note><title>Note about Network Proxies</title>
  419. <para>
  420. By default, the build process searches for source code
  421. using a pre-determined order through a set of
  422. locations.
  423. If you are working behind a firewall and your build
  424. host is not set up for proxies, you could encounter
  425. problems with the build process when fetching source
  426. code (e.g. fetcher failures or Git failures).
  427. </para>
  428. <para>
  429. If you do not know your proxy settings, consult your
  430. local network infrastructure resources and get that
  431. information.
  432. A good starting point could also be to check your web
  433. browser settings.
  434. Finally, you can find more information on using the
  435. Yocto Project behind a firewall in the Yocto Project
  436. Reference Manual
  437. <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>
  438. and on the
  439. "<ulink url='https://wiki.yoctoproject.org/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>"
  440. wiki page.
  441. </para>
  442. </note>
  443. </para>
  444. <para>
  445. <orderedlist>
  446. <listitem><para><emphasis>Be Sure Your Build Host is Set Up:</emphasis>
  447. The steps to build an image in this section depend on
  448. your build host being properly set up.
  449. Be sure you have worked through the requirements
  450. described in the
  451. "<link linkend='yp-resources'>Setting Up to Use the Yocto Project</link>"
  452. section.
  453. </para></listitem>
  454. <listitem><para><emphasis>Check Out Your Branch:</emphasis>
  455. Be sure you are in the
  456. <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
  457. (e.g. <filename>poky</filename>) and then check out
  458. the branch associated with the latest Yocto Project
  459. Release:
  460. <literallayout class='monospaced'>
  461. $ cd ~/poky
  462. $ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME;
  463. </literallayout>
  464. Git's <filename>checkout</filename> command checks out
  465. the current Yocto Project release into a local branch
  466. whose name matches the release (i.e.
  467. <filename>&DISTRO_NAME;</filename>).
  468. The local branch tracks the upstream branch of the
  469. same name.
  470. Creating your own branch based on the released
  471. branch ensures you are using the latest files for
  472. that release.
  473. </para></listitem>
  474. <listitem><para><emphasis>Initialize the Build Environment:</emphasis>
  475. Run the
  476. <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
  477. environment setup script to define the OpenEmbedded
  478. build environment on your build host.
  479. <literallayout class='monospaced'>
  480. $ source &OE_INIT_FILE;
  481. </literallayout>
  482. Among other things, the script creates the
  483. <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
  484. which is <filename>build</filename> in this case
  485. and is located in the
  486. <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
  487. After the script runs, your current working directory
  488. is set to the Build Directory.
  489. Later, when the build completes, the Build Directory
  490. contains all the files created during the build.
  491. <note>
  492. For information on running a memory-resident
  493. <ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>,
  494. see the
  495. <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>
  496. setup script.
  497. </note>
  498. </para></listitem>
  499. <listitem><para><emphasis>Examine Your Local Configuration File:</emphasis>
  500. When you set up the build environment, a local
  501. configuration file named
  502. <filename>local.conf</filename> becomes available in
  503. a <filename>conf</filename> subdirectory of the
  504. Build Directory.
  505. Before using BitBake to start the build, you can
  506. look at this file and be sure your general
  507. configurations are how you want them:
  508. <itemizedlist>
  509. <listitem><para>
  510. To help conserve disk space during builds,
  511. you can add the following statement to your
  512. project's configuration file, which for this
  513. example is
  514. <filename>poky/build/conf/local.conf</filename>.
  515. Adding this statement deletes the work
  516. directory used for building a recipe once the
  517. recipe is built.
  518. <literallayout class='monospaced'>
  519. INHERIT += "rm_work"
  520. </literallayout>
  521. </para></listitem>
  522. <listitem><para>
  523. By default, the target machine for the build is
  524. <filename>qemux86</filename>,
  525. which produces an image that can be used in
  526. the QEMU emulator and is targeted at an
  527. <trademark class='registered'>Intel</trademark>
  528. 32-bit based architecture.
  529. Further on in this example, this default is
  530. easily changed through the
  531. <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
  532. variable so that you can quickly
  533. build an image for a different machine.
  534. </para></listitem>
  535. <listitem><para>
  536. Another consideration before you build is the
  537. package manager used when creating the image.
  538. The default <filename>local.conf</filename>
  539. file selects the RPM package manager.
  540. You can control this configuration by using the
  541. <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink></filename>
  542. variable.</para>
  543. <para>Selection of the package manager is separate
  544. from whether package management is used at runtime
  545. in the target image.</para>
  546. <para>For additional package manager selection
  547. information, see the
  548. "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-package'><filename>package*.bbclass</filename></ulink>"
  549. section in the Yocto Project Reference Manual.
  550. </para></listitem>
  551. </itemizedlist>
  552. </para></listitem>
  553. <listitem><para><emphasis>Start the Build:</emphasis>
  554. Continue with the following command to build an OS image
  555. for the target, which is
  556. <filename>core-image-sato</filename> in this example:
  557. <note>
  558. Depending on the number of processors and cores, the
  559. amount of RAM, the speed of your Internet connection
  560. and other factors, the build process could take several
  561. hours the first time you run it.
  562. Subsequent builds run much faster since parts of the
  563. build are cached.
  564. </note>
  565. <literallayout class='monospaced'>
  566. $ bitbake core-image-sato
  567. </literallayout>
  568. For information on using the
  569. <filename>bitbake</filename> command, see the
  570. "<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>"
  571. section in the Yocto Project Reference Manual, or see the
  572. "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-command'>BitBake Command</ulink>"
  573. section in the BitBake User Manual.
  574. For information on other targets, see the
  575. "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
  576. chapter in the Yocto Project Reference Manual.
  577. </para></listitem>
  578. <listitem><para><emphasis>Simulate Your Image Using QEMU:</emphasis>
  579. Once this particular image is built, you can start QEMU
  580. and run the image:
  581. <literallayout class='monospaced'>
  582. $ runqemu qemux86
  583. </literallayout>
  584. If you want to learn more about running QEMU, see the
  585. "<ulink url="&YOCTO_DOCS_DEV_URL;#dev-manual-qemu">Using the Quick EMUlator (QEMU)</ulink>"
  586. chapter in the Yocto Project Development Manual.
  587. </para></listitem>
  588. <listitem><para><emphasis>Exit QEMU:</emphasis>
  589. Exit QEMU by either clicking on the shutdown icon or by
  590. opening a terminal, typing
  591. <filename>poweroff</filename>, and then pressing "Enter".
  592. </para></listitem>
  593. </orderedlist>
  594. </para>
  595. <para id='qs-minnowboard-example'>
  596. The following steps show how easy it is to set up to build an
  597. image for a new machine.
  598. These steps build an image for the MinnowBoard MAX, which is
  599. supported by the Yocto Project and the
  600. <filename>meta-intel</filename> <filename>intel-corei7-64</filename>
  601. and <filename>intel-core2-32</filename> Board Support Packages
  602. (BSPs).
  603. <note>
  604. The MinnowBoard MAX ships with 64-bit firmware.
  605. If you want to use the board in 32-bit mode, you must
  606. download the
  607. <ulink url='http://firmware.intel.com/projects/minnowboard-max'>32-bit firmware</ulink>.
  608. </note>
  609. </para>
  610. <para>
  611. <orderedlist>
  612. <listitem><para><emphasis>Create a Local Copy of the
  613. <filename>meta-intel</filename> Repository:</emphasis>
  614. Building an image for the MinnowBoard MAX requires the
  615. <filename>meta-intel</filename> layer.
  616. Use the <filename>git clone</filename> command to create
  617. a local copy of the repository inside your
  618. <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
  619. which is <filename>poky</filename> in this example:
  620. <literallayout class='monospaced'>
  621. $ cd $HOME/poky
  622. $ git clone git://git.yoctoproject.org/meta-intel
  623. Cloning into 'meta-intel'...
  624. remote: Counting objects: 11988, done.
  625. remote: Compressing objects: 100% (3884/3884), done.
  626. Receiving objects: 100% (11988/11988), 2.93 MiB | 2.51 MiB/s, done.
  627. remote: Total 11988 (delta 6881), reused 11752 (delta 6645)
  628. Resolving deltas: 100% (6881/6881), done.
  629. Checking connectivity... done.
  630. </literallayout>
  631. By default when you clone a Git repository, the
  632. "master" branch is checked out.
  633. Before you build your image that uses the
  634. <filename>meta-intel</filename> layer, you must be
  635. sure that both repositories
  636. (<filename>meta-intel</filename> and
  637. <filename>poky</filename>) are using the same releases.
  638. Consequently, you need to checkout out the
  639. "&DISTRO_NAME_NO_CAP;" release after cloning
  640. <filename>meta-intel</filename>:
  641. <literallayout class='monospaced'>
  642. $ cd $HOME/poky/meta-intel
  643. $ git checkout &DISTRO_NAME_NO_CAP;
  644. Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
  645. Switched to a new branch '&DISTRO_NAME_NO_CAP;'
  646. </literallayout>
  647. </para></listitem>
  648. <listitem><para><emphasis>Configure the Build:</emphasis>
  649. To configure the build, you edit the
  650. <filename>bblayers.conf</filename> and
  651. <filename>local.conf</filename> files, both of which are
  652. located in the <filename>build/conf</filename> directory.
  653. </para>
  654. <para>Here is a quick way to make the edits.
  655. The first command uses the
  656. <filename>bitbake-layers add-layer</filename> command
  657. to add the <filename>meta-intel</filename>
  658. layer, which contains the <filename>intel-core*</filename>
  659. BSPs to the build.
  660. The second command selects the BSP by setting the
  661. <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
  662. variable.
  663. <literallayout class='monospaced'>
  664. $ cd $HOME/poky/build
  665. $ bitbake-layers add-layer "$HOME/poky/meta-intel"
  666. $ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
  667. </literallayout>
  668. <note><title>Notes</title>
  669. <para>
  670. If you want a 64-bit build, use the following:
  671. <literallayout class='monospaced'>
  672. $ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
  673. </literallayout>
  674. </para>
  675. <para>
  676. If you want 32-bit images, use the following:
  677. <literallayout class='monospaced'>
  678. $ echo 'MACHINE = "intel-core2-32"' >> conf/local.conf
  679. </literallayout>
  680. </para>
  681. </note>
  682. </para></listitem>
  683. <listitem><para><emphasis>Build a Minimal Image for MinnowBoard MAX:</emphasis>
  684. Use the following command to build the minimal image for
  685. MinnowBoard MAX.
  686. Because configuration changes are minimal to set up for
  687. this second build, the OpenEmbedded build system can
  688. re-use files from previous builds as much as possible.
  689. Re-using files means this second build will be much faster
  690. than an initial build.
  691. <literallayout class='monospaced'>
  692. $ bitbake core-image-minimal
  693. </literallayout>
  694. Once the build completes, the resulting basic console image
  695. is located in the Build Directory here:
  696. <literallayout class='monospaced'>
  697. tmp/deploy/images/intel-corei7-64/core-image-minimal-intel-corei7-64.hddimg
  698. </literallayout>
  699. </para></listitem>
  700. <listitem><para><emphasis>Write the Image:</emphasis>
  701. You can write the image to a USB key, SATA drive, or SD
  702. card by using the <filename>mkefidisk.sh</filename> script,
  703. which is included in the <filename>poky</filename>
  704. repository at
  705. <filename>scripts/contrib/mkefidisk.sh</filename>:
  706. <literallayout class='monospaced'>
  707. $ sudo $HOME/source/poky/scripts/contrib/mkefidisk.sh <replaceable>HOST_DEVICE</replaceable> \
  708. tmp/deploy/images/intel-corei7-64/core-image-minimal-intel-corei7-64.hddimg <replaceable>TARGET_DEVICE</replaceable>
  709. </literallayout>
  710. In the previous command,
  711. <replaceable>HOST_DEVICE</replaceable> is the device node
  712. on the build host (e.g. <filename>/dev/sdc</filename> or
  713. <filename>/dev/mmcblk0</filename>).
  714. <replaceable>TARGET_DEVICE</replaceable> is the name of the
  715. device as the MinnowBoard MAX sees it (e.g.
  716. <filename>/dev/sda</filename> or
  717. <filename>/dev/mmcblk0</filename>).
  718. </para></listitem>
  719. <listitem><para><emphasis>Boot the Hardware:</emphasis>
  720. With the boot device provisioned, you can insert the
  721. media into the MinnowBoard MAX and boot the hardware.
  722. The board should automatically detect the media and boot to
  723. the bootloader and subsequently the operating system.
  724. </para>
  725. <para>If the board does not boot automatically, you can
  726. boot it manually from the EFI shell as follows:
  727. <literallayout class='monospaced'>
  728. Shell> connect -r
  729. Shell> map -r
  730. Shell> fs0:
  731. Shell> bootx64
  732. </literallayout>
  733. <note>
  734. For a 32-bit image use the following:
  735. <literallayout class='monospaced'>
  736. Shell> bootia32
  737. </literallayout>
  738. </note>
  739. </para></listitem>
  740. </orderedlist>
  741. </para>
  742. </section>
  743. <section id='qs-next-steps'>
  744. <title>Next Steps</title>
  745. <para>
  746. If you completed all the steps in the previous section then
  747. congratulations to you!
  748. What now?
  749. </para>
  750. <para>
  751. Depending on what you primary interests are with the Yocto Project,
  752. you could consider any of the following:
  753. <itemizedlist>
  754. <listitem><para><emphasis>Visit the Yocto Project Web Site:</emphasis>
  755. The official
  756. <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink>
  757. web site contains information on the entire project.
  758. Visiting this site is a good way to familiarize yourself
  759. with the overall project.
  760. </para></listitem>
  761. <listitem><para><emphasis>Explore Development Models:</emphasis>
  762. You can see the
  763. "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-model'>Common Development Models</ulink>"
  764. section in the Yocto Project Development Manual
  765. to get an overview of the various ways by which
  766. you can use the Yocto Project to develop projects.
  767. </para></listitem>
  768. <listitem><para><emphasis>Learn Some Open Source Basics:</emphasis>
  769. If you are new to the open source environment, you might
  770. read the
  771. "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-newbie'>The Yocto Project Open Source Development Environment</ulink>"
  772. chapter of the Yocto Project Development Manual.
  773. This chapter presents overview material for open source
  774. development in the context of the Yocto Project.
  775. </para></listitem>
  776. <listitem><para><emphasis>Learn About Application Development:</emphasis>
  777. If your primary interests lie in developing applications,
  778. you can reference the
  779. <ulink url='&YOCTO_DOCS_ADT_URL;#adt-manual-intro'>Yocto Project Application Developer's Guide</ulink>.
  780. </para></listitem>
  781. <listitem><para><emphasis>Learn About Board Support Packages (BSPs):</emphasis>
  782. If you want to learn about BSPs, see the
  783. <ulink url='&YOCTO_DOCS_BSP_URL;#bsp'>Yocto Project Board Support Packages (BSP) Developer's Guide</ulink>.
  784. </para></listitem>
  785. <listitem><para><emphasis>Learn About Using Eclipse With the Yocto Project:</emphasis>
  786. If you are an Eclipse user, you can learn about using the
  787. Yocto Project in that development environment by reading
  788. the
  789. "<ulink url='&YOCTO_DOCS_DEV_URL;#workflow-using-the-adt-and-eclipse'>Workflow Using the ADT and Eclipse™</ulink>"
  790. section in the Yocto Project Development Manual.
  791. </para></listitem>
  792. <listitem><para><emphasis>Learn About Toaster:</emphasis>
  793. Toaster is a web interface to the Yocto Project's
  794. OpenEmbedded build system.
  795. If you are interested in using this type of interface to
  796. create images, see the
  797. <ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-intro'>Toaster User Manual</ulink>.
  798. </para></listitem>
  799. <listitem><para><emphasis>Explore Yocto Project Common Tasks and Technical Details:</emphasis>
  800. If you are interested in a mix of common tasks that have to
  801. do with project develop using the Yocto Project, see the
  802. "<ulink url='&YOCTO_DOCS_DEV_URL;#extendpoky'>Common Tasks</ulink>"
  803. section of the Yocto Project Development Manual.
  804. If you want more detail, see the
  805. <ulink url='&YOCTO_DOCS_REF_URL;#ref-manual-intro'>Yocto Project Reference Manual</ulink>.
  806. </para></listitem>
  807. </itemizedlist>
  808. </para>
  809. </section>
  810. </article>
  811. <!--
  812. vim: expandtab tw=80 ts=4
  813. -->