Skip to contentSkip to conversation

linux: run depmod only if modules are enabled

PATCH New unixmania at gmail.com 3 participants 3 messages Mar 25, 2020 – Apr 7, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: run depmod only if modules are enabled

From: Carlos Santos <[email protected]>

If the kernel configuration CONFIG_MODULES disabled, there's no /lib/modules/<version> directory, causing this:

depmod: ERROR: could not open directory [...]/target/lib/modules/4.19.8: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
Makefile:745: recipe for target 'target-finalize' failed

---
CC: "Yann E. MORIN" <[email protected]>

---
 linux/linux.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
linux/linux.mk +3 -1
index 2e3ea52053..b2ceeecafb 100644
@@ -539,7 +539,9 @@ endef
 # Run depmod in a target-finalize hook, to encompass modules installed by
 # packages.
 define LINUX_RUN_DEPMOD
-	$(HOST_DIR)/sbin/depmod -a -b $(TARGET_DIR) $(LINUX_VERSION_PROBED)
+	if grep -q "CONFIG_MODULES=y" $(LINUX_DIR)/.config; then \
+		$(HOST_DIR)/sbin/depmod -a -b $(TARGET_DIR) $(LINUX_VERSION_PROBED); \
+	fi
 endef
 LINUX_TARGET_FINALIZE_HOOKS += LINUX_RUN_DEPMOD
 
Signature · 1 line
2.18.2
#1 lore raw

PATCH 1/1 linux: run depmod only if modules are enabled

Quoted 9 lines · On Tue, 24 Mar 2020 21:21:54 -0300 unixmania at gmail.com wrote:

From: Carlos Santos <[email protected]>

If the kernel configuration CONFIG_MODULES disabled, there's no /lib/modules/<version> directory, causing this:

depmod: ERROR: could not open directory [...]/target/lib/modules/4.19.8: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
Makefile:745: recipe for target 'target-finalize' failed

Quoted 7 lines

---
CC: "Yann E. MORIN" <[email protected]>

---
 linux/linux.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Thanks, applied after adding a number of references to defconfig build failures that are fixed by this patch. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 linux: run depmod only if modules are enabled

In reply to unixmania at gmail.com
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"unixmania" == unixmania <[email protected]> writes:

From: Carlos Santos <[email protected]>
If the kernel configuration CONFIG_MODULES disabled, there's no /lib/modules/<version> directory, causing this:

Quoted 6 lines

depmod: ERROR: could not open directory [...]/target/lib/modules/4.19.8: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
Makefile:745: recipe for target 'target-finalize' failed

Committed to 2020.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard