From 68bbc11f8f843a3b066130d4f2d887d45a4797c2 Mon Sep 17 00:00:00 2001 From: Adrian Freihofer Date: Thu, 6 Feb 2025 23:56:04 +0100 Subject: 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 Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- meta/classes-recipe/kernel-fitimage.bbclass | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'meta/classes-recipe') 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() { bbwarn "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} not found." fi fi + if [ -n "${FIT_UBOOT_ENV}" ]; then + cp ${UNPACKDIR}/${FIT_UBOOT_ENV} ${B} + bootscr_id="${FIT_UBOOT_ENV}" + fitimage_emit_section_boot_script $1 "$bootscr_id" ${FIT_UBOOT_ENV} + fi # # Step 4: Prepare a setup section. (For x86) -- cgit v1.2.3-54-g00ecf