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