diff mbox series

[06/20] kernel-uboot.bbclass: stage the kernel binary

Message ID 20250504130507.717954-6-adrian.freihofer@siemens.com
State New
Headers show
Series [01/20] oe-selftest: add new ext dtb recipe | expand

Commit Message

Freihofer, Adrian May 4, 2025, 1:04 p.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

Extend the kernel-uboot.bbclass to expport the kernel binary which is
needed for creating a FIT image to the sysroot-only directory.
This will allow to use
  KERNEL_CLASSES += "kernel-uboot"
and a recipe which creates the FIT image using artifacts from
sysroot-only instead of the kernel-fitimage.bbclass
  KERNEL_CLASSES = " kernel-fitimage "
which does not work with sstate-cache.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 meta/classes-recipe/kernel-uboot.bbclass | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel-uboot.bbclass b/meta/classes-recipe/kernel-uboot.bbclass
index d2a63524ece..7aafd4757c2 100644
--- a/meta/classes-recipe/kernel-uboot.bbclass
+++ b/meta/classes-recipe/kernel-uboot.bbclass
@@ -56,4 +56,14 @@  uboot_prep_kimage() {
 	fi
 
 	printf "$linux_comp" > "$output_dir/linux_comp"
-}
\ No newline at end of file
+}
+
+do_install:append() {
+	# Provide the kernel artifacts to post processing recipes e.g. for creating a FIT image
+	install -d ${D}/sysroot-only
+	uboot_prep_kimage ${D}/sysroot-only
+	# For x86 a setup.bin needs to be included in a fitImage as well
+	if [ -e ${KERNEL_OUTPUT_DIR}/setup.bin ]; then
+		install -D ${B}/${KERNEL_OUTPUT_DIR}/setup.bin ${D}/sysroot-only/setup.bin
+	fi
+}