[2/2] linux-module: inherit per-kernel

Message ID 20250407160148.443385-3-chris.larson@siemens.com
State New
Headers show
Series Add support for per-kernel recipe variants | expand

Commit Message

chris.larson April 7, 2025, 4:01 p.m. UTC
From: Christopher Larson <chris.larson@siemens.com>

This ensures that it's possible to build the kernel module for all kernels which
are supported by the current MACHINE. This will have no effect unless the
KERNEL_NAMES variable is adjusted to add more than just KERNEL_NAME.

Signed-off-by: Christopher Larson <chris.larson@siemens.com>
---
 meta/recipes-kernel/linux-module/module.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Cedric Hombourger April 7, 2025, 7:25 p.m. UTC | #1
On Mon, 2025-04-07 at 09:01 -0700, chris.larson@siemens.com wrote:
> From: Christopher Larson <chris.larson@siemens.com>
> 
> This ensures that it's possible to build the kernel module for all
> kernels which
> are supported by the current MACHINE. This will have no effect unless
> the
> KERNEL_NAMES variable is adjusted to add more than just KERNEL_NAME.
> 
> 

Tested-by: Cedric Hombourger <cedric.hombourger@siemens.com>

> Signed-off-by: Christopher Larson <chris.larson@siemens.com>
> ---
>  meta/recipes-kernel/linux-module/module.inc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-kernel/linux-module/module.inc
> b/meta/recipes-kernel/linux-module/module.inc
> index 3b0ceae7..47086158 100644
> --- a/meta/recipes-kernel/linux-module/module.inc
> +++ b/meta/recipes-kernel/linux-module/module.inc
> @@ -42,7 +42,7 @@ python() {
>          d.setVar('ISAR_CROSS_COMPILE', '0')
>  }
>  
> -inherit dpkg
> +inherit dpkg per-kernel
>  
>  TEMPLATE_FILES = "debian/control.tmpl \
>                    debian/rules.tmpl"
Florian Bezdeka April 8, 2025, 8:07 a.m. UTC | #2
On Mon, 2025-04-07 at 09:01 -0700, chris.larson via isar-users wrote:
> From: Christopher Larson <chris.larson@siemens.com>
> 
> This ensures that it's possible to build the kernel module for all kernels which
> are supported by the current MACHINE. This will have no effect unless the
> KERNEL_NAMES variable is adjusted to add more than just KERNEL_NAME.
> 
> Signed-off-by: Christopher Larson <chris.larson@siemens.com>
> ---
>  meta/recipes-kernel/linux-module/module.inc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
> index 3b0ceae7..47086158 100644
> --- a/meta/recipes-kernel/linux-module/module.inc
> +++ b/meta/recipes-kernel/linux-module/module.inc
> @@ -42,7 +42,7 @@ python() {
>          d.setVar('ISAR_CROSS_COMPILE', '0')
>  }
>  
> -inherit dpkg
> +inherit dpkg per-kernel

AFAIR the rest of the code base uses one inherit statement per class.

>  
>  TEMPLATE_FILES = "debian/control.tmpl \
>                    debian/rules.tmpl"
> -- 
> 2.47.2
Cedric Hombourger April 8, 2025, 8:13 a.m. UTC | #3
On Tue, 2025-04-08 at 10:07 +0200, Florian Bezdeka wrote:
> On Mon, 2025-04-07 at 09:01 -0700, chris.larson via isar-users wrote:
> > From: Christopher Larson <chris.larson@siemens.com>
> > 
> > This ensures that it's possible to build the kernel module for all
> > kernels which
> > are supported by the current MACHINE. This will have no effect
> > unless the
> > KERNEL_NAMES variable is adjusted to add more than just
> > KERNEL_NAME.
> > 
> > Signed-off-by: Christopher Larson <chris.larson@siemens.com>
> > ---
> >  meta/recipes-kernel/linux-module/module.inc | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/meta/recipes-kernel/linux-module/module.inc
> > b/meta/recipes-kernel/linux-module/module.inc
> > index 3b0ceae7..47086158 100644
> > --- a/meta/recipes-kernel/linux-module/module.inc
> > +++ b/meta/recipes-kernel/linux-module/module.inc
> > @@ -42,7 +42,7 @@ python() {
> >          d.setVar('ISAR_CROSS_COMPILE', '0')
> >  }
> >  
> > -inherit dpkg
> > +inherit dpkg per-kernel
> 
> AFAIR the rest of the code base uses one inherit statement per class.

Correct (just checked). On the other hand, meta-openembedded uses
multiple the above construct very often (more often than not as far as
I can tell).

I understand that isar and meta-openembedded are not the same projects
but I would not nitpick on that as I don't think it hurts readability
IMHO (it would if we had a dozen classes imported)

> 
> >  
> >  TEMPLATE_FILES = "debian/control.tmpl \
> >                    debian/rules.tmpl"
> > -- 
> > 2.47.2
>
chris.larson April 8, 2025, 5:12 p.m. UTC | #4
On 4/8/2025 1:13 AM, Hombourger, Cedric (FT FDS CES LX) wrote:
> On Tue, 2025-04-08 at 10:07 +0200, Florian Bezdeka wrote:
>> On Mon, 2025-04-07 at 09:01 -0700, chris.larson via isar-users wrote:
>>> From: Christopher Larson <chris.larson@siemens.com>
>>>
>>> This ensures that it's possible to build the kernel module for all
>>> kernels which
>>> are supported by the current MACHINE. This will have no effect
>>> unless the
>>> KERNEL_NAMES variable is adjusted to add more than just
>>> KERNEL_NAME.
>>>
>>> Signed-off-by: Christopher Larson <chris.larson@siemens.com>
>>> ---
>>>   meta/recipes-kernel/linux-module/module.inc | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/meta/recipes-kernel/linux-module/module.inc
>>> b/meta/recipes-kernel/linux-module/module.inc
>>> index 3b0ceae7..47086158 100644
>>> --- a/meta/recipes-kernel/linux-module/module.inc
>>> +++ b/meta/recipes-kernel/linux-module/module.inc
>>> @@ -42,7 +42,7 @@ python() {
>>>           d.setVar('ISAR_CROSS_COMPILE', '0')
>>>   }
>>>   
>>> -inherit dpkg
>>> +inherit dpkg per-kernel
>>
>> AFAIR the rest of the code base uses one inherit statement per class.
> 
> Correct (just checked). On the other hand, meta-openembedded uses
> multiple the above construct very often (more often than not as far as
> I can tell).
> 
> I understand that isar and meta-openembedded are not the same projects
> but I would not nitpick on that as I don't think it hurts readability
> IMHO (it would if we had a dozen classes imported)

Apologies, I'm still adapting to the differences from Yocto. I have no objection to 
aligning this with isar repository convention in a v2. I did want to confirm that there was no objection to this feature before diving too deep into the tests, so I should have used an RFC prefix.

Patch

diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index 3b0ceae7..47086158 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -42,7 +42,7 @@  python() {
         d.setVar('ISAR_CROSS_COMPILE', '0')
 }
 
-inherit dpkg
+inherit dpkg per-kernel
 
 TEMPLATE_FILES = "debian/control.tmpl \
                   debian/rules.tmpl"