[PATCH 09/46] kbuild: run depmod when installing external modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Following patch enables depmod support when installing external modules.

Signed-off-by: Sam Ravnborg <[email protected]>

---

 Makefile |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

a67dc21a38055ec2d8d85b2f64d98091748569b3
diff --git a/Makefile b/Makefile
index fdb3dac..c55d0f1 100644
--- 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
-- 
1.0.GIT


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux