diff mbox series

[v4,05/16] kernel-uboot.bbclass: deploy the vmlinux kernel binary

Message ID 20250519110838.82978-6-adrian.freihofer@siemens.com
State New
Headers show
Series FIT image improvements | expand

Commit Message

Freihofer, Adrian May 19, 2025, 11:07 a.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

Extend the kernel-uboot.bbclass to build and deploy the kernel binary
intended for inclusion in a FIT image.
Note that the kernel used in a FIT image is a stripped (and optionally
compressed) vmlinux ELF binary - not a self-extracting format like
zImage, which is already available in the deploy directory if needed
separately.

The kernel.bbclass inherits all classes listed in the KERNEL_CLASSES
variable. By default, KERNEL_CLASSES is defined as:
  KERNEL_CLASSES ?= " kernel-uimage "
Since kernel-uimage.bbclass inherits from kernel-uboot.bbclass, the
creation and deployment of the kernel binary for inclusion in a FIT
image happens automatically by default.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 meta/classes-recipe/kernel-uboot.bbclass | 11 ++++++++++-
 1 file changed, 10 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..e26ba6f0aa9 100644
--- a/meta/classes-recipe/kernel-uboot.bbclass
+++ b/meta/classes-recipe/kernel-uboot.bbclass
@@ -56,4 +56,13 @@  uboot_prep_kimage() {
 	fi
 
 	printf "$linux_comp" > "$output_dir/linux_comp"
-}
\ No newline at end of file
+}
+
+kernel_do_deploy:append() {
+	# Provide the kernel artifacts to post processing recipes e.g. for creating a FIT image
+	uboot_prep_kimage "$deployDir"
+	# For x86 a setup.bin needs to be include"d in a fitImage as well
+	if [ -e ${KERNEL_OUTPUT_DIR}/setup.bin ]; then
+		install -D "${B}/${KERNEL_OUTPUT_DIR}/setup.bin" "$deployDir/"
+	fi
+}