2
1
Эх сурвалжийг харах

linux: run depmod only if modules directory exists

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>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
(cherry picked from commit 532fe9fb5788b0b2a2f25b2fd72e63f7c8c490d6)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Paul Cercueil 5 жил өмнө
parent
commit
332e245792
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      linux/linux.mk

+ 2 - 1
linux/linux.mk

@@ -532,7 +532,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