]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - Makefile
kbuild: run depmod when installing external modules
[mirror_ubuntu-artful-kernel.git] / Makefile
index fdb3dac3e70f8a2e57eca2f547e48c7c0a24e00a..c55d0f1b85ecf231c69bae64456ed994a4bb442d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1147,9 +1147,28 @@ modules: $(module-dirs)
        $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
 
 .PHONY: modules_install
-modules_install:
+modules_install: _emodinst_ _emodinst_post
+       
+install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra)       
+.PHONY: _emodinst_
+_emodinst_:
+       $(Q)rm -rf $(MODLIB)/$(install-dir)
+       $(Q)mkdir -p $(MODLIB)/$(install-dir)
        $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
 
+# Run depmod only is we have System.map and depmod is executable
+quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
+      cmd_depmod = if [ -r System.map -a -x $(DEPMOD) ]; then \
+                      $(DEPMOD) -ae -F System.map             \
+                      $(if $(strip $(INSTALL_MOD_PATH)),      \
+                     -b $(INSTALL_MOD_PATH) -r)              \
+                     $(KERNELRELEASE);                       \
+                   fi
+
+.PHONY: _emodinst_post
+_emodinst_post: _emodinst_
+       $(call cmd,depmod)
+
 clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD))
 
 .PHONY: $(clean-dirs) clean