All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] linux: run depmod only if modules directory exists
@ 2020-06-23 11:38 Paul Cercueil
  2020-06-24 20:17 ` Yann E. MORIN
  2020-08-29 14:58 ` Yann E. MORIN
  0 siblings, 2 replies; 5+ messages in thread
From: Paul Cercueil @ 2020-06-23 11:38 UTC (permalink / raw)
  To: buildroot

If the modules directory that corresponds to the version of the kernel
being built has been deleted, don't try to run depmod, which will
obviously fail.

This can happen for instance when the modules are stripped from the main
root filesystem, and placed into a separate filesystem image, so that
the root filesystem and the kernel can be updated separately.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 linux/linux.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/linux/linux.mk b/linux/linux.mk
index b90b032bb9..d31933fea1 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -490,7 +490,8 @@ endef
 # Run depmod in a target-finalize hook, to encompass modules installed by
 # packages.
 define LINUX_RUN_DEPMOD
-	if grep -q "CONFIG_MODULES=y" $(LINUX_DIR)/.config; then \
+	if test -d $(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED) \
+		&& grep -q "CONFIG_MODULES=y" $(LINUX_DIR)/.config; then \
 		$(HOST_DIR)/sbin/depmod -a -b $(TARGET_DIR) $(LINUX_VERSION_PROBED); \
 	fi
 endef
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-29 17:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-23 11:38 [Buildroot] [PATCH] linux: run depmod only if modules directory exists Paul Cercueil
2020-06-24 20:17 ` Yann E. MORIN
2020-06-24 21:20   ` Paul Cercueil
2020-08-29 14:58 ` Yann E. MORIN
2020-08-29 17:43   ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.