diff --git a/linux/linux.mk b/linux/linux.mk index c963f2f47f..010ed3497e 100644 --- a/linux/linux.mk +++ b/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