summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPaul Eggleton <bluelightning@bluelightning.org>2023-04-22 15:05:22 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-04-22 10:30:42 +0100
commita91fb4ff7491d54d012798dbcd31020ac9b8da3a (patch)
tree91db6167cd4b4260b23556afaee081b6fd477b61 /bitbake
parent54f3339f38424c4b56cb04a60a099206433e3395 (diff)
downloadpoky-a91fb4ff7491d54d012798dbcd31020ac9b8da3a.tar.gz
bitbake: bitbake-user-manual: add addpylib and BB_GLOBAL_PYMODULES
New directive and variable for 2.4. (Bitbake rev: 1b74a7b71e6c8a034163b57ef4e13b4a58c1f844) Signed-off-by: Paul Eggleton <bluelightning@bluelightning.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst18
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst8
2 files changed, 26 insertions, 0 deletions
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 ba8129afab..b35c332c82 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
@@ -1972,6 +1972,24 @@ looking at the source code of the ``bb`` module, which is in
1972the commonly used functions ``bb.utils.contains()`` and 1972the commonly used functions ``bb.utils.contains()`` and
1973``bb.utils.mkdirhier()``, which come with docstrings. 1973``bb.utils.mkdirhier()``, which come with docstrings.
1974 1974
1975Extending Python Library Code
1976-----------------------------
1977
1978If you wish to add your own Python library code (e.g. to provide
1979functions/classes you can use from Python functions in the metadata)
1980you can do so from any layer using the ``addpylib`` directive.
1981This directive is typically added to your layer configuration (
1982``conf/layer.conf``) although it will be handled in any ``.conf`` file.
1983
1984Usage is of the form::
1985
1986 addpylib <directory> <namespace>
1987
1988Where <directory> specifies the directory to add to the library path.
1989The specified <namespace> is imported automatically, and if the imported
1990module specifies an attribute named ``BBIMPORTS``, that list of
1991sub-modules is iterated and imported too.
1992
1975Testing and Debugging BitBake Python code 1993Testing and Debugging BitBake Python code
1976----------------------------------------- 1994-----------------------------------------
1977 1995
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 1cf37d5fcd..fc7cb88238 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
@@ -348,6 +348,14 @@ overview of their function and contents.
348 348
349 For example usage, see :term:`BB_GIT_SHALLOW`. 349 For example usage, see :term:`BB_GIT_SHALLOW`.
350 350
351 :term:`BB_GLOBAL_PYMODULES`
352 Specifies the list of Python modules to place in the global namespace.
353 It is intended that only the core layer should set this and it is meant
354 to be a very small list, typically just ``os`` and ``sys``.
355 :term:`BB_GLOBAL_PYMODULES` is expected to be set before the first
356 ``addpylib`` directive.
357 See also ":ref:`bitbake-user-manual/bitbake-user-manual-metadata:extending python library code`".
358
351 :term:`BB_HASHCHECK_FUNCTION` 359 :term:`BB_HASHCHECK_FUNCTION`
352 Specifies the name of the function to call during the "setscene" part 360 Specifies the name of the function to call during the "setscene" part
353 of the task's execution in order to validate the list of task hashes. 361 of the task's execution in order to validate the list of task hashes.