* [PATCH] kbuild: Modify default INSTALL_MOD_DIR from extra to updates
@ 2022-12-14 23:17 Luis Chamberlain
2022-12-14 23:27 ` Dan Williams
2022-12-16 4:08 ` Nicolas Schier
0 siblings, 2 replies; 5+ messages in thread
From: Luis Chamberlain @ 2022-12-14 23:17 UTC (permalink / raw)
To: masahiroy, nathan, ndesaulniers, nicolas, linux-kbuild,
alison.schofield, dan.j.williams
Cc: dave, a.manzanares, mcgrof, lucas.de.marchi, linux-cxl,
linux-modules, linux-kernel
The default INSTALL_MOD_DIR of using the /lib/modules/$(uname -r)/extra
directory for external modules assumes distributions will have something
like /etc/depmod.d/dist.conf with:
search updates extra built-in
However, only some Red Hat release have and use the extra stuff for
years now. Meanwhile, the depmod.c tool in kmod has *forever* used
the "updates" directory as part of the search path by default *if*
your distribution does not have any depmod.d configuration.
If you compile and install an external module today, even upstream
kernel mock drivers (tools/testing/cxl) the modules_install target
will pick up the new drivers but will not allow override of drivers
from updates to override built-in ones.
Since module-init-tools was deprecated over 11 years ago and now kmod
has since its inception used the "updates" directory as part of its
default search path to allow overrides, and since the "extra" stuff
was in practice only used by Red Hat stuff, use the more distro
agnostic override path "updates" to allow external modules to
also override proper production kernel modules.
This would allow mocking drivers tools to not have to muck with
depmod.d config files or assume that your distro will have extra
on a configuration file over built-in.
With today's default you end up actually *crashing* Linux when
trying to load cxl_test with the default "extra" [0] directory being
used. This fixes that and allows other mocking drivers to do
less work.
[0] https://lkml.kernel.org/r/20221209062919.1096779-1-mcgrof@kernel.org
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
scripts/Makefile.modinst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index 509d424dbbd2..c12ae5c108d4 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -14,7 +14,7 @@ modules := $(sort $(call read-file, $(MODORDER)))
ifeq ($(KBUILD_EXTMOD),)
dst := $(MODLIB)/kernel
else
-INSTALL_MOD_DIR ?= extra
+INSTALL_MOD_DIR ?= updates
dst := $(MODLIB)/$(INSTALL_MOD_DIR)
endif
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH] kbuild: Modify default INSTALL_MOD_DIR from extra to updates
2022-12-14 23:17 [PATCH] kbuild: Modify default INSTALL_MOD_DIR from extra to updates Luis Chamberlain
@ 2022-12-14 23:27 ` Dan Williams
2022-12-16 4:08 ` Nicolas Schier
1 sibling, 0 replies; 5+ messages in thread
From: Dan Williams @ 2022-12-14 23:27 UTC (permalink / raw)
To: Luis Chamberlain, masahiroy, nathan, ndesaulniers, nicolas,
linux-kbuild, alison.schofield, dan.j.williams
Cc: dave, a.manzanares, mcgrof, lucas.de.marchi, linux-cxl,
linux-modules, linux-kernel
Luis Chamberlain wrote:
> The default INSTALL_MOD_DIR of using the /lib/modules/$(uname -r)/extra
> directory for external modules assumes distributions will have something
> like /etc/depmod.d/dist.conf with:
>
> search updates extra built-in
>
> However, only some Red Hat release have and use the extra stuff for
> years now. Meanwhile, the depmod.c tool in kmod has *forever* used
> the "updates" directory as part of the search path by default *if*
> your distribution does not have any depmod.d configuration.
>
> If you compile and install an external module today, even upstream
> kernel mock drivers (tools/testing/cxl) the modules_install target
> will pick up the new drivers but will not allow override of drivers
> from updates to override built-in ones.
>
> Since module-init-tools was deprecated over 11 years ago and now kmod
> has since its inception used the "updates" directory as part of its
> default search path to allow overrides, and since the "extra" stuff
> was in practice only used by Red Hat stuff, use the more distro
> agnostic override path "updates" to allow external modules to
> also override proper production kernel modules.
>
> This would allow mocking drivers tools to not have to muck with
> depmod.d config files or assume that your distro will have extra
> on a configuration file over built-in.
>
> With today's default you end up actually *crashing* Linux when
> trying to load cxl_test with the default "extra" [0] directory being
> used. This fixes that and allows other mocking drivers to do
> less work.
>
> [0] https://lkml.kernel.org/r/20221209062919.1096779-1-mcgrof@kernel.org
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Thanks for digging into the history here Luis!
Acked-by: Dan Williams <dan.j.williams@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: Modify default INSTALL_MOD_DIR from extra to updates
2022-12-14 23:17 [PATCH] kbuild: Modify default INSTALL_MOD_DIR from extra to updates Luis Chamberlain
2022-12-14 23:27 ` Dan Williams
@ 2022-12-16 4:08 ` Nicolas Schier
2023-01-04 19:25 ` Luis Chamberlain
1 sibling, 1 reply; 5+ messages in thread
From: Nicolas Schier @ 2022-12-16 4:08 UTC (permalink / raw)
To: Luis Chamberlain
Cc: masahiroy, nathan, ndesaulniers, linux-kbuild, alison.schofield,
dan.j.williams, dave, a.manzanares, lucas.de.marchi, linux-cxl,
linux-modules, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1909 bytes --]
On Wed 14 Dec 2022 15:17:18 GMT, Luis Chamberlain wrote:
> The default INSTALL_MOD_DIR of using the /lib/modules/$(uname -r)/extra
> directory for external modules assumes distributions will have something
> like /etc/depmod.d/dist.conf with:
>
> search updates extra built-in
>
> However, only some Red Hat release have and use the extra stuff for
> years now. Meanwhile, the depmod.c tool in kmod has *forever* used
> the "updates" directory as part of the search path by default *if*
> your distribution does not have any depmod.d configuration.
>
> If you compile and install an external module today, even upstream
> kernel mock drivers (tools/testing/cxl) the modules_install target
> will pick up the new drivers but will not allow override of drivers
> from updates to override built-in ones.
>
> Since module-init-tools was deprecated over 11 years ago and now kmod
> has since its inception used the "updates" directory as part of its
> default search path to allow overrides, and since the "extra" stuff
> was in practice only used by Red Hat stuff, use the more distro
> agnostic override path "updates" to allow external modules to
> also override proper production kernel modules.
>
> This would allow mocking drivers tools to not have to muck with
> depmod.d config files or assume that your distro will have extra
> on a configuration file over built-in.
>
> With today's default you end up actually *crashing* Linux when
> trying to load cxl_test with the default "extra" [0] directory being
> used. This fixes that and allows other mocking drivers to do
> less work.
>
> [0] https://lkml.kernel.org/r/20221209062919.1096779-1-mcgrof@kernel.org
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
> scripts/Makefile.modinst | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: Modify default INSTALL_MOD_DIR from extra to updates
2022-12-16 4:08 ` Nicolas Schier
@ 2023-01-04 19:25 ` Luis Chamberlain
2023-01-05 2:11 ` Masahiro Yamada
0 siblings, 1 reply; 5+ messages in thread
From: Luis Chamberlain @ 2023-01-04 19:25 UTC (permalink / raw)
To: Nicolas Schier
Cc: masahiroy, nathan, ndesaulniers, linux-kbuild, alison.schofield,
dan.j.williams, dave, a.manzanares, lucas.de.marchi, linux-cxl,
linux-modules, linux-kernel
On Fri, Dec 16, 2022 at 05:08:53AM +0100, Nicolas Schier wrote:
> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
I've queued this onto modules-next.
Luis
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: Modify default INSTALL_MOD_DIR from extra to updates
2023-01-04 19:25 ` Luis Chamberlain
@ 2023-01-05 2:11 ` Masahiro Yamada
0 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2023-01-05 2:11 UTC (permalink / raw)
To: Luis Chamberlain
Cc: Nicolas Schier, nathan, ndesaulniers, linux-kbuild,
alison.schofield, dan.j.williams, dave, a.manzanares,
lucas.de.marchi, linux-cxl, linux-modules, linux-kernel
On Thu, Jan 5, 2023 at 4:25 AM Luis Chamberlain <mcgrof@kernel.org> wrote:
>
> On Fri, Dec 16, 2022 at 05:08:53AM +0100, Nicolas Schier wrote:
> > Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
>
> I've queued this onto modules-next.
>
> Luis
Acked-by: Masahiro Yamada <masahiroy@kernel.org>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-01-05 2:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-14 23:17 [PATCH] kbuild: Modify default INSTALL_MOD_DIR from extra to updates Luis Chamberlain
2022-12-14 23:27 ` Dan Williams
2022-12-16 4:08 ` Nicolas Schier
2023-01-04 19:25 ` Luis Chamberlain
2023-01-05 2:11 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox