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