kbuild: Modify default INSTALL_MOD_DIR from extra to updates
PATCH 1/1 kbuild: Modify default INSTALL_MOD_DIR from extra to updates
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/[email protected]
--- scripts/Makefile.modinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.modinst +1 -1
@@ -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
Signature · 1 line
2.35.1
Quoted 27 lines · Luis Chamberlain
The default
INSTALL_MOD_DIRof using the /lib/modules/$(uname -r)/extra directory for external modules assumes distributions will have something like/etc/depmod.d/dist.confwith:search updates extra built-in
However, only some Red Hat release have and use the extra stuff for years now. Meanwhile, the
depmod.ctool 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) themodules_installtarget 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.
Quoted 7 lines
With today's default you end up actually *crashing* Linux when trying to load
cxl_testwith 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/[email protected]
Signed-off-by Luis Chamberlain <[email protected]>
Thanks for digging into the history here Luis!
Quoted 32 lines · Luis Chamberlain
The default
INSTALL_MOD_DIRof using the /lib/modules/$(uname -r)/extra directory for external modules assumes distributions will have something like/etc/depmod.d/dist.confwith:search updates extra built-in
However, only some Red Hat release have and use the extra stuff for years now. Meanwhile, the
depmod.ctool 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) themodules_installtarget 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_testwith the default "extra" [0] directory being used. This fixes that and allows other mocking drivers to do less work.
Quoted 6 lines
[0] https://lkml.kernel.org/r/[email protected]
Signed-off-by Luis Chamberlain <[email protected]>--- scripts/Makefile.modinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 1 line · Nicolas Schier
Reviewed-by Nicolas Schier <[email protected]>
I've queued this onto modules-next.
Luis
Masahiro Yamada
Acked-byQuoted 7 lines · Luis Chamberlain
Quoted 1 line · Nicolas Schier
Reviewed-by Nicolas Schier <[email protected]>I've queued this onto modules-next.
Luis
Signature · 2 lines
Best Regards Masahiro Yamada