All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets
@ 2025-08-06 21:14 Petr Vorel
  2025-08-06 21:14 ` [LTP] [PATCH v3 2/2] modules.mk: Add FORCE_MODULES=1 to fail on error Petr Vorel
  2025-08-06 23:22 ` [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets Li Wang via ltp
  0 siblings, 2 replies; 8+ messages in thread
From: Petr Vorel @ 2025-08-06 21:14 UTC (permalink / raw)
  To: ltp; +Cc: Ricardo B . Marlière

LTP contains few kernel modules and tests which are using them.  These
require to be built with the same kernel headers as the running kernel
(SUT). Sometimes the best way to achieve this is to compile them on the
SUT.

Add 'modules', 'modules-clean' and 'modules-install' make targets to
make it easier to build them.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v2->v3:
* Automatic detection (Li), note: without 'sort -u' as there should be
  single Makefile in directory.

Link to v2:
https://patchwork.ozlabs.org/project/ltp/patch/20250801100935.974351-1-pvorel@suse.cz/
https://lore.kernel.org/ltp/20250801100935.974351-1-pvorel@suse.cz/

 INSTALL  | 10 ++++++++++
 Makefile | 21 +++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/INSTALL b/INSTALL
index cbe27f32ea..10c19d4105 100644
--- a/INSTALL
+++ b/INSTALL
@@ -165,6 +165,16 @@ PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig CFLAGS=-m32 LDFLAGS=-m32 ./c
 * Arch Linux
 PKG_CONFIG_LIBDIR=/usr/lib32/pkgconfig CFLAGS=-m32 LDFLAGS=-m32 ./configure
 
+Kernel modules
+--------------
+
+LTP contains few kernel modules and tests which are using them.
+These require to be built with the same kernel headers as the running kernel (SUT).
+Sometimes the best way to achieve this is to compile them on the SUT.
+
+'modules', 'modules-clean' and 'modules-install' make targets are shortcuts
+to build just these modules and tests.
+
 Android Users
 -------------
 
diff --git a/Makefile b/Makefile
index eab40da8a6..cdad8b10ce 100644
--- a/Makefile
+++ b/Makefile
@@ -212,6 +212,27 @@ endif
 test-metadata: metadata-all
 	$(MAKE) -C $(abs_srcdir)/metadata test
 
+MODULE_DIRS :=  $(shell \
+	dirname $$(grep -l 'include.*module\.mk' $$(find testcases/ -type f -name 'Makefile')))
+
+
+.PHONY: modules modules-clean modules-install
+modules:
+	@$(foreach dir,$(MODULE_DIRS),\
+		echo "Build $(dir)";\
+		$(MAKE) -C $(abs_srcdir)/$(dir); \
+)
+modules-clean:
+	@$(foreach dir,$(MODULE_DIRS),\
+		echo "Build $(dir)";\
+		$(MAKE) -C $(abs_srcdir)/$(dir) clean; \
+)
+modules-install: modules
+	@$(foreach dir,$(MODULE_DIRS),\
+		echo "Build $(dir)";\
+		$(MAKE) -C $(abs_srcdir)/$(dir) install; \
+)
+
 ## Help
 .PHONY: help
 help:
-- 
2.50.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] [PATCH v3 2/2] modules.mk: Add FORCE_MODULES=1 to fail on error
  2025-08-06 21:14 [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets Petr Vorel
@ 2025-08-06 21:14 ` Petr Vorel
  2025-08-07  3:37   ` Li Wang via ltp
  2025-08-06 23:22 ` [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets Li Wang via ltp
  1 sibling, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2025-08-06 21:14 UTC (permalink / raw)
  To: ltp; +Cc: Ricardo B . Marlière

Kernel modules deliberately not fail on error due kABI
(Linux Kernel Driver Interface) not being stable [1].

But that also silently hides modules not being build due change
(LTP module needs to be updated) or distro bug.

Introduce FORCE_MODULES=1 variable for make to force fail on error.
This can happen if
* package for building kernel modules is not installed
* LTP kernel module error mentioned above

$ make modules FORCE_MODULES=1
Build testcases/kernel/syscalls/finit_module
 Check that package for building kernel modules for 6.6.15-amd64 is installed and try again.
 * openSUSE/SLES: kernel-default-devel
 * Fedora/RHEL: kernel-devel/kernel-headers
 * Debian/Ubuntu: linux-kbuild
 You can build anyway by omitting FORCE_MODULES=1.  Stop.
...

NOTE: previously added 'modules' make target keeps trying to build all
modules (don't stop on first error).

[1] https://docs.kernel.org/process/stable-api-nonsense.html

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
New in v3

 INSTALL              |  6 ++++++
 include/mk/module.mk | 21 ++++++++++++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/INSTALL b/INSTALL
index 10c19d4105..7c25c23347 100644
--- a/INSTALL
+++ b/INSTALL
@@ -172,9 +172,15 @@ LTP contains few kernel modules and tests which are using them.
 These require to be built with the same kernel headers as the running kernel (SUT).
 Sometimes the best way to achieve this is to compile them on the SUT.
 
+Due Linux Kernel Driver Interface unstability [1], error during building kernel
+modules does not break the build. Make errors fatal can be done by FORCE_MODULES=1
+make variable.
+
 'modules', 'modules-clean' and 'modules-install' make targets are shortcuts
 to build just these modules and tests.
 
+[1] https://docs.kernel.org/process/stable-api-nonsense.html)
+
 Android Users
 -------------
 
diff --git a/include/mk/module.mk b/include/mk/module.mk
index c3cbf9c21f..65054ae502 100644
--- a/include/mk/module.mk
+++ b/include/mk/module.mk
@@ -1,14 +1,22 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 # Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
-# Copyright (c) Linux Test Project, 2014-2021
+# Copyright (c) Linux Test Project, 2014-2025
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Include it to build kernel modules.
 # REQ_VERSION_MAJOR and REQ_VERSION_PATCH must be defined beforehand.
+#
+# FORCE_MODULES=1: Forcing to fail on error or missing kernel headers (e.g. for CI)).
 
 $(if $(REQ_VERSION_MAJOR),,$(error You must define REQ_VERSION_MAJOR))
 $(if $(REQ_VERSION_PATCH),,$(error You must define REQ_VERSION_PATCH))
 
+define newline
+
+
+endef
+n := $(newline)
+
 ifeq ($(WITH_MODULES),no)
 SKIP := 1
 else
@@ -24,6 +32,15 @@ endif
 
 ifneq ($(SKIP),0)
 MAKE_TARGETS := $(filter-out %.ko, $(MAKE_TARGETS))
+ifeq ($(FORCE_MODULES),1)
+$(error Kernel modules not built!$(n)\
+Check that package for building kernel modules for $(LINUX_VERSION)\
+is installed and try again.$(n)\
+* openSUSE/SLES: kernel-default-devel$(n)\
+* Fedora/RHEL: kernel-devel/kernel-headers$(n)\
+* Debian/Ubuntu: linux-kbuild$(n)\
+You can build anyway by omitting FORCE_MODULES=1)
+endif
 endif
 
 ifneq ($(filter install clean,$(MAKECMDGOALS)),)
@@ -41,7 +58,9 @@ MODULE_SOURCES := $(patsubst %.ko,%.c,$(filter %.ko, $(MAKE_TARGETS)))
 # kernel internal API changes. The user-space test will return TCONF, if it
 # doesn't find the module (i.e. it wasn't built either due to kernel-devel
 # missing or module build failure).
+ifneq ($(FORCE_MODULES),1)
 %.ko: %.c .dep_modules ;
+endif
 
 .dep_modules: $(MODULE_SOURCES)
 	@echo "Building modules: $(MODULE_SOURCES)"
-- 
2.50.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets
  2025-08-06 21:14 [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets Petr Vorel
  2025-08-06 21:14 ` [LTP] [PATCH v3 2/2] modules.mk: Add FORCE_MODULES=1 to fail on error Petr Vorel
@ 2025-08-06 23:22 ` Li Wang via ltp
  2025-08-07  2:15   ` Li Wang via ltp
  1 sibling, 1 reply; 8+ messages in thread
From: Li Wang via ltp @ 2025-08-06 23:22 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Ricardo B . Marlière, ltp

Hi Petr,

On Thu, Aug 7, 2025 at 5:14 AM Petr Vorel <pvorel@suse.cz> wrote:

> LTP contains few kernel modules and tests which are using them.  These
> require to be built with the same kernel headers as the running kernel
> (SUT). Sometimes the best way to achieve this is to compile them on the
> SUT.
>
> Add 'modules', 'modules-clean' and 'modules-install' make targets to
> make it easier to build them.
>

Maybe better to keep the make target consistent with the kernel build
command:
  make modules_install
  make modules_clean



>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
>

Reviewed-by: Li Wang <liwang@redhat.com>


> ---
> Changes v2->v3:
> * Automatic detection (Li), note: without 'sort -u' as there should be
>   single Makefile in directory.
>
> Link to v2:
>
> https://patchwork.ozlabs.org/project/ltp/patch/20250801100935.974351-1-pvorel@suse.cz/
> https://lore.kernel.org/ltp/20250801100935.974351-1-pvorel@suse.cz/
>
>  INSTALL  | 10 ++++++++++
>  Makefile | 21 +++++++++++++++++++++
>  2 files changed, 31 insertions(+)
>
> diff --git a/INSTALL b/INSTALL
> index cbe27f32ea..10c19d4105 100644
> --- a/INSTALL
> +++ b/INSTALL
> @@ -165,6 +165,16 @@ PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig
> CFLAGS=-m32 LDFLAGS=-m32 ./c
>  * Arch Linux
>  PKG_CONFIG_LIBDIR=/usr/lib32/pkgconfig CFLAGS=-m32 LDFLAGS=-m32
> ./configure
>
> +Kernel modules
> +--------------
> +
> +LTP contains few kernel modules and tests which are using them.
> +These require to be built with the same kernel headers as the running
> kernel (SUT).
> +Sometimes the best way to achieve this is to compile them on the SUT.
> +
> +'modules', 'modules-clean' and 'modules-install' make targets are
> shortcuts
> +to build just these modules and tests.
> +
>  Android Users
>  -------------
>
> diff --git a/Makefile b/Makefile
> index eab40da8a6..cdad8b10ce 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -212,6 +212,27 @@ endif
>  test-metadata: metadata-all
>         $(MAKE) -C $(abs_srcdir)/metadata test
>
> +MODULE_DIRS :=  $(shell \
> +       dirname $$(grep -l 'include.*module\.mk' $$(find testcases/ -type
> f -name 'Makefile')))
> +
> +
> +.PHONY: modules modules-clean modules-install
> +modules:
> +       @$(foreach dir,$(MODULE_DIRS),\
> +               echo "Build $(dir)";\
> +               $(MAKE) -C $(abs_srcdir)/$(dir); \
> +)
> +modules-clean:
> +       @$(foreach dir,$(MODULE_DIRS),\
> +               echo "Build $(dir)";\
> +               $(MAKE) -C $(abs_srcdir)/$(dir) clean; \
> +)
> +modules-install: modules
> +       @$(foreach dir,$(MODULE_DIRS),\
> +               echo "Build $(dir)";\
> +               $(MAKE) -C $(abs_srcdir)/$(dir) install; \
> +)
> +
>  ## Help
>  .PHONY: help
>  help:
> --
> 2.50.1
>
>

-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets
  2025-08-06 23:22 ` [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets Li Wang via ltp
@ 2025-08-07  2:15   ` Li Wang via ltp
  2025-08-07  5:11     ` Petr Vorel
  0 siblings, 1 reply; 8+ messages in thread
From: Li Wang via ltp @ 2025-08-07  2:15 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Ricardo B . Marlière, ltp

On Thu, Aug 7, 2025 at 7:22 AM Li Wang <liwang@redhat.com> wrote:

> Hi Petr,
>
> On Thu, Aug 7, 2025 at 5:14 AM Petr Vorel <pvorel@suse.cz> wrote:
>
>> LTP contains few kernel modules and tests which are using them.  These
>> require to be built with the same kernel headers as the running kernel
>> (SUT). Sometimes the best way to achieve this is to compile them on the
>> SUT.
>>
>> Add 'modules', 'modules-clean' and 'modules-install' make targets to
>> make it easier to build them.
>>
>
> Maybe better to keep the make target consistent with the kernel build
> command:
>   make modules_install
>   make modules_clean
>

Also, it looks like LTP mixes using "-" and "_" in its make targets:

  lib-all, metadata-all, clean_install_dir, ver_linux

So we may need to use just one selection, which can be done in a separate
patch anyway.


-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v3 2/2] modules.mk: Add FORCE_MODULES=1 to fail on error
  2025-08-06 21:14 ` [LTP] [PATCH v3 2/2] modules.mk: Add FORCE_MODULES=1 to fail on error Petr Vorel
@ 2025-08-07  3:37   ` Li Wang via ltp
  2025-08-07  6:17     ` Petr Vorel
  0 siblings, 1 reply; 8+ messages in thread
From: Li Wang via ltp @ 2025-08-07  3:37 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Ricardo B . Marlière, ltp

On Thu, Aug 7, 2025 at 5:14 AM Petr Vorel <pvorel@suse.cz> wrote:

> Kernel modules deliberately not fail on error due kABI
> (Linux Kernel Driver Interface) not being stable [1].
>
> But that also silently hides modules not being build due change
> (LTP module needs to be updated) or distro bug.
>
> Introduce FORCE_MODULES=1 variable for make to force fail on error.
> This can happen if
> * package for building kernel modules is not installed
> * LTP kernel module error mentioned above
>
> $ make modules FORCE_MODULES=1
> Build testcases/kernel/syscalls/finit_module
>  Check that package for building kernel modules for 6.6.15-amd64 is
> installed and try again.
>  * openSUSE/SLES: kernel-default-devel
>  * Fedora/RHEL: kernel-devel/kernel-headers
>  * Debian/Ubuntu: linux-kbuild
>  You can build anyway by omitting FORCE_MODULES=1.  Stop.
> ...
>
> NOTE: previously added 'modules' make target keeps trying to build all
> modules (don't stop on first error).
>
> [1] https://docs.kernel.org/process/stable-api-nonsense.html
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> New in v3
>
>  INSTALL              |  6 ++++++
>  include/mk/module.mk | 21 ++++++++++++++++++++-
>  2 files changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/INSTALL b/INSTALL
> index 10c19d4105..7c25c23347 100644
> --- a/INSTALL
> +++ b/INSTALL
> @@ -172,9 +172,15 @@ LTP contains few kernel modules and tests which are
> using them.
>  These require to be built with the same kernel headers as the running
> kernel (SUT).
>  Sometimes the best way to achieve this is to compile them on the SUT.
>
> +Due Linux Kernel Driver Interface unstability [1], error during building
> kernel
> +modules does not break the build. Make errors fatal can be done by
> FORCE_MODULES=1
> +make variable.
> +
>  'modules', 'modules-clean' and 'modules-install' make targets are
> shortcuts
>  to build just these modules and tests.
>
> +[1] https://docs.kernel.org/process/stable-api-nonsense.html)
> +
>  Android Users
>  -------------
>
> diff --git a/include/mk/module.mk b/include/mk/module.mk
> index c3cbf9c21f..65054ae502 100644
> --- a/include/mk/module.mk
> +++ b/include/mk/module.mk
> @@ -1,14 +1,22 @@
>  # SPDX-License-Identifier: GPL-2.0-or-later
>  # Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
> -# Copyright (c) Linux Test Project, 2014-2021
> +# Copyright (c) Linux Test Project, 2014-2025
>  # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
>  #
>  # Include it to build kernel modules.
>  # REQ_VERSION_MAJOR and REQ_VERSION_PATCH must be defined beforehand.
> +#
> +# FORCE_MODULES=1: Forcing to fail on error or missing kernel headers
> (e.g. for CI)).
>
>  $(if $(REQ_VERSION_MAJOR),,$(error You must define REQ_VERSION_MAJOR))
>  $(if $(REQ_VERSION_PATCH),,$(error You must define REQ_VERSION_PATCH))
>
> +define newline
> +
> +
> +endef
> +n := $(newline)
> +
>  ifeq ($(WITH_MODULES),no)
>  SKIP := 1
>  else
> @@ -24,6 +32,15 @@ endif
>
>  ifneq ($(SKIP),0)
>  MAKE_TARGETS := $(filter-out %.ko, $(MAKE_TARGETS))
> +ifeq ($(FORCE_MODULES),1)
> +$(error Kernel modules not built!$(n)\
> +Check that package for building kernel modules for $(LINUX_VERSION)\
> +is installed and try again.$(n)\
> +* openSUSE/SLES: kernel-default-devel$(n)\
> +* Fedora/RHEL: kernel-devel/kernel-headers$(n)\
> +* Debian/Ubuntu: linux-kbuild$(n)\
> +You can build anyway by omitting FORCE_MODULES=1)
> +endif
>  endif
>
>  ifneq ($(filter install clean,$(MAKECMDGOALS)),)
> @@ -41,7 +58,9 @@ MODULE_SOURCES := $(patsubst %.ko,%.c,$(filter %.ko,
> $(MAKE_TARGETS)))
>  # kernel internal API changes. The user-space test will return TCONF, if
> it
>  # doesn't find the module (i.e. it wasn't built either due to kernel-devel
>  # missing or module build failure).
> +ifneq ($(FORCE_MODULES),1)
>  %.ko: %.c .dep_modules ;
> +endif
>

Unfortunately, this wouldn't work as expected, the module's build process
only skipped silently with `make modules FORCE_MODULES=1`.


>  .dep_modules: $(MODULE_SOURCES)
>         @echo "Building modules: $(MODULE_SOURCES)"
> --
> 2.50.1
>
>

-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets
  2025-08-07  2:15   ` Li Wang via ltp
@ 2025-08-07  5:11     ` Petr Vorel
  2025-08-07  7:56       ` Li Wang via ltp
  0 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2025-08-07  5:11 UTC (permalink / raw)
  To: Li Wang; +Cc: Ricardo B . Marlière, ltp

Hi Li, all,

> On Thu, Aug 7, 2025 at 7:22 AM Li Wang <liwang@redhat.com> wrote:

> > Hi Petr,

> > On Thu, Aug 7, 2025 at 5:14 AM Petr Vorel <pvorel@suse.cz> wrote:

> >> LTP contains few kernel modules and tests which are using them.  These
> >> require to be built with the same kernel headers as the running kernel
> >> (SUT). Sometimes the best way to achieve this is to compile them on the
> >> SUT.

> >> Add 'modules', 'modules-clean' and 'modules-install' make targets to
> >> make it easier to build them.


> > Maybe better to keep the make target consistent with the kernel build
> > command:
> >   make modules_install
> >   make modules_clean

> Also, it looks like LTP mixes using "-" and "_" in its make targets:

>   lib-all, metadata-all, clean_install_dir, ver_linux

I chose '-' because that's what uses LTP for make targets.
ver_linux uses underscore because target inherits it from the name of the file.

clean_install_dir is the only target which uses '_', I'm not sure why this
inconsistency.

> So we may need to use just one selection, which can be done in a separate
> patch anyway.

I got the point that kernel uses '_'. Do we want to unify after years using '-'?
I'm ok to do the work if we consider it's useful.

I personally consider more important from the long term to change build system
to meson (de facto standard for the userspace projects, including these related
to kernel).

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v3 2/2] modules.mk: Add FORCE_MODULES=1 to fail on error
  2025-08-07  3:37   ` Li Wang via ltp
@ 2025-08-07  6:17     ` Petr Vorel
  0 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2025-08-07  6:17 UTC (permalink / raw)
  To: Li Wang; +Cc: Ricardo B . Marlière, ltp

Hi Li,

> >  # doesn't find the module (i.e. it wasn't built either due to kernel-devel
> >  # missing or module build failure).
> > +ifneq ($(FORCE_MODULES),1)
> >  %.ko: %.c .dep_modules ;
> > +endif

> Unfortunately, this wouldn't work as expected, the module's build process
> only skipped silently with `make modules FORCE_MODULES=1`.

Good catch, thank you. It's because '-' in
-$(MAKE) -C $(LINUX_DIR) M=$(abs_srcdir)
must be changed to get make fail.

It should be fixed by patch below, I'll send v4 shortly.
In the mean time you can use make-modules.v4 in my fork:
https://github.com/pevik/ltp/tree/refs/heads/make-modules.v4

Kind regards,
Petr

diff --git include/mk/module.mk include/mk/module.mk
index 65054ae502..3e97f01289 100644
--- include/mk/module.mk
+++ include/mk/module.mk
@@ -30,6 +30,7 @@ SKIP ?= $(shell \
 endif
 endif
 
+$(info skip: $(SKIP), FORCE_MODULES: $(FORCE_MODULES))
 ifneq ($(SKIP),0)
 MAKE_TARGETS := $(filter-out %.ko, $(MAKE_TARGETS))
 ifeq ($(FORCE_MODULES),1)
@@ -58,12 +59,14 @@ MODULE_SOURCES := $(patsubst %.ko,%.c,$(filter %.ko, $(MAKE_TARGETS)))
 # kernel internal API changes. The user-space test will return TCONF, if it
 # doesn't find the module (i.e. it wasn't built either due to kernel-devel
 # missing or module build failure).
-ifneq ($(FORCE_MODULES),1)
 %.ko: %.c .dep_modules ;
-endif
 
 .dep_modules: $(MODULE_SOURCES)
 	@echo "Building modules: $(MODULE_SOURCES)"
+ifneq ($(FORCE_MODULES),1)
 	-$(MAKE) -C $(LINUX_DIR) M=$(abs_srcdir)
+else
+	$(MAKE) -C $(LINUX_DIR) M=$(abs_srcdir)
+endif
 	rm -rf *.mod.c *.o *.ko.unsigned modules.order .tmp* .*.ko .*.cmd Module.symvers
 	@touch .dep_modules

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets
  2025-08-07  5:11     ` Petr Vorel
@ 2025-08-07  7:56       ` Li Wang via ltp
  0 siblings, 0 replies; 8+ messages in thread
From: Li Wang via ltp @ 2025-08-07  7:56 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Ricardo B . Marlière, ltp

On Thu, Aug 7, 2025 at 1:11 PM Petr Vorel <pvorel@suse.cz> wrote:

> Hi Li, all,
>
> > On Thu, Aug 7, 2025 at 7:22 AM Li Wang <liwang@redhat.com> wrote:
>
> > > Hi Petr,
>
> > > On Thu, Aug 7, 2025 at 5:14 AM Petr Vorel <pvorel@suse.cz> wrote:
>
> > >> LTP contains few kernel modules and tests which are using them.  These
> > >> require to be built with the same kernel headers as the running kernel
> > >> (SUT). Sometimes the best way to achieve this is to compile them on
> the
> > >> SUT.
>
> > >> Add 'modules', 'modules-clean' and 'modules-install' make targets to
> > >> make it easier to build them.
>
>
> > > Maybe better to keep the make target consistent with the kernel build
> > > command:
> > >   make modules_install
> > >   make modules_clean
>
> > Also, it looks like LTP mixes using "-" and "_" in its make targets:
>
> >   lib-all, metadata-all, clean_install_dir, ver_linux
>
> I chose '-' because that's what uses LTP for make targets.
> ver_linux uses underscore because target inherits it from the name of the
> file.
>
> clean_install_dir is the only target which uses '_', I'm not sure why this
> inconsistency.
>
> > So we may need to use just one selection, which can be done in a separate
> > patch anyway.
>
> I got the point that kernel uses '_'. Do we want to unify after years
> using '-'?
> I'm ok to do the work if we consider it's useful.
>

No, I have no preference right now, the reason I've discovered is because my
fingers are used to typing "make modules_install" as a muscle memory.


I personally consider more important from the long term to change build
> system
> to meson (de facto standard for the userspace projects, including these
> related
> to kernel).
>

LTP keeps going use hyphens ('-') in make-targets should be fine. Here we
only need that unified but not mixed with underscores ('_').


-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2025-08-07  7:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06 21:14 [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets Petr Vorel
2025-08-06 21:14 ` [LTP] [PATCH v3 2/2] modules.mk: Add FORCE_MODULES=1 to fail on error Petr Vorel
2025-08-07  3:37   ` Li Wang via ltp
2025-08-07  6:17     ` Petr Vorel
2025-08-06 23:22 ` [LTP] [PATCH v3 1/2] Makefile: Add kernel modules related make targets Li Wang via ltp
2025-08-07  2:15   ` Li Wang via ltp
2025-08-07  5:11     ` Petr Vorel
2025-08-07  7:56       ` Li Wang via ltp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.