Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: "Ricardo B . Marlière" <rbm@suse.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 2/2] modules.mk: Add FORCE_MODULES=1 to fail on error
Date: Thu, 7 Aug 2025 08:17:06 +0200	[thread overview]
Message-ID: <20250807061706.GB331644@pevik> (raw)
In-Reply-To: <CAEemH2cG1+_UD02Hp5oSNXkhirNjn6drH=eL-4X55ZOqi8P8BA@mail.gmail.com>

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

  reply	other threads:[~2025-08-07  6:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250807061706.GB331644@pevik \
    --to=pvorel@suse.cz \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    --cc=rbm@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox