[PATCH 2/2] linux-module: call the install target of external modules

14 views
Skip to first unread message

Henning Schild

unread,
Aug 26, 2022, 1:51:39 PM8/26/22
to isar-...@googlegroups.com, 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...@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

Henning Schild

unread,
Aug 26, 2022, 1:51:39 PM8/26/22
to isar-...@googlegroups.com, 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...@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

Henning Schild

unread,
Aug 26, 2022, 1:53:51 PM8/26/22
to isar-...@googlegroups.com, 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...@siemens.com>:

Henning Schild

unread,
Aug 26, 2022, 2:52:43 PM8/26/22
to isar-...@googlegroups.com, 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...@siemens.com>:

Henning Schild

unread,
Aug 27, 2022, 4:57:00 AM8/27/22
to isar-...@googlegroups.com, Pingfang Liao, Florian Bezdeka
Am Fri, 26 Aug 2022 20:52:36 +0200
schrieb Henning Schild <henning...@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
Reply all
Reply to author
Forward
0 new messages