diff mbox

[v2,0/2] kernel-fit-image: control kernel section with FIT_LINUX_BIN

Message ID 20250904093122.593125-1-kavinaya@qti.qualcomm.com
State Not Applicable, archived
Headers show

Commit Message

Kavinaya S Sept. 4, 2025, 9:31 a.m. UTC
Update kernel-fit-image.bbclass to conditionally include the kernel
section based on FIT_LINUX_BIN variable.

Signed-off-by: Kavinaya S <kavinaya@qti.qualcomm.com>
Cc: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 meta/classes-recipe/kernel-fit-image.bbclass | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/meta/classes-recipe/kernel-fit-image.bbclass b/meta/classes-recipe/kernel-fit-image.bbclass
index fd4c6a30fe..f04aee1807 100644
--- a/meta/classes-recipe/kernel-fit-image.bbclass
+++ b/meta/classes-recipe/kernel-fit-image.bbclass
@@ -59,12 +59,14 @@  python do_compile() {
     )
 
     # Prepare a kernel image section.
-    shutil.copyfile(os.path.join(kernel_deploydir, "linux.bin"), "linux.bin")
-    with open(os.path.join(kernel_deploydir, "linux_comp")) as linux_comp_f:
-        linux_comp = linux_comp_f.read()
-    root_node.fitimage_emit_section_kernel("kernel-1", "linux.bin", linux_comp,
-        d.getVar('UBOOT_LOADADDRESS'), d.getVar('UBOOT_ENTRYPOINT'),
-        d.getVar('UBOOT_MKIMAGE_KERNEL_TYPE'), d.getVar("UBOOT_ENTRYSYMBOL"))
+    linux_bin = d.getVar('FIT_LINUX_BIN')
+    if linux_bin:
+        shutil.copyfile(os.path.join(kernel_deploydir, "linux.bin"), "linux.bin")
+        with open(os.path.join(kernel_deploydir, "linux_comp")) as linux_comp_f:
+            linux_comp = linux_comp_f.read()
+        root_node.fitimage_emit_section_kernel("kernel-1", "linux.bin", linux_comp,
+            d.getVar('UBOOT_LOADADDRESS'), d.getVar('UBOOT_ENTRYPOINT'),
+            d.getVar('UBOOT_MKIMAGE_KERNEL_TYPE'), d.getVar("UBOOT_ENTRYSYMBOL"))
 
     # Prepare a DTB image section
     kernel_devicetree = d.getVar('KERNEL_DEVICETREE')