Re: Recipe with kernel configuration fragment

Quentin Schulz

Hi Maik,

On 8/10/22 17:19, Maik Vermeulen wrote:
For a firewall recipe using nftables we need to make some kernel
configuration changes.
At first we added the needed CONFIG_ lines to a bbappend in the
recipes-kernel directory of our own layer, but I think it would be neater
to include the CONFIG_ changes in the recipe that needs them, if possible.
This is not possible because recipe data is local to the recipe, you cannot impact a recipe from another one.

The only way to have 2+ recipes doing some things in sync is by having a variable set in a global scope. Such is the case for configuration files (distro and machine). Since the selection of nftables or not is not related to HW but policy, it should be in a distro configruation file.

You could add a custom DISTRO_FEATURES to your own distro and check the presence of this feature in your kernel recipe and apply the config fragment with required changes. And you can make the nftables package or whatever require this feature with REQUIRED_DISTRO_FEATURES.


Join to automatically receive all group messages.