diff options
-rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 18 | ||||
-rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst | 8 |
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 | |||
1972 | the commonly used functions ``bb.utils.contains()`` and | 1972 | the 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 | ||
1975 | Extending Python Library Code | ||
1976 | ----------------------------- | ||
1977 | |||
1978 | If you wish to add your own Python library code (e.g. to provide | ||
1979 | functions/classes you can use from Python functions in the metadata) | ||
1980 | you can do so from any layer using the ``addpylib`` directive. | ||
1981 | This directive is typically added to your layer configuration ( | ||
1982 | ``conf/layer.conf``) although it will be handled in any ``.conf`` file. | ||
1983 | |||
1984 | Usage is of the form:: | ||
1985 | |||
1986 | addpylib <directory> <namespace> | ||
1987 | |||
1988 | Where <directory> specifies the directory to add to the library path. | ||
1989 | The specified <namespace> is imported automatically, and if the imported | ||
1990 | module specifies an attribute named ``BBIMPORTS``, that list of | ||
1991 | sub-modules is iterated and imported too. | ||
1992 | |||
1975 | Testing and Debugging BitBake Python code | 1993 | Testing 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. |