faq.xml 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835
  1. <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  2. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
  3. [<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
  4. <chapter id='faq'>
  5. <title>FAQ</title>
  6. <qandaset>
  7. <qandaentry>
  8. <question>
  9. <para>
  10. How does Poky differ from <ulink url='&OE_HOME_URL;'>OpenEmbedded</ulink>?
  11. </para>
  12. </question>
  13. <answer>
  14. <para>
  15. The term "<ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>"
  16. refers to the specific reference build system that
  17. the Yocto Project provides.
  18. Poky is based on <ulink url='&YOCTO_DOCS_DEV_URL;#oe-core'>OE-Core</ulink>
  19. and <link linkend='bitbake-term'>BitBake</link>.
  20. Thus, the generic term used here for the build system is
  21. the "OpenEmbedded build system."
  22. Development in the Yocto Project using Poky is closely tied to OpenEmbedded, with
  23. changes always being merged to OE-Core or BitBake first before being pulled back
  24. into Poky.
  25. This practice benefits both projects immediately.
  26. </para>
  27. </answer>
  28. </qandaentry>
  29. <qandaentry>
  30. <question>
  31. <para id='faq-not-meeting-requirements'>
  32. My development system does not meet the
  33. required Git, tar, and Python versions.
  34. In particular, I do not have Python 3.4.0 or greater.
  35. Can I still use the Yocto Project?
  36. </para>
  37. </question>
  38. <answer>
  39. <para>
  40. You can get the required tools on your host development
  41. system a couple different ways (i.e. building a tarball or
  42. downloading a tarball).
  43. See the
  44. "<link linkend='required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</link>"
  45. section for steps on how to update your build tools.
  46. </para>
  47. </answer>
  48. </qandaentry>
  49. <qandaentry>
  50. <question>
  51. <para>
  52. How can you claim Poky / OpenEmbedded-Core is stable?
  53. </para>
  54. </question>
  55. <answer>
  56. <para>
  57. There are three areas that help with stability;
  58. <itemizedlist>
  59. <listitem><para>The Yocto Project team keeps
  60. <ulink url='&YOCTO_DOCS_DEV_URL;#oe-core'>OE-Core</ulink> small
  61. and focused, containing around 830 recipes as opposed to the thousands
  62. available in other OpenEmbedded community layers.
  63. Keeping it small makes it easy to test and maintain.</para></listitem>
  64. <listitem><para>The Yocto Project team runs manual and automated tests
  65. using a small, fixed set of reference hardware as well as emulated
  66. targets.</para></listitem>
  67. <listitem><para>The Yocto Project uses an autobuilder,
  68. which provides continuous build and integration tests.</para></listitem>
  69. </itemizedlist>
  70. </para>
  71. </answer>
  72. </qandaentry>
  73. <qandaentry>
  74. <question>
  75. <para>
  76. How do I get support for my board added to the Yocto Project?
  77. </para>
  78. </question>
  79. <answer>
  80. <para>
  81. Support for an additional board is added by creating a
  82. Board Support Package (BSP) layer for it.
  83. For more information on how to create a BSP layer, see the
  84. "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
  85. section in the Yocto Project Development Manual and the
  86. <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
  87. </para>
  88. <para>
  89. Usually, if the board is not completely exotic, adding support in
  90. the Yocto Project is fairly straightforward.
  91. </para>
  92. </answer>
  93. </qandaentry>
  94. <qandaentry>
  95. <question>
  96. <para>
  97. Are there any products built using the OpenEmbedded build system?
  98. </para>
  99. </question>
  100. <answer>
  101. <para>
  102. The software running on the <ulink url='http://vernier.com/labquest/'>Vernier LabQuest</ulink>
  103. is built using the OpenEmbedded build system.
  104. See the <ulink url='http://www.vernier.com/products/interfaces/labq/'>Vernier LabQuest</ulink>
  105. website for more information.
  106. There are a number of pre-production devices using the OpenEmbedded build system
  107. and the Yocto Project team
  108. announces them as soon as they are released.
  109. </para>
  110. </answer>
  111. </qandaentry>
  112. <qandaentry>
  113. <question>
  114. <para>
  115. What does the OpenEmbedded build system produce as output?
  116. </para>
  117. </question>
  118. <answer>
  119. <para>
  120. Because you can use the same set of recipes to create output of
  121. various formats, the output of an OpenEmbedded build depends on
  122. how you start it.
  123. Usually, the output is a flashable image ready for the target
  124. device.
  125. </para>
  126. </answer>
  127. </qandaentry>
  128. <qandaentry>
  129. <question>
  130. <para>
  131. How do I add my package to the Yocto Project?
  132. </para>
  133. </question>
  134. <answer>
  135. <para>
  136. To add a package, you need to create a BitBake recipe.
  137. For information on how to create a BitBake recipe, see the
  138. "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-writing-a-new-recipe'>Writing a New Recipe</ulink>"
  139. in the Yocto Project Development Manual.
  140. </para>
  141. </answer>
  142. </qandaentry>
  143. <qandaentry>
  144. <question>
  145. <para>
  146. Do I have to reflash my entire board with a new Yocto Project image when recompiling
  147. a package?
  148. </para>
  149. </question>
  150. <answer>
  151. <para>
  152. The OpenEmbedded build system can build packages in various
  153. formats such as IPK for OPKG, Debian package
  154. (<filename>.deb</filename>), or RPM.
  155. You can then upgrade the packages using the package tools on
  156. the device, much like on a desktop distribution such as
  157. Ubuntu or Fedora.
  158. However, package management on the target is entirely optional.
  159. </para>
  160. </answer>
  161. </qandaentry>
  162. <qandaentry>
  163. <question>
  164. <para>
  165. I see the error '<filename>chmod: XXXXX new permissions are r-xrwxrwx, not r-xr-xr-x</filename>'.
  166. What is wrong?
  167. </para>
  168. </question>
  169. <answer>
  170. <para>
  171. You are probably running the build on an NTFS filesystem.
  172. Use <filename>ext2</filename>, <filename>ext3</filename>, or <filename>ext4</filename> instead.
  173. </para>
  174. </answer>
  175. </qandaentry>
  176. <!-- <qandaentry>
  177. <question>
  178. <para>
  179. How do I make the Yocto Project work in RHEL/CentOS?
  180. </para>
  181. </question>
  182. <answer>
  183. <para>
  184. To get the Yocto Project working under RHEL/CentOS 5.1 you need to first
  185. install some required packages.
  186. The standard CentOS packages needed are:
  187. <itemizedlist>
  188. <listitem><para>"Development tools" (selected during installation)</para></listitem>
  189. <listitem><para><filename>texi2html</filename></para></listitem>
  190. <listitem><para><filename>compat-gcc-34</filename></para></listitem>
  191. </itemizedlist>
  192. On top of these, you need the following external packages:
  193. <itemizedlist>
  194. <listitem><para><filename>python-sqlite2</filename> from
  195. <ulink url='http://dag.wieers.com/rpm/packages/python-sqlite2/'>DAG repository</ulink>
  196. </para></listitem>
  197. <listitem><para><filename>help2man</filename> from
  198. <ulink url='http://centos.karan.org/el4/extras/stable/x86_64/RPMS/repodata/repoview/help2man-0-1.33.1-2.html'>Karan repository</ulink></para></listitem>
  199. </itemizedlist>
  200. </para>
  201. <para>
  202. Once these packages are installed, the OpenEmbedded build system will be able
  203. to build standard images.
  204. However, there might be a problem with the QEMU emulator segfaulting.
  205. You can either disable the generation of binary locales by setting
  206. <filename><link linkend='var-ENABLE_BINARY_LOCALE_GENERATION'>ENABLE_BINARY_LOCALE_GENERATION</link>
  207. </filename> to "0" or by removing the <filename>linux-2.6-execshield.patch</filename>
  208. from the kernel and rebuilding it since that is the patch that causes the problems with QEMU.
  209. </para>
  210. <note>
  211. <para>For information on distributions that the Yocto Project
  212. uses during validation, see the
  213. <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>
  214. Wiki page.</para>
  215. <para>For notes about using the Yocto Project on a RHEL 4-based
  216. host, see the
  217. <ulink url='&YOCTO_WIKI_URL;/wiki/BuildingOnRHEL4'>Building on RHEL4</ulink>
  218. Wiki page.</para>
  219. </note>
  220. </answer>
  221. </qandaentry> -->
  222. <qandaentry>
  223. <question>
  224. <para>
  225. I see lots of 404 responses for files on
  226. <filename>&YOCTO_HOME_URL;/sources/*</filename>. Is something wrong?
  227. </para>
  228. </question>
  229. <answer>
  230. <para>
  231. Nothing is wrong.
  232. The OpenEmbedded build system checks any configured source mirrors before downloading
  233. from the upstream sources.
  234. The build system does this searching for both source archives and
  235. pre-checked out versions of SCM-managed software.
  236. These checks help in large installations because it can reduce load on the SCM servers
  237. themselves.
  238. The address above is one of the default mirrors configured into the
  239. build system.
  240. Consequently, if an upstream source disappears, the team
  241. can place sources there so builds continue to work.
  242. </para>
  243. </answer>
  244. </qandaentry>
  245. <qandaentry>
  246. <question>
  247. <para>
  248. I have machine-specific data in a package for one machine only but the package is
  249. being marked as machine-specific in all cases, how do I prevent this?
  250. </para>
  251. </question>
  252. <answer>
  253. <para>
  254. Set <filename><link linkend='var-SRC_URI_OVERRIDES_PACKAGE_ARCH'>SRC_URI_OVERRIDES_PACKAGE_ARCH</link>
  255. </filename> = "0" in the <filename>.bb</filename> file but make sure the package is
  256. manually marked as
  257. machine-specific for the case that needs it.
  258. The code that handles
  259. <filename>SRC_URI_OVERRIDES_PACKAGE_ARCH</filename> is in
  260. the <filename>meta/classes/base.bbclass</filename> file.
  261. </para>
  262. </answer>
  263. </qandaentry>
  264. <qandaentry>
  265. <question>
  266. <para id='i-am-behind-a-firewall-and-need-to-use-a-proxy-server'>
  267. I'm behind a firewall and need to use a proxy server. How do I do that?
  268. </para>
  269. </question>
  270. <answer>
  271. <para>
  272. Most source fetching by the OpenEmbedded build system is done
  273. by <filename>wget</filename> and you therefore need to specify
  274. the proxy settings in a <filename>.wgetrc</filename> file,
  275. which can be in your home directory if you are a single user
  276. or can be in <filename>/usr/local/etc/wgetrc</filename> as
  277. a global user file.
  278. </para>
  279. <para>
  280. Following is the applicable code for setting various proxy
  281. types in the <filename>.wgetrc</filename> file.
  282. By default, these settings are disabled with comments.
  283. To use them, remove the comments:
  284. <literallayout class='monospaced'>
  285. # You can set the default proxies for Wget to use for http, https, and ftp.
  286. # They will override the value in the environment.
  287. #https_proxy = http://proxy.yoyodyne.com:18023/
  288. #http_proxy = http://proxy.yoyodyne.com:18023/
  289. #ftp_proxy = http://proxy.yoyodyne.com:18023/
  290. # If you do not want to use proxy at all, set this to off.
  291. #use_proxy = on
  292. </literallayout>
  293. The Yocto Project also includes a
  294. <filename>meta-poky/conf/site.conf.sample</filename> file that
  295. shows how to configure CVS and Git proxy servers if needed.
  296. For more information on setting up various proxy types and
  297. configuring proxy servers, see the
  298. "<ulink url='&YOCTO_WIKI_URL;/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>"
  299. Wiki page.
  300. </para>
  301. </answer>
  302. </qandaentry>
  303. <qandaentry>
  304. <question>
  305. <para>
  306. What’s the difference between <replaceable>target</replaceable> and <replaceable>target</replaceable><filename>-native</filename>?
  307. </para>
  308. </question>
  309. <answer>
  310. <para>
  311. The <filename>*-native</filename> targets are designed to run on the system
  312. being used for the build.
  313. These are usually tools that are needed to assist the build in some way such as
  314. <filename>quilt-native</filename>, which is used to apply patches.
  315. The non-native version is the one that runs on the target device.
  316. </para>
  317. </answer>
  318. </qandaentry>
  319. <qandaentry>
  320. <question>
  321. <para>
  322. I'm seeing random build failures. Help?!
  323. </para>
  324. </question>
  325. <answer>
  326. <para>
  327. If the same build is failing in totally different and random
  328. ways, the most likely explanation is:
  329. <itemizedlist>
  330. <listitem><para>The hardware you are running the build on
  331. has some problem.</para></listitem>
  332. <listitem><para>You are running the build under
  333. virtualization, in which case the virtualization
  334. probably has bugs.</para></listitem>
  335. </itemizedlist>
  336. The OpenEmbedded build system processes a massive amount of
  337. data that causes lots of network, disk and CPU activity and
  338. is sensitive to even single-bit failures in any of these areas.
  339. True random failures have always been traced back to hardware
  340. or virtualization issues.
  341. </para>
  342. </answer>
  343. </qandaentry>
  344. <qandaentry>
  345. <question>
  346. <para>
  347. When I try to build a native recipe, the build fails with <filename>iconv.h</filename> problems.
  348. </para>
  349. </question>
  350. <answer>
  351. <para>
  352. If you get an error message that indicates GNU
  353. <filename>libiconv</filename> is not in use but
  354. <filename>iconv.h</filename> has been included from
  355. <filename>libiconv</filename>, you need to check to see if
  356. you have a previously installed version of the header file
  357. in <filename>/usr/local/include</filename>.
  358. <literallayout class='monospaced'>
  359. #error GNU libiconv not in use but included iconv.h is from libiconv
  360. </literallayout>
  361. If you find a previously installed file, you should either
  362. uninstall it or temporarily rename it and try the build again.
  363. </para>
  364. <para>
  365. This issue is just a single manifestation of "system
  366. leakage" issues caused when the OpenEmbedded build system
  367. finds and uses previously installed files during a native
  368. build.
  369. This type of issue might not be limited to
  370. <filename>iconv.h</filename>.
  371. Be sure that leakage cannot occur from
  372. <filename>/usr/local/include</filename> and
  373. <filename>/opt</filename> locations.
  374. </para>
  375. </answer>
  376. </qandaentry>
  377. <qandaentry>
  378. <question>
  379. <para>
  380. What do we need to ship for license compliance?
  381. </para>
  382. </question>
  383. <answer>
  384. <para>
  385. This is a difficult question and you need to consult your lawyer
  386. for the answer for your specific case.
  387. It is worth bearing in mind that for GPL compliance, there needs
  388. to be enough information shipped to allow someone else to
  389. rebuild and produce the same end result you are shipping.
  390. This means sharing the source code, any patches applied to it,
  391. and also any configuration information about how that package
  392. was configured and built.
  393. </para>
  394. <para>
  395. You can find more information on licensing in the
  396. "<ulink url='&YOCTO_DOCS_REF_URL;#licensing'>Licensing</ulink>"
  397. and "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>"
  398. sections, both of which are in the Yocto Project Development
  399. Manual.
  400. </para>
  401. </answer>
  402. </qandaentry>
  403. <qandaentry>
  404. <question>
  405. <para>
  406. How do I disable the cursor on my touchscreen device?
  407. </para>
  408. </question>
  409. <answer>
  410. <para>
  411. You need to create a form factor file as described in the
  412. "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout-misc-recipes'>Miscellaneous BSP-Specific Recipe Files</ulink>"
  413. section in the Yocto Project Board Support Packages (BSP)
  414. Developer's Guide.
  415. Set the <filename>HAVE_TOUCHSCREEN</filename> variable equal to
  416. one as follows:
  417. <literallayout class='monospaced'>
  418. HAVE_TOUCHSCREEN=1
  419. </literallayout>
  420. </para>
  421. </answer>
  422. </qandaentry>
  423. <qandaentry>
  424. <question>
  425. <para>
  426. How do I make sure connected network interfaces are brought up by default?
  427. </para>
  428. </question>
  429. <answer>
  430. <para>
  431. The default interfaces file provided by the netbase recipe does not
  432. automatically bring up network interfaces.
  433. Therefore, you will need to add a BSP-specific netbase that includes an interfaces
  434. file.
  435. See the "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout-misc-recipes'>Miscellaneous BSP-Specific Recipe Files</ulink>"
  436. section in the Yocto Project Board Support Packages (BSP)
  437. Developer's Guide for information on creating these types of
  438. miscellaneous recipe files.
  439. </para>
  440. <para>
  441. For example, add the following files to your layer:
  442. <literallayout class='monospaced'>
  443. meta-MACHINE/recipes-bsp/netbase/netbase/MACHINE/interfaces
  444. meta-MACHINE/recipes-bsp/netbase/netbase_5.0.bbappend
  445. </literallayout>
  446. </para>
  447. </answer>
  448. </qandaentry>
  449. <qandaentry>
  450. <question>
  451. <para>
  452. How do I create images with more free space?
  453. </para>
  454. </question>
  455. <answer>
  456. <para>
  457. By default, the OpenEmbedded build system creates images
  458. that are 1.3 times the size of the populated root filesystem.
  459. To affect the image size, you need to set various
  460. configurations:
  461. <itemizedlist>
  462. <listitem><para><emphasis>Image Size:</emphasis>
  463. The OpenEmbedded build system uses the
  464. <link linkend='var-IMAGE_ROOTFS_SIZE'><filename>IMAGE_ROOTFS_SIZE</filename></link>
  465. variable to define the size of the image in Kbytes.
  466. The build system determines the size by taking into
  467. account the initial root filesystem size before any
  468. modifications such as requested size for the image and
  469. any requested additional free disk space to be
  470. added to the image.</para></listitem>
  471. <listitem><para><emphasis>Overhead:</emphasis>
  472. Use the
  473. <link linkend='var-IMAGE_OVERHEAD_FACTOR'><filename>IMAGE_OVERHEAD_FACTOR</filename></link>
  474. variable to define the multiplier that the build system
  475. applies to the initial image size, which is 1.3 by
  476. default.</para></listitem>
  477. <listitem><para><emphasis>Additional Free Space:</emphasis>
  478. Use the
  479. <link linkend='var-IMAGE_ROOTFS_EXTRA_SPACE'><filename>IMAGE_ROOTFS_EXTRA_SPACE</filename></link>
  480. variable to add additional free space to the image.
  481. The build system adds this space to the image after
  482. it determines its
  483. <filename>IMAGE_ROOTFS_SIZE</filename>.
  484. </para></listitem>
  485. </itemizedlist>
  486. </para>
  487. </answer>
  488. </qandaentry>
  489. <qandaentry>
  490. <question>
  491. <para>
  492. Why don't you support directories with spaces in the pathnames?
  493. </para>
  494. </question>
  495. <answer>
  496. <para>
  497. The Yocto Project team has tried to do this before but too
  498. many of the tools the OpenEmbedded build system depends on,
  499. such as <filename>autoconf</filename>, break when they find
  500. spaces in pathnames.
  501. Until that situation changes, the team will not support spaces
  502. in pathnames.
  503. </para>
  504. </answer>
  505. </qandaentry>
  506. <qandaentry>
  507. <question>
  508. <para>
  509. How do I use an external toolchain?
  510. </para>
  511. </question>
  512. <answer>
  513. <para>
  514. The toolchain configuration is very flexible and customizable.
  515. It is primarily controlled with the
  516. <filename><link linkend='var-TCMODE'>TCMODE</link></filename>
  517. variable.
  518. This variable controls which <filename>tcmode-*.inc</filename>
  519. file to include from the
  520. <filename>meta/conf/distro/include</filename> directory within
  521. the
  522. <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
  523. </para>
  524. <para>
  525. The default value of <filename>TCMODE</filename> is "default",
  526. which tells the OpenEmbedded build system to use its internally
  527. built toolchain (i.e. <filename>tcmode-default.inc</filename>).
  528. However, other patterns are accepted.
  529. In particular, "external-*" refers to external toolchains.
  530. One example is the Sourcery G++ Toolchain.
  531. The support for this toolchain resides in the separate
  532. <filename>meta-sourcery</filename> layer at
  533. <ulink url='http://github.com/MentorEmbedded/meta-sourcery/'></ulink>.
  534. </para>
  535. <para>
  536. In addition to the toolchain configuration, you also need a
  537. corresponding toolchain recipe file.
  538. This recipe file needs to package up any pre-built objects in
  539. the toolchain such as <filename>libgcc</filename>,
  540. <filename>libstdcc++</filename>, any locales, and
  541. <filename>libc</filename>.
  542. </para>
  543. </answer>
  544. </qandaentry>
  545. <qandaentry>
  546. <question>
  547. <para id='how-does-the-yocto-project-obtain-source-code-and-will-it-work-behind-my-firewall-or-proxy-server'>
  548. How does the OpenEmbedded build system obtain source code and
  549. will it work behind my firewall or proxy server?
  550. </para>
  551. </question>
  552. <answer>
  553. <para>
  554. The way the build system obtains source code is highly
  555. configurable.
  556. You can setup the build system to get source code in most
  557. environments if HTTP transport is available.
  558. </para>
  559. <para>
  560. When the build system searches for source code, it first
  561. tries the local download directory.
  562. If that location fails, Poky tries
  563. <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>,
  564. the upstream source, and then
  565. <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link>
  566. in that order.
  567. </para>
  568. <para>
  569. Assuming your distribution is "poky", the OpenEmbedded build
  570. system uses the Yocto Project source
  571. <filename>PREMIRRORS</filename> by default for SCM-based
  572. sources, upstreams for normal tarballs, and then falls back
  573. to a number of other mirrors including the Yocto Project
  574. source mirror if those fail.
  575. </para>
  576. <para>
  577. As an example, you could add a specific server for the
  578. build system to attempt before any others by adding something
  579. like the following to the <filename>local.conf</filename>
  580. configuration file:
  581. <literallayout class='monospaced'>
  582. PREMIRRORS_prepend = "\
  583. git://.*/.* http://www.yoctoproject.org/sources/ \n \
  584. ftp://.*/.* http://www.yoctoproject.org/sources/ \n \
  585. http://.*/.* http://www.yoctoproject.org/sources/ \n \
  586. https://.*/.* http://www.yoctoproject.org/sources/ \n"
  587. </literallayout>
  588. </para>
  589. <para>
  590. These changes cause the build system to intercept Git, FTP,
  591. HTTP, and HTTPS requests and direct them to the
  592. <filename>http://</filename> sources mirror.
  593. You can use <filename>file://</filename> URLs to point to
  594. local directories or network shares as well.
  595. </para>
  596. <para>
  597. Aside from the previous technique, these options also exist:
  598. <literallayout class='monospaced'>
  599. BB_NO_NETWORK = "1"
  600. </literallayout>
  601. This statement tells BitBake to issue an error instead of
  602. trying to access the Internet.
  603. This technique is useful if you want to ensure code builds
  604. only from local sources.
  605. </para>
  606. <para>
  607. Here is another technique:
  608. <literallayout class='monospaced'>
  609. BB_FETCH_PREMIRRORONLY = "1"
  610. </literallayout>
  611. This statement limits the build system to pulling source
  612. from the <filename>PREMIRRORS</filename> only.
  613. Again, this technique is useful for reproducing builds.
  614. </para>
  615. <para>
  616. Here is another technique:
  617. <literallayout class='monospaced'>
  618. BB_GENERATE_MIRROR_TARBALLS = "1"
  619. </literallayout>
  620. This statement tells the build system to generate mirror
  621. tarballs.
  622. This technique is useful if you want to create a mirror server.
  623. If not, however, the technique can simply waste time during
  624. the build.
  625. </para>
  626. <para>
  627. Finally, consider an example where you are behind an
  628. HTTP-only firewall.
  629. You could make the following changes to the
  630. <filename>local.conf</filename> configuration file as long as
  631. the <filename>PREMIRRORS</filename> server is current:
  632. <literallayout class='monospaced'>
  633. PREMIRRORS_prepend = "\
  634. ftp://.*/.* http://www.yoctoproject.org/sources/ \n \
  635. http://.*/.* http://www.yoctoproject.org/sources/ \n \
  636. https://.*/.* http://www.yoctoproject.org/sources/ \n"
  637. BB_FETCH_PREMIRRORONLY = "1"
  638. </literallayout>
  639. These changes would cause the build system to successfully
  640. fetch source over HTTP and any network accesses to anything
  641. other than the <filename>PREMIRRORS</filename> would fail.
  642. </para>
  643. <para>
  644. The build system also honors the standard shell environment
  645. variables <filename>http_proxy</filename>,
  646. <filename>ftp_proxy</filename>,
  647. <filename>https_proxy</filename>, and
  648. <filename>all_proxy</filename> to redirect requests through
  649. proxy servers.
  650. </para>
  651. <note>
  652. You can find more information on the
  653. "<ulink url='&YOCTO_WIKI_URL;/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>"
  654. Wiki page.
  655. </note>
  656. </answer>
  657. </qandaentry>
  658. <qandaentry>
  659. <question>
  660. <para>
  661. Can I get rid of build output so I can start over?
  662. </para>
  663. </question>
  664. <answer>
  665. <para>
  666. Yes - you can easily do this.
  667. When you use BitBake to build an image, all the build output
  668. goes into the directory created when you run the
  669. build environment setup script (i.e.
  670. <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
  671. or
  672. <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
  673. By default, this
  674. <link linkend='build-directory'>Build Directory</link>
  675. is named <filename>build</filename> but can be named
  676. anything you want.
  677. </para>
  678. <para>
  679. Within the Build Directory, is the <filename>tmp</filename>
  680. directory.
  681. To remove all the build output yet preserve any source code or
  682. downloaded files from previous builds, simply remove the
  683. <filename>tmp</filename> directory.
  684. </para>
  685. </answer>
  686. </qandaentry>
  687. <qandaentry>
  688. <question>
  689. <para>
  690. Why do <filename>${bindir}</filename> and <filename>${libdir}</filename> have strange values for <filename>-native</filename> recipes?
  691. </para>
  692. </question>
  693. <answer>
  694. <para>
  695. Executables and libraries might need to be used from a
  696. directory other than the directory into which they were
  697. initially installed.
  698. Complicating this situation is the fact that sometimes these
  699. executables and libraries are compiled with the expectation
  700. of being run from that initial installation target directory.
  701. If this is the case, moving them causes problems.
  702. </para>
  703. <para>
  704. This scenario is a fundamental problem for package maintainers
  705. of mainstream Linux distributions as well as for the
  706. OpenEmbedded build system.
  707. As such, a well-established solution exists.
  708. Makefiles, Autotools configuration scripts, and other build
  709. systems are expected to respect environment variables such as
  710. <filename>bindir</filename>, <filename>libdir</filename>,
  711. and <filename>sysconfdir</filename> that indicate where
  712. executables, libraries, and data reside when a program is
  713. actually run.
  714. They are also expected to respect a
  715. <filename>DESTDIR</filename> environment variable, which is
  716. prepended to all the other variables when the build system
  717. actually installs the files.
  718. It is understood that the program does not actually run from
  719. within <filename>DESTDIR</filename>.
  720. </para>
  721. <para>
  722. When the OpenEmbedded build system uses a recipe to build a
  723. target-architecture program (i.e. one that is intended for
  724. inclusion on the image being built), that program eventually
  725. runs from the root file system of that image.
  726. Thus, the build system provides a value of "/usr/bin" for
  727. <filename>bindir</filename>, a value of "/usr/lib" for
  728. <filename>libdir</filename>, and so forth.
  729. </para>
  730. <para>
  731. Meanwhile, <filename>DESTDIR</filename> is a path within the
  732. <link linkend='build-directory'>Build Directory</link>.
  733. However, when the recipe builds a native program (i.e. one
  734. that is intended to run on the build machine), that program
  735. is never installed directly to the build machine's root
  736. file system.
  737. Consequently, the build system uses paths within the Build
  738. Directory for <filename>DESTDIR</filename>,
  739. <filename>bindir</filename> and related variables.
  740. To better understand this, consider the following two paths
  741. where the first is relatively normal and the second is not:
  742. <note>
  743. Due to these lengthy examples, the paths are artificially
  744. broken across lines for readability.
  745. </note>
  746. <literallayout class='monospaced'>
  747. /home/maxtothemax/poky-bootchart2/build/tmp/work/i586-poky-linux/zlib/
  748. 1.2.8-r0/sysroot-destdir/usr/bin
  749. /home/maxtothemax/poky-bootchart2/build/tmp/work/x86_64-linux/
  750. zlib-native/1.2.8-r0/sysroot-destdir/home/maxtothemax/poky-bootchart2/
  751. build/tmp/sysroots/x86_64-linux/usr/bin
  752. </literallayout>
  753. Even if the paths look unusual, they both are correct -
  754. the first for a target and the second for a native recipe.
  755. These paths are a consequence of the
  756. <filename>DESTDIR</filename> mechanism and while they
  757. appear strange, they are correct and in practice very effective.
  758. </para>
  759. </answer>
  760. </qandaentry>
  761. <qandaentry>
  762. <question>
  763. <para>
  764. The files provided by my <filename>*-native</filename> recipe do
  765. not appear to be available to other recipes.
  766. Files are missing from the native sysroot, my recipe is
  767. installing to the wrong place, or I am getting permissions
  768. errors during the do_install task in my recipe! What is wrong?
  769. </para>
  770. </question>
  771. <answer>
  772. <para>
  773. This situation results when a build system does
  774. not recognize the environment variables supplied to it by
  775. <link linkend='bitbake-term'>BitBake</link>.
  776. The incident that prompted this FAQ entry involved a Makefile
  777. that used an environment variable named
  778. <filename>BINDIR</filename> instead of the more standard
  779. variable <filename>bindir</filename>.
  780. The makefile's hardcoded default value of "/usr/bin" worked
  781. most of the time, but not for the recipe's
  782. <filename>-native</filename> variant.
  783. For another example, permissions errors might be caused
  784. by a Makefile that ignores <filename>DESTDIR</filename> or uses
  785. a different name for that environment variable.
  786. Check the the build system to see if these kinds of
  787. issues exist.
  788. </para>
  789. </answer>
  790. </qandaentry>
  791. </qandaset>
  792. </chapter>
  793. <!--
  794. vim: expandtab tw=80 ts=4
  795. -->