diff options
| author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2025-02-06 23:56:04 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-02-11 11:44:19 +0000 |
| commit | 68bbc11f8f843a3b066130d4f2d887d45a4797c2 (patch) | |
| tree | e12f69a5e7abdfe21b81e28e46be6cef785f74f3 | |
| parent | df8f1ad5ccf59a2c4276513ba3e6fa859f6a2358 (diff) | |
| download | poky-68bbc11f8f843a3b066130d4f2d887d45a4797c2.tar.gz | |
kernel-fitimage.bbclass: introduce FIT_UBOOT_ENV
Introduce a new variable FIT_UBOOT_ENV, which allows to add a u-boot
script as a text file to the fitImage. Such a script can be sourced
from the u-boot shell, as documented here:
https://docs.u-boot.org/en/latest/usage/cmd/source.html#fit-image
The kernel-fitimage.bbclass also evaluates the existing UBOOT_ENV
variable and adds the corresponding script to the fitImage. However, the
UBOOT_ENV variable is also used to install the script as an old u-boot
image, usually named boot.scr into the /boot directory of the target
device. These are different use cases which should be handled
independently.
Appending the script to the u-boot recipe and then hand it over to the
kernel recipe via the staged /boot directory leads to complicated task
dependencies. Decoupling the two use cases will also allow to simplify
the implementation by dropping the evaluation of the UBOOT_ENV variable
in the kernel-fitimage.bbclass. But this commit is supposed to be
backward compatible.
(From OE-Core rev: 269605ed053fd8dc7bcbcc04a46c308188115f66)
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes-recipe/kernel-fitimage.bbclass | 5 | ||||
| -rw-r--r-- | meta/conf/image-fitimage.conf | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass index fe076badfa..bd2e371b63 100644 --- a/meta/classes-recipe/kernel-fitimage.bbclass +++ b/meta/classes-recipe/kernel-fitimage.bbclass | |||
| @@ -616,6 +616,11 @@ fitimage_assemble() { | |||
| 616 | bbwarn "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} not found." | 616 | bbwarn "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} not found." |
| 617 | fi | 617 | fi |
| 618 | fi | 618 | fi |
| 619 | if [ -n "${FIT_UBOOT_ENV}" ]; then | ||
| 620 | cp ${UNPACKDIR}/${FIT_UBOOT_ENV} ${B} | ||
| 621 | bootscr_id="${FIT_UBOOT_ENV}" | ||
| 622 | fitimage_emit_section_boot_script $1 "$bootscr_id" ${FIT_UBOOT_ENV} | ||
| 623 | fi | ||
| 619 | 624 | ||
| 620 | # | 625 | # |
| 621 | # Step 4: Prepare a setup section. (For x86) | 626 | # Step 4: Prepare a setup section. (For x86) |
diff --git a/meta/conf/image-fitimage.conf b/meta/conf/image-fitimage.conf index be9ae30134..9be7e45238 100644 --- a/meta/conf/image-fitimage.conf +++ b/meta/conf/image-fitimage.conf | |||
| @@ -51,3 +51,10 @@ FIT_ADDRESS_CELLS ?= "1" | |||
| 51 | # Then the images signature checking will not be mandatory and no error will be | 51 | # Then the images signature checking will not be mandatory and no error will be |
| 52 | # raised in case of failure. | 52 | # raised in case of failure. |
| 53 | # UBOOT_SIGN_IMG_KEYNAME = "dev2" # keys name in keydir (eg. "dev2.crt", "dev2.key") | 53 | # UBOOT_SIGN_IMG_KEYNAME = "dev2" # keys name in keydir (eg. "dev2.crt", "dev2.key") |
| 54 | |||
| 55 | # Additional environment variables or a script which can be sourced by u-boot | ||
| 56 | # can be packaged into the fitImage. An example is documented here: | ||
| 57 | # https://docs.u-boot.org/en/latest/usage/cmd/source.html#fit-image | ||
| 58 | # Machine configurations needing such a script file should include it in the | ||
| 59 | # SRC_URI of the kernel recipe and set the FIT_UBOOT_ENV parameter. | ||
| 60 | FIT_UBOOT_ENV ?= "" | ||
