diff options
| -rw-r--r-- | handbook/extendpoky.xml | 148 | ||||
| -rw-r--r-- | handbook/introduction.xml | 2 | ||||
| -rw-r--r-- | handbook/ref-bitbake.xml | 7 |
3 files changed, 83 insertions, 74 deletions
diff --git a/handbook/extendpoky.xml b/handbook/extendpoky.xml index f072fe5032..b437c77fa3 100644 --- a/handbook/extendpoky.xml +++ b/handbook/extendpoky.xml | |||
| @@ -518,85 +518,93 @@ bitbake poky-image-sato | |||
| 518 | </para> | 518 | </para> |
| 519 | <para> | 519 | <para> |
| 520 | Poky supports the idea of <link | 520 | Poky supports the idea of <link |
| 521 | linkend='usingpoky-changes-collections'>"collections"</link> which when used | 521 | linkend='usingpoky-changes-layers'>"layers"</link> which when used |
| 522 | properly can massively ease future upgrades and allow segregation | 522 | properly can massively ease future upgrades and allow segregation |
| 523 | between the Poky core and a given developer's changes. Some other advice on | 523 | between the Poky core and a given developer's changes. Some other advice on |
| 524 | managing changes to Poky is also given in the following section. | 524 | managing changes to Poky is also given in the following section. |
| 525 | </para> | 525 | </para> |
| 526 | 526 | ||
| 527 | <section id="usingpoky-changes-collections"> | 527 | <section id="usingpoky-changes-layers"> |
| 528 | <title>Bitbake Collections</title> | 528 | <title>Bitbake Layers</title> |
| 529 | 529 | ||
| 530 | <para> | 530 | <para> |
| 531 | Often, people want to extend Poky either through adding packages | 531 | Often, people want to extend Poky either through adding packages |
| 532 | or overriding files contained within Poky to add their own | 532 | or overriding files contained within Poky to add their own |
| 533 | functionality. Bitbake has a powerful mechanism called | 533 | functionality. Bitbake has a powerful mechanism called |
| 534 | collections which provide a way to handle this which is fully | 534 | layers which provides a way to handle this extension in a fully |
| 535 | supported and actively encouraged within Poky. | 535 | supported and non-invasive fashion. |
| 536 | </para> | 536 | </para> |
| 537 | <para> | 537 | |
| 538 | In the standard tree, meta-extras is an example of how you can | 538 | <para> |
| 539 | do this. As standard the data in meta-extras is not used on a | 539 | The Poky tree includes two additional layers which demonstrate |
| 540 | Poky build but local.conf.sample shows how to enable it: | 540 | this functionality, meta-moblin and meta-extras. |
| 541 | </para> | 541 | The meta-extras repostory is not enabled by default but enabling |
| 542 | <para> | 542 | it is as easy as adding the layers path to the BBLAYERS variable in |
| 543 | <literallayout class='monospaced'> | 543 | your bblayers.conf, this is how all layers are enabled in Poky builds: |
| 544 | BBFILES := "${OEROOT}/meta/packages/*/*.bb ${OEROOT}/meta-extras/packages/*/*.bb" | 544 | </para> |
| 545 | BBFILE_COLLECTIONS = "normal extras" | 545 | <para> |
| 546 | BBFILE_PATTERN_normal = "^${OEROOT}/meta/" | 546 | <literallayout class='monospaced'>LCONF_VERSION = "1" |
| 547 | BBFILE_PATTERN_extras = "^${OEROOT}/meta-extras/" | 547 | |
| 548 | BBFILE_PRIORITY_normal = "5" | 548 | BBFILES ?= "" |
| 549 | BBFILE_PRIORITY_extras = "5"</literallayout> | 549 | BBLAYERS = " \ |
| 550 | </para> | 550 | ${OEROOT}/meta \ |
| 551 | <para> | 551 | ${OEROOT}/meta-moblin \ |
| 552 | As can be seen, the extra recipes are added to BBFILES. The | 552 | ${OEROOT}/meta-extras \ |
| 553 | BBFILE_COLLECTIONS variable is then set to contain a list of | 553 | " |
| 554 | collection names. The BBFILE_PATTERN variables are regular | 554 | </literallayout> |
| 555 | expressions used to match files from BBFILES into a particular | 555 | </para> |
| 556 | collection in this case by using the base pathname. | 556 | |
| 557 | The BBFILE_PRIORITY variable then assigns the different | 557 | <para> |
| 558 | priorities to the files in different collections. This is useful | 558 | Bitbake parses the conf/layer.conf of each of the layers in BBLAYERS |
| 559 | in situations where the same package might appear in both | 559 | to add the layers packages, classes and configuration to Poky. |
| 560 | repositories and allows you to choose which collection should | 560 | To create your own layer, independent of the main Poky repository, |
| 561 | 'win'. | 561 | you need only create a directory with a conf/layer.conf file and |
| 562 | </para> | 562 | add the directory to your bblayers.conf. |
| 563 | <para> | 563 | </para> |
| 564 | This works well for recipes. For bbclasses and configuration | 564 | |
| 565 | files, you can use the BBPATH environment variable. In this | 565 | <para> |
| 566 | case, the first file with the matching name found in BBPATH is | 566 | The meta-extras layer.conf demonstrates the required syntax: |
| 567 | the one that is used, just like the PATH variable for binaries. | 567 | <literallayout class='monospaced'># We have a conf and classes directory, add to BBPATH |
| 568 | </para> | 568 | BBPATH := "${BBPATH}${LAYERDIR}" |
| 569 | </section> | 569 | |
| 570 | 570 | # We have a packages directory, add to BBFILES | |
| 571 | <section id="usingpoky-changes-supplement"> | 571 | BBFILES := "${BBFILES} ${LAYERDIR}/packages/*/*.bb" |
| 572 | <title>Supplementry Metadata Repositories</title> | 572 | |
| 573 | 573 | BBFILE_COLLECTIONS += "extras" | |
| 574 | <para> | 574 | BBFILE_PATTERN_extras := "^${LAYERDIR}/" |
| 575 | Often when developing a project based on Poky there will be components | 575 | BBFILE_PRIORITY_extras = "5" |
| 576 | that are not ready for public consumption for whatever reason. By making | 576 | |
| 577 | use of the collections mechanism and other functionality within Poky, it | 577 | require conf/distro/include/poky-extras-src-revisions.inc |
| 578 | is possible to have a public repository which is supplemented by a private | 578 | </literallayout> |
| 579 | one just containing the pieces that need to be kept private. | 579 | </para> |
| 580 | </para> | 580 | |
| 581 | <para> | 581 | <para> |
| 582 | The usual approach with these is to create a separate git repository called | 582 | As can be seen, the layers recipes are added to BBFILES. The |
| 583 | "meta-prvt-XXX" which is checked out alongside the other meta-* | 583 | BBFILE_COLLECTIONS variable is then appended to with the |
| 584 | directories included in Poky. Under this directory there can be several | 584 | layer name. The BBFILE_PATTERN variable is immediately expanded |
| 585 | different directories such as classes, conf and packages which all | 585 | with a regular expression used to match files from BBFILES into a |
| 586 | function as per the usual Poky directory structure. | 586 | particular layer, in this case by using the base pathname. |
| 587 | </para> | 587 | The BBFILE_PRIORITY variable then assigns different |
| 588 | <para> | 588 | priorities to the files in different layers. This is useful |
| 589 | If extra meta-* directories are found, Poky will automatically add them | 589 | in situations where the same package might appear in multiple |
| 590 | into the BBPATH variable so the conf and class files contained there | 590 | layers and allows you to choose which layer should 'win'. |
| 591 | are found. If a file called poky-extra-environment is found within the | 591 | </para> |
| 592 | meta-* directory, this will be sourced as the environment is setup, | 592 | |
| 593 | allowing certain configuration to be overridden such as the location of the | 593 | <para> |
| 594 | local.conf.sample file that is used. | 594 | Extra bbclasses and configuration are added to the BBPATH |
| 595 | </para> | 595 | environment variable. In this case, the first file with the |
| 596 | <para> | 596 | matching name found in BBPATH is the one that is used, just |
| 597 | Note that at present, BBFILES is not automatically changed and this needs | 597 | like the PATH variable for binaries. It is therefore recommended |
| 598 | to be adjusted to find files in the packages/ directory. Usually a custom | 598 | that you use unique bbclass and configuration file names in your |
| 599 | local.conf.sample file will be used to handle this instead. | 599 | custom layer. |
| 600 | </para> | ||
| 601 | |||
| 602 | <para> | ||
| 603 | The recommended approach for custom layers is to store them in a | ||
| 604 | git repository of the format meta-prvt-XXXX and have this repository | ||
| 605 | cloned alongside the other meta directories in the Poky tree. | ||
| 606 | This way you can keep your Poky tree and it's configuration entirely | ||
| 607 | inside OEROOT. | ||
| 600 | </para> | 608 | </para> |
| 601 | </section> | 609 | </section> |
| 602 | 610 | ||
diff --git a/handbook/introduction.xml b/handbook/introduction.xml index 1796abfdd7..a7ea20ff0d 100644 --- a/handbook/introduction.xml +++ b/handbook/introduction.xml | |||
| @@ -117,7 +117,7 @@ | |||
| 117 | <para>build-essential</para> | 117 | <para>build-essential</para> |
| 118 | </listitem> | 118 | </listitem> |
| 119 | <listitem> | 119 | <listitem> |
| 120 | <para>python</para> | 120 | <para>python (version 2.6 or later)</para> |
| 121 | </listitem> | 121 | </listitem> |
| 122 | <listitem> | 122 | <listitem> |
| 123 | <para>diffstat</para> | 123 | <para>diffstat</para> |
diff --git a/handbook/ref-bitbake.xml b/handbook/ref-bitbake.xml index 8652424466..ddf3c760f2 100644 --- a/handbook/ref-bitbake.xml +++ b/handbook/ref-bitbake.xml | |||
| @@ -81,9 +81,10 @@ | |||
| 81 | default this specifies the <filename class="directory">meta/packages/ | 81 | default this specifies the <filename class="directory">meta/packages/ |
| 82 | </filename> directory within Poky, but other directories such as | 82 | </filename> directory within Poky, but other directories such as |
| 83 | <filename class="directory">meta-extras/</filename> can be included | 83 | <filename class="directory">meta-extras/</filename> can be included |
| 84 | too. If multiple directories are specified a system referred to as | 84 | too. Adding extra content to |
| 85 | <link linkend='usingpoky-changes-collections'>"collections"</link> is used to | 85 | <glossterm><link linkend='var-BBFILES'>BBFILES</link></glossterm> is best |
| 86 | determine which files have priority. | 86 | acheived through the use of Bitbake |
| 87 | <link linkend='usingpoky-changes-layers'>"layers"</link>. | ||
| 87 | </para> | 88 | </para> |
| 88 | 89 | ||
| 89 | <para> | 90 | <para> |
