From 3d3ee723805ea89642ffcfdae48c4632605ec1df Mon Sep 17 00:00:00 2001 From: Kirill Kapranov Date: Thu, 14 Oct 2021 17:51:25 +0300 Subject: [PATCH] meta: Introduce RT kernel patch Signed-off-by: Kirill Kapranov --- recipes-kernel/linux-rt/linux-imx_%.bbappend | 22 ++++++++++++++++++++ recipes-kernel/linux-rt/rt.inc | 2 ++ templates/local.conf/rt_kernel.append | 3 +++ 3 files changed, 27 insertions(+) create mode 100644 recipes-kernel/linux-rt/linux-imx_%.bbappend create mode 100644 recipes-kernel/linux-rt/rt.inc create mode 100644 templates/local.conf/rt_kernel.append diff --git a/recipes-kernel/linux-rt/linux-imx_%.bbappend b/recipes-kernel/linux-rt/linux-imx_%.bbappend new file mode 100644 index 0000000..f83db78 --- /dev/null +++ b/recipes-kernel/linux-rt/linux-imx_%.bbappend @@ -0,0 +1,22 @@ +include rt.inc + +python (){ + import re + + if bb.utils.contains('IMAGE_FEATURES', 'realtime-kernel', False, True, d): + return + + PV = d.getVar("PV") + major_dot_minor_dot_fix = re.sub(r'\+.*$', '', PV) + + rt_patch_uri = d.getVar('RT_PATCH_URI') + if re.search(r'patch-' + major_dot_minor_dot_fix + '-rt', rt_patch_uri): + d.appendVar("SRC_URI"," " + rt_patch_uri + " ") + else: + patch_name = re.search(r'^.*(patch-[\.0-9]*-rt[\.0-9]*\.patch).*$',rt_patch_uri) + if patch_name: + bb.error("RT patch: " + patch_name.group(1)) + bb.error("Kernel revision to build: " + major_dot_minor_dot_fix) + bb.error("Please find an appropriate patch on https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt") + #bb.fatal("RT patch revision doesn't match the kernel revision we are about to build") +} diff --git a/recipes-kernel/linux-rt/rt.inc b/recipes-kernel/linux-rt/rt.inc new file mode 100644 index 0000000..99d730b --- /dev/null +++ b/recipes-kernel/linux-rt/rt.inc @@ -0,0 +1,2 @@ +RT_PATCH_URI = "https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patch-5.10.35-rt39.patch.xz;sha256sum=3e1d3531173d5bb276935eaec016ef3c3c0f8f4fcc1fc418d192cc10824ff80d" + diff --git a/templates/local.conf/rt_kernel.append b/templates/local.conf/rt_kernel.append new file mode 100644 index 0000000..668a83b --- /dev/null +++ b/templates/local.conf/rt_kernel.append @@ -0,0 +1,3 @@ +#;prompt Realtime kernel support [no] + +IMAGE_FEATURES += " realtime-kernel "