From 657b45833260eab2430bbc982eca9c88e236fc0d Mon Sep 17 00:00:00 2001 From: Adrian Freihofer Date: Tue, 25 Feb 2025 23:24:42 +0100 Subject: [PATCH] ref-manual: cover UBOOT_ENV variables (From yocto-docs rev: dc2ff96a3401eba8dac86fc8305b261be52c8a13) Signed-off-by: Adrian Freihofer Reviewed-by: Quentin Schulz Signed-off-by: Antonin Godard Signed-off-by: Richard Purdie --- documentation/ref-manual/variables.rst | 63 ++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index 60984cc8f3..f18298c104 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -3183,6 +3183,31 @@ system and gives an overview of their function and contents. The default value for this variable is set to "2048" by the :ref:`ref-classes-kernel-fitimage` class. + :term:`FIT_UBOOT_ENV` + This variable allows to add a U-Boot script as a text file to the + FIT image. Such a script can be sourced from the U-Boot shell. + + When inheriting the :ref:`ref-classes-kernel-fitimage` class a + script file should be included in the :term:`SRC_URI` of the Linux + kernel recipe. + + Example: + + - Add a script ``boot.cmd`` to the Linux kernel recipe:: + + FIT_UBOOT_ENV = "boot.cmd" + SRC_URI += "file://${FIT_UBOOT_ENV}" + + - Use the script file from the U-Boot shell. The name of the script in + FIT image is ``bootscr-${FIT_UBOOT_ENV}``. This example loads the FIT + image from a TFTP server:: + + tftp $loadaddr $fit_tftp_path + source $loadaddr#bootscr-boot.cmd + + More information can be found in the official U-Boot documentation: + `U-Boot source command `__ + :term:`FONT_EXTRA_RDEPENDS` When inheriting the :ref:`ref-classes-fontcache` class, this variable specifies the runtime dependencies for font packages. @@ -9807,6 +9832,44 @@ system and gives an overview of their function and contents. :ref:`ref-classes-uboot-config` and :ref:`ref-classes-uboot-sign` classes. + :term:`UBOOT_ENV` + This variable allows to add additional environment variables or a script + to be installed together with U-Boot. + This file, typically ``uEnv.txt`` or ``boot.cmd``, is installed in + ``/boot`` as well as copied to the :term:`DEPLOYDIR` directory. + + For machine configurations needing one of these files a ``.bbappend`` + file should include it in the :term:`SRC_URI` of the U-Boot recipe. + + If the variable :term:`UBOOT_ENV_SUFFIX` is set to ``scr`` the script is + packaged as a uImage (``mkimage -T script..``) otherwise it gets + installed verbatim. + + Some examples: + + - Adding a script ``boot.cmd`` as a uImage to ``/boot``:: + + UBOOT_ENV = "boot" + UBOOT_ENV_SUFFIX = "scr" + SRC_URI += "file://${UBOOT_ENV_SRC}" + + - Adding a script ``uEnv.txt`` as a plain text file to ``/boot``:: + + UBOOT_ENV = "uEnv" + UBOOT_ENV_SUFFIX = "txt" + SRC_URI += "file://${UBOOT_ENV_BINARY}" + + :term:`UBOOT_ENV_SRC_SUFFIX` + If :term:`UBOOT_ENV_SUFFIX` is set to ``scr`` this is the suffix of the + plain text script file as it is specified in the :term:`SRC_URI` of the + U-Boot recipe. It defaults to ``cmd``. + + :term:`UBOOT_ENV_SUFFIX` + If this variable is set to ``scr`` the script referred to by + :term:`UBOOT_ENV` gets packaged as a uImage before it gets installed. + The default is ``txt`` which means the script is installed as-is, with + no modification. + :term:`UBOOT_FIT_ADDRESS_CELLS` Specifies the value of the ``#address-cells`` value for the description of the U-Boot FIT image.