summaryrefslogtreecommitdiffstats
path: root/bitbake/doc/bitbake-user-manual
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/doc/bitbake-user-manual')
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst10
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst69
2 files changed, 45 insertions, 34 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst
index 4762d2637a..f357765b77 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst
@@ -439,10 +439,12 @@ This fetcher supports the following parameters:
439- *"rev":* The revision to use for the checkout. If :term:`SRCREV` is also set, 439- *"rev":* The revision to use for the checkout. If :term:`SRCREV` is also set,
440 this parameter must match its value. 440 this parameter must match its value.
441 441
442- *"tag":* Specifies a tag to use for the checkout. To correctly 442- *"tag":* Specifies a tag to use when fetching. To correctly resolve
443 resolve tags, BitBake must access the network. For that reason, tags 443 tags, BitBake must access the network. If a ``rev`` parameter or
444 are often not used. As far as Git is concerned, the "tag" parameter 444 :term:`SRCREV` is also specified, network access is not necessary to resolve
445 behaves effectively the same as the "rev" parameter. 445 the tag and instead, it is verified that they both resolve to the same commit
446 SHA at unpack time. The ``tag`` parameter is optional, but strongly
447 recommended if the checked out revision is a tag.
446 448
447- *"subpath":* Limits the checkout to a specific subpath of the tree. 449- *"subpath":* Limits the checkout to a specific subpath of the tree.
448 By default, the whole tree is checked out. 450 By default, the whole tree is checked out.
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
index f60a9d8312..1042c65d89 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
@@ -874,58 +874,67 @@ becomes a no-op.
874``include`` Directive 874``include`` Directive
875--------------------- 875---------------------
876 876
877BitBake understands the ``include`` directive. This directive causes 877The ``include`` directive causes BitBake to parse a given file,
878BitBake to parse whatever file you specify, and to insert that file at 878and to include that file's contents at the location of the
879that location. The directive is much like its equivalent in Make except 879``include`` statement. This directive is similar to its equivalent
880that if the path specified on the include line is a relative path, 880in Make, except that if the path specified on the BitBake ``include``
881BitBake locates the first file it can find within :term:`BBPATH`. 881line is a relative path, BitBake will search for it on the path designated
882 882by :term:`BBPATH` and will include *only the first matching file*.
883The include directive is a more generic method of including 883
884The ``include`` directive is a more generic method of including
884functionality as compared to the :ref:`inherit <bitbake-user-manual/bitbake-user-manual-metadata:\`\`inherit\`\` directive>` 885functionality as compared to the :ref:`inherit <bitbake-user-manual/bitbake-user-manual-metadata:\`\`inherit\`\` directive>`
885directive, which is restricted to class (i.e. ``.bbclass``) files. The 886directive, which is restricted to class (i.e. ``.bbclass``) files. The
886include directive is applicable for any other kind of shared or 887``include`` directive is applicable for any other kind of shared or
887encapsulated functionality or configuration that does not suit a 888encapsulated functionality or configuration that does not suit a
888``.bbclass`` file. 889``.bbclass`` file.
889 890
890As an example, suppose you needed a recipe to include some self-test 891For example, if you needed a recipe to include some self-test definitions,
891definitions:: 892you might write::
892 893
893 include test_defs.inc 894 include test_defs.inc
894 895
896The ``include`` directive does not produce an error if the specified file
897cannot be found. If the included file *must* exist, then you should use
898use :ref:`require <require-inclusion>` instead, which will generate an error
899if the file cannot be found.
900
895.. note:: 901.. note::
896 902
897 The include directive does not produce an error when the file cannot be 903 Note well that the ``include`` directive will include the first matching
898 found. Consequently, it is recommended that if the file you are including is 904 file and nothing further (which is almost always the behaviour you want).
899 expected to exist, you should use :ref:`require <require-inclusion>` instead 905 If you need to include all matching files, you need to use the
900 of include . Doing so makes sure that an error is produced if the file cannot 906 ``include_all`` directive, explained below.
901 be found.
902 907
903``include_all`` Directive 908``include_all`` Directive
904------------------------- 909-------------------------
905 910
906The ``include_all`` directive works like the :ref:`include 911The ``include_all`` directive works like the :ref:`include
907<bitbake-user-manual/bitbake-user-manual-metadata:\`\`include\`\` directive>` 912<bitbake-user-manual/bitbake-user-manual-metadata:\`\`include\`\` directive>`
908directive but will include all of the files that match the specified path in 913directive but will include *all* of the files that match the specified path in
909the enabled layers (layers part of :term:`BBLAYERS`). 914the enabled layers (layers part of :term:`BBLAYERS`).
910 915
911For example, let's say a ``maintainers.inc`` file is present in different layers 916.. note::
912and is conventionally placed in the ``conf/distro/include`` directory of each
913layer. In that case the ``include_all`` directive can be used to include
914the ``maintainers.inc`` file for all of these layers::
915 917
916 include_all conf/distro/include/maintainers.inc 918 This behaviour is rarely what you want in normal operation, and should
919 be reserved for only those situations when you explicitly want to parse
920 and include all matching files found across all layers, as the following
921 example shows.
917 922
918In other words, the ``maintainers.inc`` file for each layer is included through 923As a realistic example of this directive, imagine that all of your active
919the :ref:`include <bitbake-user-manual/bitbake-user-manual-metadata:\`\`include\`\` directive>` 924layers contain a file ``conf/distro/include/maintainers.inc``, containing
920directive. 925maintainer information for the recipes in that layer, and you wanted to
926collect all of the content from all of those files across all of those layers.
927You could use the statement::
928
929 include_all conf/distro/include/maintainers.inc
921 930
922BitBake will iterate through the colon-separated :term:`BBPATH` list to look for 931In this case, BitBake will iterate through all of the directories in
923matching files to include, from left to right. As a consequence, matching files 932the colon-separated :term:`BBPATH` (from left to right) and collect the
924are included in that order. 933contents of all matching files, so you end up with the maintainer
934information of all of your active layers, not just the first one.
925 935
926As the ``include_all`` directive uses the :ref:`include 936As the ``include_all`` directive uses the ``include`` directive in the
927<bitbake-user-manual/bitbake-user-manual-metadata:\`\`include\`\` directive>` 937background, as with ``include``, no error is produced if no files are matched.
928directive in the background, no error is produced if no files are matched.
929 938
930.. _require-inclusion: 939.. _require-inclusion:
931 940