summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2025-05-06 12:32:55 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-05-08 23:16:54 +0100
commitfbb8798743b622db91f2eb3b1d73989066e9948a (patch)
treed7ee9ccb62f4d8f2c896fc640d9f9f9a0e27caa6
parenta7331c399252c8b365e51290c8eba3d2f6aa6fa1 (diff)
downloadpoky-fbb8798743b622db91f2eb3b1d73989066e9948a.tar.gz
kernel-yocto: allow annotated options to be modified
Bumping the kern-tools SRCREV to pickup the following commits: tools: allow fixups to conditionally change options Sometimes we have options that should either be =y or =m depending on the use case. Rather than force the options into multiple parallel and very similar fragments (which is error prone and labour intensive), we can allow an annotation in the configuration fragment that allows the default value to be overriden by a variable. The variable in question comes from a -D<var>=<value> on the scc or spp command line. If the define evaluates to a non-zero value a fixup is created that will modify the value when scc finishes gathering meta-data. An example of a notation would be: CONFIG_INET_TUNNEL=y # OVERRIDE:$MODULE_OR_Y CONFIG_INET_TUNNEL will be =y when standard tools (like merge-config) are used. But when scc/spp see this notation, they check the value of the variable MODULE_OR_Y, if that variable evalutes to a non-zero value, a fixup is created that will change CONFIG_INET_TUNNEL to that value before the kernel is configured. To use the annotations, scc needs to be passed a value that is used in the override expression. This has always been possible with defines (-Dx=y), so we leverage that to control these conditional overrides. In kernel-yocto, we now have a variable: KMETA_CONFIG_FEATURES KMETA_CONFIG_FEATURES ?= "" Which defaults to empty, the only feature that is currently implemented is "prefer-modules". When prefer-modules is detected in the kmeta config features, the following define is passed to scc: -DMODULE_OR_Y=m Which as you can see from the above INET_TUNNEL example, will evaluate to "m" and will override the default of "y". (From OE-Core rev: 4eb24e85e815cee0e310e98ce4384d4cdeeba69f) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-recipe/kernel-yocto.bbclass7
-rw-r--r--meta/recipes-kernel/kern-tools/kern-tools-native_git.bb2
2 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
index cef6b9ec3f..ba93145fd3 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -25,6 +25,7 @@ KCONF_AUDIT_LEVEL ?= "1"
25KCONF_BSP_AUDIT_LEVEL ?= "0" 25KCONF_BSP_AUDIT_LEVEL ?= "0"
26KMETA_AUDIT ?= "yes" 26KMETA_AUDIT ?= "yes"
27KMETA_AUDIT_WERROR ?= "" 27KMETA_AUDIT_WERROR ?= ""
28KMETA_CONFIG_FEATURES ?= ""
28 29
29# returns local (absolute) path names for all valid patches in the 30# returns local (absolute) path names for all valid patches in the
30# src_uri 31# src_uri
@@ -298,7 +299,11 @@ do_kernel_metadata() {
298 elements="`echo -n ${bsp_definition} $sccs_defconfig ${sccs} ${patches} $KERNEL_FEATURES_FINAL`" 299 elements="`echo -n ${bsp_definition} $sccs_defconfig ${sccs} ${patches} $KERNEL_FEATURES_FINAL`"
299 if [ -n "${elements}" ]; then 300 if [ -n "${elements}" ]; then
300 echo "${bsp_definition}" > ${S}/${meta_dir}/bsp_definition 301 echo "${bsp_definition}" > ${S}/${meta_dir}/bsp_definition
301 scc --force -o ${S}/${meta_dir}:cfg,merge,meta ${includes} $sccs_defconfig $bsp_definition $sccs $patches $KERNEL_FEATURES_FINAL 302 echo "${KMETA_CONFIG_FEATURES}" | grep -q "prefer-modules"
303 if [ $? -eq 0 ]; then
304 scc_defines="-DMODULE_OR_Y=m"
305 fi
306 scc --force $scc_defines -o ${S}/${meta_dir}:cfg,merge,meta ${includes} $sccs_defconfig $bsp_definition $sccs $patches $KERNEL_FEATURES_FINAL
302 if [ $? -ne 0 ]; then 307 if [ $? -ne 0 ]; then
303 bbfatal_log "Could not generate configuration queue for ${KMACHINE}." 308 bbfatal_log "Could not generate configuration queue for ${KMACHINE}."
304 fi 309 fi
diff --git a/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
index 6dd19f1f09..20b1bcaf37 100644
--- a/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
+++ b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "\
11 11
12DEPENDS += "git-replacement-native" 12DEPENDS += "git-replacement-native"
13 13
14SRCREV = "c8c1f17867d0cc7d04be225ba4901f2373428be2" 14SRCREV = "fe67c98d2e9b74af44d0c4b660fa18e3a95e7edd"
15PV = "0.3+git" 15PV = "0.3+git"
16 16
17inherit native 17inherit native