faq.xml 37 KB

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