summaryrefslogtreecommitdiffstats
path: root/bitbake/doc
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/doc')
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst25
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.rst174
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-library-functions.rst59
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst144
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst129
-rw-r--r--bitbake/doc/conf.py7
-rw-r--r--bitbake/doc/index.rst1
-rw-r--r--bitbake/doc/releases.rst39
8 files changed, 439 insertions, 139 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 fb4f0a23d7..a2c2432db1 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst
@@ -39,10 +39,10 @@ variable and then calls the ``download`` method to download the files.
39 39
40The instantiation of the fetch class is usually followed by:: 40The instantiation of the fetch class is usually followed by::
41 41
42 rootdir = l.getVar('WORKDIR') 42 rootdir = l.getVar('UNPACKDIR')
43 fetcher.unpack(rootdir) 43 fetcher.unpack(rootdir)
44 44
45This code unpacks the downloaded files to the specified by ``WORKDIR``. 45This code unpacks the downloaded files to the specified by ``UNPACKDIR``.
46 46
47.. note:: 47.. note::
48 48
@@ -51,7 +51,7 @@ This code unpacks the downloaded files to the specified by ``WORKDIR``.
51 examine the OpenEmbedded class file ``base.bbclass`` 51 examine the OpenEmbedded class file ``base.bbclass``
52 . 52 .
53 53
54The :term:`SRC_URI` and ``WORKDIR`` variables are not hardcoded into the 54The :term:`SRC_URI` and ``UNPACKDIR`` variables are not hardcoded into the
55fetcher, since those fetcher methods can be (and are) called with 55fetcher, since those fetcher methods can be (and are) called with
56different variable names. In OpenEmbedded for example, the shared state 56different variable names. In OpenEmbedded for example, the shared state
57(sstate) code uses the fetch module to fetch the sstate files. 57(sstate) code uses the fetch module to fetch the sstate files.
@@ -463,13 +463,6 @@ Here are some example URLs::
463 463
464.. note:: 464.. note::
465 465
466 When using ``git`` as the fetcher of the main source code of your software,
467 ``S`` should be set accordingly::
468
469 S = "${WORKDIR}/git"
470
471.. note::
472
473 Specifying passwords directly in ``git://`` urls is not supported. 466 Specifying passwords directly in ``git://`` urls is not supported.
474 There are several reasons: :term:`SRC_URI` is often written out to logs and 467 There are several reasons: :term:`SRC_URI` is often written out to logs and
475 other places, and that could easily leak passwords; it is also all too 468 other places, and that could easily leak passwords; it is also all too
@@ -598,7 +591,7 @@ and port, username, and password, and fetches the Head Revision::
598 SRC_URI = "p4://example-depot/main/source/..." 591 SRC_URI = "p4://example-depot/main/source/..."
599 SRCREV = "${AUTOREV}" 592 SRCREV = "${AUTOREV}"
600 PV = "p4-${SRCPV}" 593 PV = "p4-${SRCPV}"
601 S = "${WORKDIR}/p4" 594 S = "${UNPACKDIR}/p4"
602 595
603Here is an example that specifies the server URL and port, username, and 596Here is an example that specifies the server URL and port, username, and
604password, and fetches a Revision based on a Label:: 597password, and fetches a Revision based on a Label::
@@ -607,15 +600,15 @@ password, and fetches a Revision based on a Label::
607 SRC_URI = "p4://user:passwd@example-depot/main/source/..." 600 SRC_URI = "p4://user:passwd@example-depot/main/source/..."
608 SRCREV = "release-1.0" 601 SRCREV = "release-1.0"
609 PV = "p4-${SRCPV}" 602 PV = "p4-${SRCPV}"
610 S = "${WORKDIR}/p4" 603 S = "${UNPACKDIR}/p4"
611 604
612.. note:: 605.. note::
613 606
614 You should always set S to "${WORKDIR}/p4" in your recipe. 607 You should always set S to "${UNPACKDIR}/p4" in your recipe.
615 608
616By default, the fetcher strips the depot location from the local file paths. In 609By default, the fetcher strips the depot location from the local file paths. In
617the above example, the content of ``example-depot/main/source/`` will be placed 610the above example, the content of ``example-depot/main/source/`` will be placed
618in ``${WORKDIR}/p4``. For situations where preserving parts of the remote depot 611in ``${UNPACKDIR}/p4``. For situations where preserving parts of the remote depot
619paths locally is desirable, the fetcher supports two parameters: 612paths locally is desirable, the fetcher supports two parameters:
620 613
621- *"module":* 614- *"module":*
@@ -686,9 +679,9 @@ Such functionality is set by the variable:
686 delegate access to resources, if this variable is set, the Az Fetcher will 679 delegate access to resources, if this variable is set, the Az Fetcher will
687 use it when fetching artifacts from the cloud. 680 use it when fetching artifacts from the cloud.
688 681
689You can specify the AZ_SAS variable as shown below:: 682You can specify the AZ_SAS variable prefixed with a ? as shown below::
690 683
691 AZ_SAS = "se=2021-01-01&sp=r&sv=2018-11-09&sr=c&skoid=<skoid>&sig=<signature>" 684 AZ_SAS = "?se=2021-01-01&sp=r&sv=2018-11-09&sr=c&skoid=<skoid>&sig=<signature>"
692 685
693Here is an example URL:: 686Here is an example URL::
694 687
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.rst
index 35ffb88b02..539bb62d81 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.rst
@@ -349,40 +349,84 @@ Usage and syntax
349Following is the usage and syntax for BitBake:: 349Following is the usage and syntax for BitBake::
350 350
351 $ bitbake -h 351 $ bitbake -h
352 Usage: bitbake [options] [recipename/target recipe:do_task ...] 352 usage: bitbake [-s] [-e] [-g] [-u UI] [--version] [-h] [-f] [-c CMD]
353 353 [-C INVALIDATE_STAMP] [--runall RUNALL] [--runonly RUNONLY]
354 Executes the specified task (default is 'build') for a given set of target recipes (.bb files). 354 [--no-setscene] [--skip-setscene] [--setscene-only] [-n] [-p]
355 It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH which 355 [-k] [-P] [-S SIGNATURE_HANDLER] [--revisions-changed]
356 will provide the layer, BBFILES and other configuration information. 356 [-b BUILDFILE] [-D] [-l DEBUG_DOMAINS] [-v] [-q]
357 [-w WRITEEVENTLOG] [-B BIND] [-T SERVER_TIMEOUT]
358 [--remote-server REMOTE_SERVER] [-m] [--token XMLRPCTOKEN]
359 [--observe-only] [--status-only] [--server-only] [-r PREFILE]
360 [-R POSTFILE] [-I EXTRA_ASSUME_PROVIDED]
361 [recipename/target ...]
362
363 It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH
364 which will provide the layer, BBFILES and other configuration information.
365
366 General options:
367 recipename/target Execute the specified task (default is 'build') for
368 these target recipes (.bb files).
369 -s, --show-versions Show current and preferred versions of all recipes.
370 -e, --environment Show the global or per-recipe environment complete
371 with information about where variables were
372 set/changed.
373 -g, --graphviz Save dependency tree information for the specified
374 targets in the dot syntax.
375 -u UI, --ui UI The user interface to use (knotty, ncurses, taskexp,
376 taskexp_ncurses or teamcity - default knotty).
377 --version Show programs version and exit.
378 -h, --help Show this help message and exit.
357 379
358 Options: 380 Task control options:
359 --version show program's version number and exit
360 -h, --help show this help message and exit
361 -b BUILDFILE, --buildfile=BUILDFILE
362 Execute tasks from a specific .bb recipe directly.
363 WARNING: Does not handle any dependencies from other
364 recipes.
365 -k, --continue Continue as much as possible after an error. While the
366 target that failed and anything depending on it cannot
367 be built, as much as possible will be built before
368 stopping.
369 -f, --force Force the specified targets/task to run (invalidating 381 -f, --force Force the specified targets/task to run (invalidating
370 any existing stamp file). 382 any existing stamp file).
371 -c CMD, --cmd=CMD Specify the task to execute. The exact options 383 -c CMD, --cmd CMD Specify the task to execute. The exact options
372 available depend on the metadata. Some examples might 384 available depend on the metadata. Some examples might
373 be 'compile' or 'populate_sysroot' or 'listtasks' may 385 be 'compile' or 'populate_sysroot' or 'listtasks' may
374 give a list of the tasks available. 386 give a list of the tasks available.
375 -C INVALIDATE_STAMP, --clear-stamp=INVALIDATE_STAMP 387 -C INVALIDATE_STAMP, --clear-stamp INVALIDATE_STAMP
376 Invalidate the stamp for the specified task such as 388 Invalidate the stamp for the specified task such as
377 'compile' and then run the default task for the 389 'compile' and then run the default task for the
378 specified target(s). 390 specified target(s).
379 -r PREFILE, --read=PREFILE 391 --runall RUNALL Run the specified task for any recipe in the taskgraph
380 Read the specified file before bitbake.conf. 392 of the specified target (even if it wouldn't otherwise
381 -R POSTFILE, --postread=POSTFILE 393 have run).
382 Read the specified file after bitbake.conf. 394 --runonly RUNONLY Run only the specified task within the taskgraph of
383 -v, --verbose Enable tracing of shell tasks (with 'set -x'). Also 395 the specified targets (and any task dependencies those
384 print bb.note(...) messages to stdout (in addition to 396 tasks may have).
385 writing them to ${T}/log.do_&lt;task&gt;). 397 --no-setscene Do not run any setscene tasks. sstate will be ignored
398 and everything needed, built.
399 --skip-setscene Skip setscene tasks if they would be executed. Tasks
400 previously restored from sstate will be kept, unlike
401 --no-setscene.
402 --setscene-only Only run setscene tasks, don't run any real tasks.
403
404 Execution control options:
405 -n, --dry-run Don't execute, just go through the motions.
406 -p, --parse-only Quit after parsing the BB recipes.
407 -k, --continue Continue as much as possible after an error. While the
408 target that failed and anything depending on it cannot
409 be built, as much as possible will be built before
410 stopping.
411 -P, --profile Profile the command and save reports.
412 -S SIGNATURE_HANDLER, --dump-signatures SIGNATURE_HANDLER
413 Dump out the signature construction information, with
414 no task execution. The SIGNATURE_HANDLER parameter is
415 passed to the handler. Two common values are none and
416 printdiff but the handler may define more/less. none
417 means only dump the signature, printdiff means
418 recursively compare the dumped signature with the most
419 recent one in a local build or sstate cache (can be
420 used to find out why tasks re-run when that is not
421 expected)
422 --revisions-changed Set the exit code depending on whether upstream
423 floating revisions have changed or not.
424 -b BUILDFILE, --buildfile BUILDFILE
425 Execute tasks from a specific .bb recipe directly.
426 WARNING: Does not handle any dependencies from other
427 recipes.
428
429 Logging/output control options:
386 -D, --debug Increase the debug level. You can specify this more 430 -D, --debug Increase the debug level. You can specify this more
387 than once. -D sets the debug level to 1, where only 431 than once. -D sets the debug level to 1, where only
388 bb.debug(1, ...) messages are printed to stdout; -DD 432 bb.debug(1, ...) messages are printed to stdout; -DD
@@ -392,65 +436,47 @@ Following is the usage and syntax for BitBake::
392 -D only affects output to stdout. All debug messages 436 -D only affects output to stdout. All debug messages
393 are written to ${T}/log.do_taskname, regardless of the 437 are written to ${T}/log.do_taskname, regardless of the
394 debug level. 438 debug level.
439 -l DEBUG_DOMAINS, --log-domains DEBUG_DOMAINS
440 Show debug logging for the specified logging domains.
441 -v, --verbose Enable tracing of shell tasks (with 'set -x'). Also
442 print bb.note(...) messages to stdout (in addition to
443 writing them to ${T}/log.do_<task>).
395 -q, --quiet Output less log message data to the terminal. You can 444 -q, --quiet Output less log message data to the terminal. You can
396 specify this more than once. 445 specify this more than once.
397 -n, --dry-run Don't execute, just go through the motions. 446 -w WRITEEVENTLOG, --write-log WRITEEVENTLOG
398 -S SIGNATURE_HANDLER, --dump-signatures=SIGNATURE_HANDLER 447 Writes the event log of the build to a bitbake event
399 Dump out the signature construction information, with 448 json file. Use '' (empty string) to assign the name
400 no task execution. The SIGNATURE_HANDLER parameter is 449 automatically.
401 passed to the handler. Two common values are none and 450
402 printdiff but the handler may define more/less. none 451 Server options:
403 means only dump the signature, printdiff means compare 452 -B BIND, --bind BIND The name/address for the bitbake xmlrpc server to bind
404 the dumped signature with the cached one.
405 -p, --parse-only Quit after parsing the BB recipes.
406 -s, --show-versions Show current and preferred versions of all recipes.
407 -e, --environment Show the global or per-recipe environment complete
408 with information about where variables were
409 set/changed.
410 -g, --graphviz Save dependency tree information for the specified
411 targets in the dot syntax.
412 -I EXTRA_ASSUME_PROVIDED, --ignore-deps=EXTRA_ASSUME_PROVIDED
413 Assume these dependencies don't exist and are already
414 provided (equivalent to ASSUME_PROVIDED). Useful to
415 make dependency graphs more appealing
416 -l DEBUG_DOMAINS, --log-domains=DEBUG_DOMAINS
417 Show debug logging for the specified logging domains
418 -P, --profile Profile the command and save reports.
419 -u UI, --ui=UI The user interface to use (knotty, ncurses, taskexp or
420 teamcity - default knotty).
421 --token=XMLRPCTOKEN Specify the connection token to be used when
422 connecting to a remote server.
423 --revisions-changed Set the exit code depending on whether upstream
424 floating revisions have changed or not.
425 --server-only Run bitbake without a UI, only starting a server
426 (cooker) process.
427 -B BIND, --bind=BIND The name/address for the bitbake xmlrpc server to bind
428 to. 453 to.
429 -T SERVER_TIMEOUT, --idle-timeout=SERVER_TIMEOUT 454 -T SERVER_TIMEOUT, --idle-timeout SERVER_TIMEOUT
430 Set timeout to unload bitbake server due to 455 Set timeout to unload bitbake server due to
431 inactivity, set to -1 means no unload, default: 456 inactivity, set to -1 means no unload, default:
432 Environment variable BB_SERVER_TIMEOUT. 457 Environment variable BB_SERVER_TIMEOUT.
433 --no-setscene Do not run any setscene tasks. sstate will be ignored 458 --remote-server REMOTE_SERVER
434 and everything needed, built.
435 --skip-setscene Skip setscene tasks if they would be executed. Tasks
436 previously restored from sstate will be kept, unlike
437 --no-setscene
438 --setscene-only Only run setscene tasks, don't run any real tasks.
439 --remote-server=REMOTE_SERVER
440 Connect to the specified server. 459 Connect to the specified server.
441 -m, --kill-server Terminate any running bitbake server. 460 -m, --kill-server Terminate any running bitbake server.
461 --token XMLRPCTOKEN Specify the connection token to be used when
462 connecting to a remote server.
442 --observe-only Connect to a server as an observing-only client. 463 --observe-only Connect to a server as an observing-only client.
443 --status-only Check the status of the remote bitbake server. 464 --status-only Check the status of the remote bitbake server.
444 -w WRITEEVENTLOG, --write-log=WRITEEVENTLOG 465 --server-only Run bitbake without a UI, only starting a server
445 Writes the event log of the build to a bitbake event 466 (cooker) process.
446 json file. Use '' (empty string) to assign the name 467
447 automatically. 468 Configuration options:
448 --runall=RUNALL Run the specified task for any recipe in the taskgraph 469 -r PREFILE, --read PREFILE
449 of the specified target (even if it wouldn't otherwise 470 Read the specified file before bitbake.conf.
450 have run). 471 -R POSTFILE, --postread POSTFILE
451 --runonly=RUNONLY Run only the specified task within the taskgraph of 472 Read the specified file after bitbake.conf.
452 the specified targets (and any task dependencies those 473 -I EXTRA_ASSUME_PROVIDED, --ignore-deps EXTRA_ASSUME_PROVIDED
453 tasks may have). 474 Assume these dependencies don't exist and are already
475 provided (equivalent to ASSUME_PROVIDED). Useful to
476 make dependency graphs more appealing.
477
478..
479 Bitbake help output generated with "stty columns 80; bin/bitbake -h"
454 480
455.. _bitbake-examples: 481.. _bitbake-examples:
456 482
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-library-functions.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-library-functions.rst
new file mode 100644
index 0000000000..09e353945b
--- /dev/null
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-library-functions.rst
@@ -0,0 +1,59 @@
1.. SPDX-License-Identifier: CC-BY-2.5
2
3=================
4Library Functions
5=================
6
7|
8
9This chapter lists common library functions available under the ``lib/``
10directory in BitBake.
11
12These functions can be used in recipes or configuration files with
13:ref:`inline-Python <bitbake-user-manual/bitbake-user-manual-metadata:Inline
14Python Variable Expansion>` or :ref:`Python
15<bitbake-user-manual/bitbake-user-manual-metadata:BitBake-Style Python
16Functions>` functions.
17
18Logging utilities
19=================
20
21Different logging utilities can be used from Python code in recipes or
22configuration files.
23
24The strings passed below can be formatted with ``str.format()``, for example::
25
26 bb.warn("Houston, we have a %s", "bit of a problem")
27
28Formatted string can also be used directly::
29
30 bb.error("%s, we have a %s" % ("Houston", "big problem"))
31
32Python f-strings may also be used::
33
34 h = "Houston"
35 bb.fatal(f"{h}, we have a critical problem")
36
37.. automodule:: bb
38 :members:
39 debug,
40 error,
41 erroronce,
42 fatal,
43 note,
44 plain,
45 verbnote,
46 warn,
47 warnonce,
48
49``bb.utils``
50============
51
52.. automodule:: bb.utils
53 :members:
54 :exclude-members:
55 LogCatcher,
56 PrCtlError,
57 VersionStringException,
58 better_compile,
59 better_exec,
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 58975f4c88..f60a9d8312 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
@@ -754,7 +754,9 @@ share the task.
754This section presents the mechanisms BitBake provides to allow you to 754This section presents the mechanisms BitBake provides to allow you to
755share functionality between recipes. Specifically, the mechanisms 755share functionality between recipes. Specifically, the mechanisms
756include ``include``, ``inherit``, :term:`INHERIT`, and ``require`` 756include ``include``, ``inherit``, :term:`INHERIT`, and ``require``
757directives. 757directives. There is also a higher-level abstraction called
758``configuration fragments`` that is enabled with ``addfragments``
759directive.
758 760
759Locating Include and Class Files 761Locating Include and Class Files
760-------------------------------- 762--------------------------------
@@ -771,6 +773,8 @@ In order for include and class files to be found by BitBake, they need
771to be located in a "classes" subdirectory that can be found in 773to be located in a "classes" subdirectory that can be found in
772:term:`BBPATH`. 774:term:`BBPATH`.
773 775
776.. _ref-bitbake-user-manual-metadata-inherit:
777
774``inherit`` Directive 778``inherit`` Directive
775--------------------- 779---------------------
776 780
@@ -809,19 +813,43 @@ An advantage with the inherit directive as compared to both the
809:ref:`include <bitbake-user-manual/bitbake-user-manual-metadata:\`\`include\`\` directive>` and :ref:`require <bitbake-user-manual/bitbake-user-manual-metadata:\`\`require\`\` directive>` 813:ref:`include <bitbake-user-manual/bitbake-user-manual-metadata:\`\`include\`\` directive>` and :ref:`require <bitbake-user-manual/bitbake-user-manual-metadata:\`\`require\`\` directive>`
810directives is that you can inherit class files conditionally. You can 814directives is that you can inherit class files conditionally. You can
811accomplish this by using a variable expression after the ``inherit`` 815accomplish this by using a variable expression after the ``inherit``
812statement. Here is an example:: 816statement.
817
818For inheriting classes conditionally, using the :ref:`inherit_defer
819<ref-bitbake-user-manual-metadata-inherit-defer>` directive is advised as
820:ref:`inherit_defer <ref-bitbake-user-manual-metadata-inherit-defer>` is
821evaluated at the end of parsing.
822
823.. _ref-bitbake-user-manual-metadata-inherit-defer:
824
825``inherit_defer`` Directive
826~~~~~~~~~~~~~~~~~~~~~~~~~~~
827
828The :ref:`inherit_defer <ref-bitbake-user-manual-metadata-inherit-defer>`
829directive works like the :ref:`inherit
830<ref-bitbake-user-manual-metadata-inherit>` directive, except that it is only
831evaluated at the end of parsing. Its usage is recommended when a conditional
832expression is used.
813 833
814 inherit ${VARNAME} 834This allows conditional expressions to be evaluated "late", meaning changes to
835the variable after the line is parsed will take effect. With the :ref:`inherit
836<ref-bitbake-user-manual-metadata-inherit>` directive this is not the case.
837
838Here is an example::
839
840 inherit_defer ${VARNAME}
815 841
816If ``VARNAME`` is 842If ``VARNAME`` is
817going to be set, it needs to be set before the ``inherit`` statement is 843going to be set, it needs to be set before the ``inherit_defer`` statement is
818parsed. One way to achieve a conditional inherit in this case is to use 844parsed. One way to achieve a conditional inherit in this case is to use
819overrides:: 845overrides::
820 846
821 VARIABLE = "" 847 VARIABLE = ""
822 VARIABLE:someoverride = "myclass" 848 VARIABLE:someoverride = "myclass"
823 849
824Another method is by using anonymous Python. Here is an example:: 850Another method is by using :ref:`anonymous Python
851<bitbake-user-manual/bitbake-user-manual-metadata:Anonymous Python Functions>`.
852Here is an example::
825 853
826 python () { 854 python () {
827 if condition == value: 855 if condition == value:
@@ -830,11 +858,14 @@ Another method is by using anonymous Python. Here is an example::
830 d.setVar('VARIABLE', '') 858 d.setVar('VARIABLE', '')
831 } 859 }
832 860
833Alternatively, you could use an in-line Python expression in the 861Alternatively, you could use an inline Python expression in the
834following form:: 862following form::
835 863
836 inherit ${@'classname' if condition else ''} 864 inherit_defer ${@'classname' if condition else ''}
837 inherit ${@functionname(params)} 865
866Or::
867
868 inherit_defer ${@bb.utils.contains('VARIABLE', 'something', 'classname', '', d)}
838 869
839In all cases, if the expression evaluates to an 870In all cases, if the expression evaluates to an
840empty string, the statement does not trigger a syntax error because it 871empty string, the statement does not trigger a syntax error because it
@@ -869,6 +900,33 @@ definitions::
869 of include . Doing so makes sure that an error is produced if the file cannot 900 of include . Doing so makes sure that an error is produced if the file cannot
870 be found. 901 be found.
871 902
903``include_all`` Directive
904-------------------------
905
906The ``include_all`` directive works like the :ref:`include
907<bitbake-user-manual/bitbake-user-manual-metadata:\`\`include\`\` directive>`
908directive but will include all of the files that match the specified path in
909the enabled layers (layers part of :term:`BBLAYERS`).
910
911For example, let's say a ``maintainers.inc`` file is present in different layers
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
916 include_all conf/distro/include/maintainers.inc
917
918In other words, the ``maintainers.inc`` file for each layer is included through
919the :ref:`include <bitbake-user-manual/bitbake-user-manual-metadata:\`\`include\`\` directive>`
920directive.
921
922BitBake will iterate through the colon-separated :term:`BBPATH` list to look for
923matching files to include, from left to right. As a consequence, matching files
924are included in that order.
925
926As the ``include_all`` directive uses the :ref:`include
927<bitbake-user-manual/bitbake-user-manual-metadata:\`\`include\`\` directive>`
928directive in the background, no error is produced if no files are matched.
929
872.. _require-inclusion: 930.. _require-inclusion:
873 931
874``require`` Directive 932``require`` Directive
@@ -933,6 +991,65 @@ the ``autotools`` and ``pkgconfig`` classes::
933 991
934 INHERIT += "autotools pkgconfig" 992 INHERIT += "autotools pkgconfig"
935 993
994``addfragments`` Directive
995--------------------------
996
997This directive allows fine-tuning local configurations with configuration
998snippets contained in layers in a structured, controlled way. Typically it would
999go into ``bitbake.conf``, for example::
1000
1001 addfragments conf/fragments OE_FRAGMENTS OE_FRAGMENTS_METADATA_VARS OE_BUILTIN_FRAGMENTS
1002
1003``addfragments`` takes four parameters:
1004
1005- path prefix for fragment files inside the layer file tree that bitbake
1006 uses to construct full paths to the fragment files
1007
1008- name of variable that holds the list of enabled fragments in an
1009 active build
1010
1011- name of variable that contains a list of variable names containing
1012 fragment-specific metadata (such as descriptions)
1013
1014- name of variable that contains definitions for built-in fragments
1015
1016This allows listing enabled configuration fragments in ``OE_FRAGMENTS``
1017variable like this::
1018
1019 OE_FRAGMENTS = "core/domain/somefragment core/someotherfragment anotherlayer/anotherdomain/anotherfragment"
1020
1021Fragment names listed in this variable must be prefixed by the layer name
1022where a fragment file is located, defined by :term:`BBFILE_COLLECTIONS` in ``layer.conf``.
1023
1024The implementation then expands this list into
1025:ref:`require <bitbake-user-manual/bitbake-user-manual-metadata:\`\`require\`\` directive>`
1026directives with full paths to respective layers::
1027
1028 require /path/to/core-layer/conf/fragments/domain/somefragment.conf
1029 require /path/to/core-layer/conf/fragments/someotherfragment.conf
1030 require /path/to/another-layer/conf/fragments/anotherdomain/anotherfragment.conf
1031
1032The variable containing a list of fragment metadata variables could look like this::
1033
1034 OE_FRAGMENTS_METADATA_VARS = "BB_CONF_FRAGMENT_SUMMARY BB_CONF_FRAGMENT_DESCRIPTION"
1035
1036The implementation will add a flag containing the fragment name to each of those variables
1037when parsing fragments, so that the variables are namespaced by fragment name, and do not override
1038each other when several fragments are enabled.
1039
1040The variable containing a built-in fragment definitions could look like this::
1041
1042 OE_BUILTIN_FRAGMENTS = "someprefix:SOMEVARIABLE anotherprefix:ANOTHERVARIABLE"
1043
1044and then if 'someprefix/somevalue' is added to the variable that holds the list
1045of enabled fragments:
1046
1047 OE_FRAGMENTS = "... someprefix/somevalue"
1048
1049bitbake will treat that as direct value assignment in its configuration::
1050
1051 SOMEVARIABLE = "somevalue"
1052
936Functions 1053Functions
937========= 1054=========
938 1055
@@ -1303,8 +1420,8 @@ the task and other tasks. Here is an example that shows how to define a
1303task and declare some dependencies:: 1420task and declare some dependencies::
1304 1421
1305 python do_printdate () { 1422 python do_printdate () {
1306 import time 1423 import datetime
1307 print time.strftime('%Y%m%d', time.gmtime()) 1424 bb.plain('Date: %s' % (datetime.date.today()))
1308 } 1425 }
1309 addtask printdate after do_fetch before do_build 1426 addtask printdate after do_fetch before do_build
1310 1427
@@ -1972,11 +2089,8 @@ access. Here is a list of available operations:
1972Other Functions 2089Other Functions
1973--------------- 2090---------------
1974 2091
1975You can find many other functions that can be called from Python by 2092Other functions are documented in the
1976looking at the source code of the ``bb`` module, which is in 2093:doc:`/bitbake-user-manual/bitbake-user-manual-library-functions` document.
1977``bitbake/lib/bb``. For example, ``bitbake/lib/bb/utils.py`` includes
1978the commonly used functions ``bb.utils.contains()`` and
1979``bb.utils.mkdirhier()``, which come with docstrings.
1980 2094
1981Extending Python Library Code 2095Extending Python Library Code
1982----------------------------- 2096-----------------------------
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
index 899e584f91..6be8dbbf63 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
@@ -127,17 +127,10 @@ overview of their function and contents.
127 Contains the name of the currently running task. The name does not 127 Contains the name of the currently running task. The name does not
128 include the ``do_`` prefix. 128 include the ``do_`` prefix.
129 129
130 :term:`BB_DANGLINGAPPENDS_WARNONLY` 130 :term:`BB_CURRENT_MC`
131 Defines how BitBake handles situations where an append file 131 Contains the name of the current multiconfig a task is being run under.
132 (``.bbappend``) has no corresponding recipe file (``.bb``). This 132 The name is taken from the multiconfig configuration file (a file
133 condition often occurs when layers get out of sync (e.g. ``oe-core`` 133 ``mc1.conf`` would make this variable equal to ``mc1``).
134 bumps a recipe version and the old recipe no longer exists and the
135 other layer has not been updated to the new version of the recipe
136 yet).
137
138 The default fatal behavior is safest because it is the sane reaction
139 given something is out of sync. It is important to realize when your
140 changes are no longer being applied.
141 134
142 :term:`BB_DEFAULT_TASK` 135 :term:`BB_DEFAULT_TASK`
143 The default task to use when none is specified (e.g. with the ``-c`` 136 The default task to use when none is specified (e.g. with the ``-c``
@@ -317,6 +310,11 @@ overview of their function and contents.
317 310
318 For example usage, see :term:`BB_GIT_SHALLOW`. 311 For example usage, see :term:`BB_GIT_SHALLOW`.
319 312
313 :term:`BB_GIT_DEFAULT_DESTSUFFIX`
314 The default destination directory where the Git fetcher unpacks the
315 source code. If this variable is not set, the source code is unpacked in a
316 directory named "git".
317
320 :term:`BB_GIT_SHALLOW` 318 :term:`BB_GIT_SHALLOW`
321 Setting this variable to "1" enables the support for fetching, using and 319 Setting this variable to "1" enables the support for fetching, using and
322 generating mirror tarballs of `shallow git repositories <https://riptutorial.com/git/example/4584/shallow-clone>`_. 320 generating mirror tarballs of `shallow git repositories <https://riptutorial.com/git/example/4584/shallow-clone>`_.
@@ -327,11 +325,26 @@ overview of their function and contents.
327 mirror tarball. If the shallow mirror tarball cannot be fetched, it will 325 mirror tarball. If the shallow mirror tarball cannot be fetched, it will
328 try to fetch the full mirror tarball and use that. 326 try to fetch the full mirror tarball and use that.
329 327
330 When a mirror tarball is not available, a full git clone will be performed 328 This setting causes an initial shallow clone instead of an initial full bare clone.
331 regardless of whether this variable is set or not. Support for shallow 329 The amount of data transferred during the initial clone will be significantly reduced.
332 clones is not currently implemented as git does not directly support 330
333 shallow cloning a particular git commit hash (it only supports cloning 331 However, every time the source revision (referenced in :term:`SRCREV`)
334 from a tag or branch reference). 332 changes, regardless of whether the cache within the download directory
333 (defined by :term:`DL_DIR`) has been cleaned up or not,
334 the data transfer may be significantly higher because entirely
335 new shallow clones are required for each source revision change.
336
337 Over time, numerous shallow clones may cumulatively transfer
338 the same amount of data as an initial full bare clone.
339 This is especially the case with very large repositories.
340
341 Existing initial full bare clones, created without this setting,
342 will still be utilized.
343
344 If the Git error "Server does not allow request for unadvertised object"
345 occurs, an initial full bare clone is fetched automatically.
346 This may happen if the Git server does not allow the request
347 or if the Git client has issues with this functionality.
335 348
336 See also :term:`BB_GIT_SHALLOW_DEPTH` and 349 See also :term:`BB_GIT_SHALLOW_DEPTH` and
337 :term:`BB_GENERATE_SHALLOW_TARBALLS`. 350 :term:`BB_GENERATE_SHALLOW_TARBALLS`.
@@ -424,7 +437,7 @@ overview of their function and contents.
424 437
425 Example usage:: 438 Example usage::
426 439
427 BB_HASHSERVE_UPSTREAM = "hashserv.yocto.io:8687" 440 BB_HASHSERVE_UPSTREAM = "hashserv.yoctoproject.org:8686"
428 441
429 :term:`BB_INVALIDCONF` 442 :term:`BB_INVALIDCONF`
430 Used in combination with the ``ConfigParsed`` event to trigger 443 Used in combination with the ``ConfigParsed`` event to trigger
@@ -525,11 +538,28 @@ overview of their function and contents.
525 version 4.20 expose under ``/proc/pressure``. The threshold represents 538 version 4.20 expose under ``/proc/pressure``. The threshold represents
526 the difference in "total" pressure from the previous second. The 539 the difference in "total" pressure from the previous second. The
527 minimum value is 1.0 (extremely slow builds) and the maximum is 540 minimum value is 1.0 (extremely slow builds) and the maximum is
528 1000000 (a pressure value unlikely to ever be reached). 541 1000000 (a pressure value unlikely to ever be reached). See
542 https://docs.kernel.org/accounting/psi.html for more information.
543
544 A default value to limit the CPU pressure to be set in ``conf/local.conf``
545 could be::
529 546
530 This threshold can be set in ``conf/local.conf`` as:: 547 BB_PRESSURE_MAX_CPU = "15000"
531 548
532 BB_PRESSURE_MAX_CPU = "500" 549 Multiple values should be tested on the build host to determine what suits
550 best, depending on the need for performances versus load average during
551 the build.
552
553 .. note::
554
555 You may see numerous messages printed by BitBake in the case the
556 :term:`BB_PRESSURE_MAX_CPU` is too low:
557
558 Pressure status changed to CPU: True, IO: False, Mem: False (CPU: 1105.9/2.0, IO: 0.0/2.0, Mem: 0.0/2.0) - using 1/64 bitbake threads
559
560 This means that the :term:`BB_PRESSURE_MAX_CPU` should be increased to
561 a reasonable value for limiting the CPU pressure on the system.
562 Monitor the varying value after ``IO:`` above to set a sensible value.
533 563
534 :term:`BB_PRESSURE_MAX_IO` 564 :term:`BB_PRESSURE_MAX_IO`
535 Specifies a maximum I/O pressure threshold, above which BitBake's 565 Specifies a maximum I/O pressure threshold, above which BitBake's
@@ -541,14 +571,34 @@ overview of their function and contents.
541 version 4.20 expose under ``/proc/pressure``. The threshold represents 571 version 4.20 expose under ``/proc/pressure``. The threshold represents
542 the difference in "total" pressure from the previous second. The 572 the difference in "total" pressure from the previous second. The
543 minimum value is 1.0 (extremely slow builds) and the maximum is 573 minimum value is 1.0 (extremely slow builds) and the maximum is
544 1000000 (a pressure value unlikely to ever be reached). 574 1000000 (a pressure value unlikely to ever be reached). See
575 https://docs.kernel.org/accounting/psi.html for more information.
545 576
546 At this point in time, experiments show that IO pressure tends to 577 At this point in time, experiments show that IO pressure tends to
547 be short-lived and regulating just the CPU with 578 be short-lived and regulating just the CPU with
548 :term:`BB_PRESSURE_MAX_CPU` can help to reduce it. 579 :term:`BB_PRESSURE_MAX_CPU` can help to reduce it.
549 580
550 :term:`BB_PRESSURE_MAX_MEMORY` 581 A default value to limit the IO pressure to be set in ``conf/local.conf``
582 could be::
583
584 BB_PRESSURE_MAX_IO = "15000"
585
586 Multiple values should be tested on the build host to determine what suits
587 best, depending on the need for performances versus I/O usage during the
588 build.
589
590 .. note::
591
592 You may see numerous messages printed by BitBake in the case the
593 :term:`BB_PRESSURE_MAX_IO` is too low::
594
595 Pressure status changed to CPU: None, IO: True, Mem: False (CPU: 2236.0/None, IO: 153.6/2.0, Mem: 0.0/2.0) - using 19/64 bitbake threads
596
597 This means that the :term:`BB_PRESSURE_MAX_IO` should be increased to
598 a reasonable value for limiting the I/O pressure on the system.
599 Monitor the varying value after ``IO:`` above to set a sensible value.
551 600
601 :term:`BB_PRESSURE_MAX_MEMORY`
552 Specifies a maximum memory pressure threshold, above which BitBake's 602 Specifies a maximum memory pressure threshold, above which BitBake's
553 scheduler will not start new tasks (providing there is at least 603 scheduler will not start new tasks (providing there is at least
554 one active task). If no value is set, memory pressure is not 604 one active task). If no value is set, memory pressure is not
@@ -558,7 +608,8 @@ overview of their function and contents.
558 version 4.20 expose under ``/proc/pressure``. The threshold represents 608 version 4.20 expose under ``/proc/pressure``. The threshold represents
559 the difference in "total" pressure from the previous second. The 609 the difference in "total" pressure from the previous second. The
560 minimum value is 1.0 (extremely slow builds) and the maximum is 610 minimum value is 1.0 (extremely slow builds) and the maximum is
561 1000000 (a pressure value unlikely to ever be reached). 611 1000000 (a pressure value unlikely to ever be reached). See
612 https://docs.kernel.org/accounting/psi.html for more information.
562 613
563 Memory pressure is experienced when time is spent swapping, 614 Memory pressure is experienced when time is spent swapping,
564 refaulting pages from the page cache or performing direct reclaim. 615 refaulting pages from the page cache or performing direct reclaim.
@@ -566,6 +617,26 @@ overview of their function and contents.
566 might be useful as a last resort to prevent OOM errors if they are 617 might be useful as a last resort to prevent OOM errors if they are
567 occurring during builds. 618 occurring during builds.
568 619
620 A default value to limit the memory pressure to be set in
621 ``conf/local.conf`` could be::
622
623 BB_PRESSURE_MAX_MEMORY = "15000"
624
625 Multiple values should be tested on the build host to determine what suits
626 best, depending on the need for performances versus memory consumption
627 during the build.
628
629 .. note::
630
631 You may see numerous messages printed by BitBake in the case the
632 :term:`BB_PRESSURE_MAX_MEMORY` is too low::
633
634 Pressure status changed to CPU: None, IO: False, Mem: True (CPU: 29.5/None, IO: 0.0/2.0, Mem: 2553.3/2.0) - using 17/64 bitbake threads
635
636 This means that the :term:`BB_PRESSURE_MAX_MEMORY` should be increased to
637 a reasonable value for limiting the memory pressure on the system.
638 Monitor the varying value after ``Mem:`` above to set a sensible value.
639
569 :term:`BB_RUNFMT` 640 :term:`BB_RUNFMT`
570 Specifies the name of the executable script files (i.e. run files) 641 Specifies the name of the executable script files (i.e. run files)
571 saved into ``${``\ :term:`T`\ ``}``. By default, the 642 saved into ``${``\ :term:`T`\ ``}``. By default, the
@@ -699,6 +770,12 @@ overview of their function and contents.
699 Within an executing task, this variable holds the hash of the task as 770 Within an executing task, this variable holds the hash of the task as
700 returned by the currently enabled signature generator. 771 returned by the currently enabled signature generator.
701 772
773 :term:`BB_USE_HOME_NPMRC`
774 Controls whether or not BitBake uses the user's .npmrc file within their
775 home directory within the npm fetcher. This can be used for authentication
776 of private NPM registries, among other uses. This is turned off by default
777 and requires the user to explicitly set it to "1" to enable.
778
702 :term:`BB_VERBOSE_LOGS` 779 :term:`BB_VERBOSE_LOGS`
703 Controls how verbose BitBake is during builds. If set, shell scripts 780 Controls how verbose BitBake is during builds. If set, shell scripts
704 echo commands and shell script output appears on standard out 781 echo commands and shell script output appears on standard out
@@ -766,6 +843,10 @@ overview of their function and contents.
766 :term:`BBFILE_PRIORITY` 843 :term:`BBFILE_PRIORITY`
767 Assigns the priority for recipe files in each layer. 844 Assigns the priority for recipe files in each layer.
768 845
846 This variable is used in the ``conf/layer.conf`` file and must be
847 suffixed with a `_` followed by the name of the specific layer (e.g.
848 ``BBFILE_PRIORITY_emenlow``). Colon as separator is not supported.
849
769 This variable is useful in situations where the same recipe appears 850 This variable is useful in situations where the same recipe appears
770 in more than one layer. Setting this variable allows you to 851 in more than one layer. Setting this variable allows you to
771 prioritize a layer against other layers that contain the same recipe 852 prioritize a layer against other layers that contain the same recipe
@@ -780,7 +861,7 @@ overview of their function and contents.
780 higher precedence. For example, the value 6 has a higher precedence 861 higher precedence. For example, the value 6 has a higher precedence
781 than the value 5. If not specified, the :term:`BBFILE_PRIORITY` variable 862 than the value 5. If not specified, the :term:`BBFILE_PRIORITY` variable
782 is set based on layer dependencies (see the :term:`LAYERDEPENDS` variable 863 is set based on layer dependencies (see the :term:`LAYERDEPENDS` variable
783 for more information. The default priority, if unspecified for a 864 for more information). The default priority, if unspecified for a
784 layer with no dependencies, is the lowest defined priority + 1 (or 1 865 layer with no dependencies, is the lowest defined priority + 1 (or 1
785 if no priorities are defined). 866 if no priorities are defined).
786 867
diff --git a/bitbake/doc/conf.py b/bitbake/doc/conf.py
index fc2ee08111..f61241e28b 100644
--- a/bitbake/doc/conf.py
+++ b/bitbake/doc/conf.py
@@ -17,6 +17,8 @@
17import sys 17import sys
18import datetime 18import datetime
19 19
20from pathlib import Path
21
20current_version = "dev" 22current_version = "dev"
21 23
22# String used in sidebar 24# String used in sidebar
@@ -47,6 +49,7 @@ extlinks = {
47extensions = [ 49extensions = [
48 'sphinx.ext.autosectionlabel', 50 'sphinx.ext.autosectionlabel',
49 'sphinx.ext.extlinks', 51 'sphinx.ext.extlinks',
52 'sphinx.ext.autodoc',
50] 53]
51autosectionlabel_prefix_document = True 54autosectionlabel_prefix_document = True
52 55
@@ -99,3 +102,7 @@ html_last_updated_fmt = '%b %d, %Y'
99 102
100# Remove the trailing 'dot' in section numbers 103# Remove the trailing 'dot' in section numbers
101html_secnumber_suffix = " " 104html_secnumber_suffix = " "
105
106# autoconf needs the modules available to auto-generate documentation from the
107# code
108sys.path.insert(0, str(Path('..', 'lib').resolve()))
diff --git a/bitbake/doc/index.rst b/bitbake/doc/index.rst
index ee1660ac15..546ef36c16 100644
--- a/bitbake/doc/index.rst
+++ b/bitbake/doc/index.rst
@@ -16,6 +16,7 @@ BitBake User Manual
16 bitbake-user-manual/bitbake-user-manual-ref-variables-context 16 bitbake-user-manual/bitbake-user-manual-ref-variables-context
17 bitbake-user-manual/bitbake-user-manual-fetching 17 bitbake-user-manual/bitbake-user-manual-fetching
18 bitbake-user-manual/bitbake-user-manual-ref-variables 18 bitbake-user-manual/bitbake-user-manual-ref-variables
19 bitbake-user-manual/bitbake-user-manual-library-functions
19 bitbake-user-manual/bitbake-user-manual-hello 20 bitbake-user-manual/bitbake-user-manual-hello
20 21
21.. toctree:: 22.. toctree::
diff --git a/bitbake/doc/releases.rst b/bitbake/doc/releases.rst
index b38b1c0652..676db66ec5 100644
--- a/bitbake/doc/releases.rst
+++ b/bitbake/doc/releases.rst
@@ -4,11 +4,17 @@
4BitBake Supported Release Manuals 4BitBake Supported Release Manuals
5================================= 5=================================
6 6
7******************************
8Release Series 5.2 (walnascar)
9******************************
10
11- :yocto_docs:`BitBake 2.12 User Manual </bitbake/2.12/>`
12
7******************************* 13*******************************
8Release Series 4.2 (mickledore) 14Release Series 5.0 (scarthgap)
9******************************* 15*******************************
10 16
11- :yocto_docs:`BitBake 2.4 User Manual </bitbake/2.4/>` 17- :yocto_docs:`BitBake 2.8 User Manual </bitbake/2.8/>`
12 18
13****************************** 19******************************
14Release Series 4.0 (kirkstone) 20Release Series 4.0 (kirkstone)
@@ -16,15 +22,27 @@ Release Series 4.0 (kirkstone)
16 22
17- :yocto_docs:`BitBake 2.0 User Manual </bitbake/2.0/>` 23- :yocto_docs:`BitBake 2.0 User Manual </bitbake/2.0/>`
18 24
25================================
26BitBake Outdated Release Manuals
27================================
28
19**************************** 29****************************
20Release Series 3.1 (dunfell) 30Release Series 5.1 (styhead)
21**************************** 31****************************
22 32
23- :yocto_docs:`BitBake 1.46 User Manual </bitbake/1.46/>` 33- :yocto_docs:`BitBake 2.10 User Manual </bitbake/2.10/>`
24 34
25================================ 35*******************************
26BitBake Outdated Release Manuals 36Release Series 4.3 (nanbield)
27================================ 37*******************************
38
39- :yocto_docs:`BitBake 2.6 User Manual </bitbake/2.6/>`
40
41*******************************
42Release Series 4.2 (mickledore)
43*******************************
44
45- :yocto_docs:`BitBake 2.4 User Manual </bitbake/2.4/>`
28 46
29***************************** 47*****************************
30Release Series 4.1 (langdale) 48Release Series 4.1 (langdale)
@@ -50,10 +68,11 @@ Release Series 3.2 (gatesgarth)
50 68
51- :yocto_docs:`BitBake 1.48 User Manual </bitbake/1.48/>` 69- :yocto_docs:`BitBake 1.48 User Manual </bitbake/1.48/>`
52 70
53******************************************* 71****************************
54Release Series 3.1 (dunfell first versions) 72Release Series 3.1 (dunfell)
55******************************************* 73****************************
56 74
75- :yocto_docs:`BitBake 1.46 User Manual </bitbake/1.46/>`
57- :yocto_docs:`3.1 BitBake User Manual </3.1/bitbake-user-manual/bitbake-user-manual.html>` 76- :yocto_docs:`3.1 BitBake User Manual </3.1/bitbake-user-manual/bitbake-user-manual.html>`
58- :yocto_docs:`3.1.1 BitBake User Manual </3.1.1/bitbake-user-manual/bitbake-user-manual.html>` 77- :yocto_docs:`3.1.1 BitBake User Manual </3.1.1/bitbake-user-manual/bitbake-user-manual.html>`
59- :yocto_docs:`3.1.2 BitBake User Manual </3.1.2/bitbake-user-manual/bitbake-user-manual.html>` 78- :yocto_docs:`3.1.2 BitBake User Manual </3.1.2/bitbake-user-manual/bitbake-user-manual.html>`