Add additional task, do_patch_xenomai, inserted between do_patch and
do_configure tasks. This task applies the cobalt patch to the kernel
sources for a specific machine. This is disabled by default, so use
PACKAGECONFIG[xenomai] of the kernel package to enable the patching.

You will also need a kernel recipe for a kernel version with ipipe
patch applied.

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Richard Purdie <richard.pur...@linuxfoundation.org>
---
 meta/classes/kernel.bbclass | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index f7b612f84f..70fc39086c 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -481,6 +481,22 @@ do_shared_workdir () {
        fi
 }
 
+PACKAGECONFIG[xenomai] = ",,"
+
+do_patch_xenomai[depends] += "${@bb.utils.contains('PACKAGECONFIG', 'xenomai', 
'xenomai:do_patch', '', d)}"
+do_patch_xenomai() {
+       set +e
+       cd ${S}
+
+       if [ "${@bb.utils.contains('PACKAGECONFIG', 'xenomai', 'yes', 'no', 
d)}" = "yes" ]; then
+               
${TMPDIR}/work-shared/${MACHINE}/xenomai-source/scripts/prepare-kernel.sh \
+                       --arch=${TARGET_ARCH} \
+                       --linux=${STAGING_KERNEL_DIR} ;
+       fi
+}
+
+addtask patch_xenomai before do_configure after do_patch
+
 # We don't need to stage anything, not the modules/firmware since those would 
clash with linux-firmware
 sysroot_stage_all () {
        :
-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to