public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 1/2] linux-module: honor modules Makefile
@ 2022-08-26 17:51 Henning Schild
  2022-08-26 17:51 ` [PATCH 2/2] linux-module: call the install target of external modules Henning Schild
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Henning Schild @ 2022-08-26 17:51 UTC (permalink / raw)
  To: isar-users; +Cc: Pingfang Liao, Florian Bezdeka, Henning Schild

External modules might have their own appends and target definitions in
their Makefile. All we need to give them is the target name and KDIR,
not dive into KDIR right away.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/recipes-kernel/linux-module/files/debian/rules.tmpl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
index d3bd7dc30f21..0d16186b5ff3 100755
--- a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
+++ b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
@@ -48,13 +48,13 @@ KDIR := $(shell dpkg -L $(KERNEL_DEP) | grep "/lib/modules/.*/build")
 endif
 
 override_dh_auto_clean:
-	$(MAKE) -C $(KDIR) M=$(PWD) clean
+	$(MAKE) KDIR=$(KDIR) clean
 
 override_dh_auto_build:
-	$(MAKE) -C $(KDIR) M=$(PWD) modules
+	$(MAKE) KDIR=$(KDIR) modules
 
 override_dh_auto_install:
-	$(MAKE) -C $(KDIR) M=$(PWD) INSTALL_MOD_PATH=$(PWD)/debian/${PN} modules_install
+	$(MAKE) KDIR=$(KDIR) INSTALL_MOD_PATH=$(PWD)/debian/${PN} modules_install
 
 %:
 	CFLAGS= LDFLAGS= dh $@ --parallel
-- 
2.35.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] linux-module: call the install target of external modules
  2022-08-26 17:51 [PATCH 1/2] linux-module: honor modules Makefile Henning Schild
@ 2022-08-26 17:51 ` Henning Schild
  2022-08-26 17:53 ` [PATCH 1/2] linux-module: honor modules Makefile Henning Schild
  2022-08-26 18:52 ` Henning Schild
  2 siblings, 0 replies; 5+ messages in thread
From: Henning Schild @ 2022-08-26 17:51 UTC (permalink / raw)
  To: isar-users; +Cc: Pingfang Liao, Florian Bezdeka, Henning Schild

An "install" target would allow out-of-tree modules to deploy additional
files. Like depmod.d ordering files, udev rules or modprobe.d files
which they might require.

The default "install" target just does nothing or maybe
"modules_install" again, so there should be no harm. While the kernel
documentation for external modules does not mention the "install" target
some might have it to install things on top of "modules_install".

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/recipes-kernel/linux-module/files/debian/rules.tmpl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
index 0d16186b5ff3..cb62dc99f1cf 100755
--- a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
+++ b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
@@ -55,6 +55,7 @@ override_dh_auto_build:
 
 override_dh_auto_install:
 	$(MAKE) KDIR=$(KDIR) INSTALL_MOD_PATH=$(PWD)/debian/${PN} modules_install
+	$(MAKE) KDIR=$(KDIR) INSTALL_MOD_PATH=$(PWD)/debian/${PN} install
 
 %:
 	CFLAGS= LDFLAGS= dh $@ --parallel
-- 
2.35.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] linux-module: honor modules Makefile
  2022-08-26 17:51 [PATCH 1/2] linux-module: honor modules Makefile Henning Schild
  2022-08-26 17:51 ` [PATCH 2/2] linux-module: call the install target of external modules Henning Schild
@ 2022-08-26 17:53 ` Henning Schild
  2022-08-26 18:52 ` Henning Schild
  2 siblings, 0 replies; 5+ messages in thread
From: Henning Schild @ 2022-08-26 17:53 UTC (permalink / raw)
  To: isar-users; +Cc: Pingfang Liao, Florian Bezdeka

After a discussion on
"[PATCH] linux-module: make sure out-of-tree modules win over built-in"
this is now another attempt to fix the issue of module order.

This time we improve Isar to honor the Makefile of such a module, so it
can itself deploy additional files if it wants.

In a second patch we even call the "install" target so such a module
could decide to install additional files in "install" and not in
"modules_install"

Henning

Am Fri, 26 Aug 2022 19:51:21 +0200
schrieb Henning Schild <henning.schild@siemens.com>:

> External modules might have their own appends and target definitions
> in their Makefile. All we need to give them is the target name and
> KDIR, not dive into KDIR right away.
> 
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>  meta/recipes-kernel/linux-module/files/debian/rules.tmpl | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
> b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl index
> d3bd7dc30f21..0d16186b5ff3 100755 ---
> a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl +++
> b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl @@ -48,13
> +48,13 @@ KDIR := $(shell dpkg -L $(KERNEL_DEP) | grep
> "/lib/modules/.*/build") endif 
>  override_dh_auto_clean:
> -	$(MAKE) -C $(KDIR) M=$(PWD) clean
> +	$(MAKE) KDIR=$(KDIR) clean
>  
>  override_dh_auto_build:
> -	$(MAKE) -C $(KDIR) M=$(PWD) modules
> +	$(MAKE) KDIR=$(KDIR) modules
>  
>  override_dh_auto_install:
> -	$(MAKE) -C $(KDIR) M=$(PWD)
> INSTALL_MOD_PATH=$(PWD)/debian/${PN} modules_install
> +	$(MAKE) KDIR=$(KDIR) INSTALL_MOD_PATH=$(PWD)/debian/${PN}
> modules_install 
>  %:
>  	CFLAGS= LDFLAGS= dh $@ --parallel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] linux-module: honor modules Makefile
  2022-08-26 17:51 [PATCH 1/2] linux-module: honor modules Makefile Henning Schild
  2022-08-26 17:51 ` [PATCH 2/2] linux-module: call the install target of external modules Henning Schild
  2022-08-26 17:53 ` [PATCH 1/2] linux-module: honor modules Makefile Henning Schild
@ 2022-08-26 18:52 ` Henning Schild
  2022-08-27  8:56   ` Henning Schild
  2 siblings, 1 reply; 5+ messages in thread
From: Henning Schild @ 2022-08-26 18:52 UTC (permalink / raw)
  To: isar-users; +Cc: Pingfang Liao, Florian Bezdeka

I just gave this one to CI to digest. My guess is that it will fail to
build meta-isar/recipes-kernel/example-module because its Makefile is
really just too simplistic.

So that file might need to be updated to become more realistic.

Henning

Am Fri, 26 Aug 2022 19:51:21 +0200
schrieb Henning Schild <henning.schild@siemens.com>:

> External modules might have their own appends and target definitions
> in their Makefile. All we need to give them is the target name and
> KDIR, not dive into KDIR right away.
> 
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>  meta/recipes-kernel/linux-module/files/debian/rules.tmpl | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
> b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl index
> d3bd7dc30f21..0d16186b5ff3 100755 ---
> a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl +++
> b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl @@ -48,13
> +48,13 @@ KDIR := $(shell dpkg -L $(KERNEL_DEP) | grep
> "/lib/modules/.*/build") endif 
>  override_dh_auto_clean:
> -	$(MAKE) -C $(KDIR) M=$(PWD) clean
> +	$(MAKE) KDIR=$(KDIR) clean
>  
>  override_dh_auto_build:
> -	$(MAKE) -C $(KDIR) M=$(PWD) modules
> +	$(MAKE) KDIR=$(KDIR) modules
>  
>  override_dh_auto_install:
> -	$(MAKE) -C $(KDIR) M=$(PWD)
> INSTALL_MOD_PATH=$(PWD)/debian/${PN} modules_install
> +	$(MAKE) KDIR=$(KDIR) INSTALL_MOD_PATH=$(PWD)/debian/${PN}
> modules_install 
>  %:
>  	CFLAGS= LDFLAGS= dh $@ --parallel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] linux-module: honor modules Makefile
  2022-08-26 18:52 ` Henning Schild
@ 2022-08-27  8:56   ` Henning Schild
  0 siblings, 0 replies; 5+ messages in thread
From: Henning Schild @ 2022-08-27  8:56 UTC (permalink / raw)
  To: isar-users; +Cc: Pingfang Liao, Florian Bezdeka

Am Fri, 26 Aug 2022 20:52:36 +0200
schrieb Henning Schild <henning.schild@siemens.com>:

> I just gave this one to CI to digest. My guess is that it will fail to
> build meta-isar/recipes-kernel/example-module because its Makefile is
> really just too simplistic.

Indeed

/usr/bin/make KDIR=/lib/modules/5.10.0-17-amd64/build clean

make[2]: Entering directory '/<<PKGBUILDDIR>>'

make[2]: *** No rule to make target 'clean'.  Stop.
make[2]: Leaving directory '/<<PKGBUILDDIR>>'
make[1]: *** [debian/rules:51: override_dh_auto_clean] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>'

make: *** [debian/rules:61: clean] Error 2

In the end i ran things manually. CI at Ilbers did not finish over
night, not even one of two pipelines. And CI at Siemens has sstate
issues. We should _really_ have only one that is public and powerful.

> So that file might need to be updated to become more realistic.

Will send a v2 with a patch to fix that Makefile of example-module.

Henning

> Henning
> 
> Am Fri, 26 Aug 2022 19:51:21 +0200
> schrieb Henning Schild <henning.schild@siemens.com>:
> 
> > External modules might have their own appends and target definitions
> > in their Makefile. All we need to give them is the target name and
> > KDIR, not dive into KDIR right away.
> > 
> > Signed-off-by: Henning Schild <henning.schild@siemens.com>
> > ---
> >  meta/recipes-kernel/linux-module/files/debian/rules.tmpl | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git
> > a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
> > b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl index
> > d3bd7dc30f21..0d16186b5ff3 100755 ---
> > a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl +++
> > b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl @@
> > -48,13 +48,13 @@ KDIR := $(shell dpkg -L $(KERNEL_DEP) | grep
> > "/lib/modules/.*/build") endif override_dh_auto_clean:
> > -	$(MAKE) -C $(KDIR) M=$(PWD) clean
> > +	$(MAKE) KDIR=$(KDIR) clean
> >  
> >  override_dh_auto_build:
> > -	$(MAKE) -C $(KDIR) M=$(PWD) modules
> > +	$(MAKE) KDIR=$(KDIR) modules
> >  
> >  override_dh_auto_install:
> > -	$(MAKE) -C $(KDIR) M=$(PWD)
> > INSTALL_MOD_PATH=$(PWD)/debian/${PN} modules_install
> > +	$(MAKE) KDIR=$(KDIR) INSTALL_MOD_PATH=$(PWD)/debian/${PN}
> > modules_install 
> >  %:
> >  	CFLAGS= LDFLAGS= dh $@ --parallel  
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-27  8:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26 17:51 [PATCH 1/2] linux-module: honor modules Makefile Henning Schild
2022-08-26 17:51 ` [PATCH 2/2] linux-module: call the install target of external modules Henning Schild
2022-08-26 17:53 ` [PATCH 1/2] linux-module: honor modules Makefile Henning Schild
2022-08-26 18:52 ` Henning Schild
2022-08-27  8:56   ` Henning Schild

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox