Bug 218758 - depmod: Handle installing modules under a prefix
Summary: depmod: Handle installing modules under a prefix
Status: NEW
Alias: None
Product: Other
Classification: Unclassified
Component: Modules (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: other_modules
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-21 13:17 UTC by sander44
Modified: 2024-04-21 13:17 UTC (History)
0 users

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description sander44 2024-04-21 13:17:25 UTC
Hi Kernel Team,

I use OpenSUSE as a daily driver to develop and optimize kernel modules. From what I can see, the "make -j25 tar-pkg ARCH=x86_64 LOCALVERSION=-vanilla-lowlatency1" command does not do a complete depmod to the modules because they are not installed in the correct location.

A patch can be made in this area as well as upstream, to solve this aspect.

At the moment I use the version with detection through pkg-config and kmod.

Patch:
diff --git a/Makefile b/Makefile
index 59d8a7f95..3af2efda6 100644
--- a/Makefile
+++ b/Makefile
@@ -1087,7 +1087,9 @@ export INSTALL_DTBS_PATH ?= $(INSTALL_PATH)/dtbs/$(KERNELRELEASE)
 # makefile but the argument can be passed to make if needed.
 #
 
-MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
+export KERNEL_MODULE_DIRECTORY := $(shell pkg-config --print-variables kmod 2>/dev/null | grep '^module_directory$$' >/dev/null && pkg-config --variable=module_directory kmod || echo /lib/modules)
+
+MODLIB = $(INSTALL_MOD_PATH)$(KERNEL_MODULE_DIRECTORY)/$(KERNELRELEASE)
 export MODLIB
 
 PHONY += prepare0


Kernel: 6.8.x

Note You need to log in before you can comment on or make changes to this bug.