]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
kernel-yocto: allow annotated options to be modified
authorBruce Ashfield <bruce.ashfield@gmail.com>
Tue, 6 May 2025 16:32:55 +0000 (12:32 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 May 2025 22:15:12 +0000 (23:15 +0100)
commit4eb24e85e815cee0e310e98ce4384d4cdeeba69f
tree32308aabbeea11fdcc9b954cee44caf1fc57dc85
parent4df1f0da627e0985312ae4a330e7f0800c0c87a5
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".

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/kernel-yocto.bbclass
meta/recipes-kernel/kern-tools/kern-tools-native_git.bb