diff mbox series

[yocto-patches,meta-zephyr,master,7/9] zephyr-kernel: Move patch out of zephyr-kernel-src*.inc file

Message ID 20260307044353.1936182-8-sandeep.gundlupet-raju@amd.com
State New
Headers show
Series Update to v4.3.0 | expand

Commit Message

Gundlupet Raju, Sandeep March 7, 2026, 4:43 a.m. UTC
zephyr-kernel-src-4.2.0.inc is an auto generated file and it shouldn't
be edited by hand. So move 0001-fix-unable-find-gen_kobject_list.py.patch
from zephyr-kernel-src-4.2.0.inc to zephyr-kernel-src.inc file and make
this being applied conditionally based on PREFERRED_VERSION_zephyr-kernel
only.

Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>
---
 .../zephyr-kernel/zephyr-kernel-src-4.2.0.inc             | 1 -
 .../recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc    | 8 ++++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src-4.2.0.inc b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src-4.2.0.inc
index 9ec8c88..40bfb6c 100644
--- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src-4.2.0.inc
+++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src-4.2.0.inc
@@ -146,7 +146,6 @@  SRC_URI_ZEPHYR_ZCBOR ?= "git://github.com/zephyrproject-rtos/zcbor;protocol=http
 
 SRC_URI_PATCHES ?= "\
     file://0001-v4.2.0-x86-fix-efi-binary-generation-issue-in-cross-compila.patch;patchdir=zephyr \
-    file://0001-fix-unable-find-gen_kobject_list.py.patch;patchdir=zephyr \
 "
 
 SRC_URI = "\
diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc
index a1ee973..d89610f 100644
--- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc
+++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src.inc
@@ -12,6 +12,14 @@  FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
 
 require recipes-kernel/zephyr-kernel/zephyr-kernel-src-${PREFERRED_VERSION_zephyr-kernel}.inc
 
+# The patch to fix the issue of gen_kobject_list.py not being found is required
+# for Zephyr 4.2.0 and above, but it doesn't apply to Zephyr 4.1.0 and below version,
+# so we conditionally add it to the SRC_URI based on the version of zephyr-kernel
+# being built.
+SRC_URI:append = "\
+    ${@'file://0001-fix-unable-find-gen_kobject_list.py.patch;patchdir=zephyr' if bb.utils.vercmp_string(d.getVar('PREFERRED_VERSION_zephyr-kernel'), '4.2.0') >= 0 else ''} \
+"
+
 # python3-jsonschema-native is required starting from Zephyr 4.3.0
 DEPENDS += "\
     ${@'python3-jsonschema-native' if bb.utils.vercmp_string(d.getVar('PREFERRED_VERSION_zephyr-kernel'), '4.3.0') >= 0 else ''} \