[ovs-dev] [PATCH] debian: Use dh_installmodules instead of calling "depmod" wrongly.

Ben Pfaff blp at nicira.com
Thu Aug 5 17:59:28 UTC 2010


Until now, the postinst for kernel modules built by the Debian packaging
has simply run "depmod -a", which is wrong, since this command rebuilds
the dependencies for the *running* kernel, which is not necessarily the
kernel for which modules are being installed.

The dh_installmodules script automatically adds the correct invocation of
depmod to the postinst script, so this commit switches to using that
instead.

This commit moves the kernel modules from /lib/modules/$KVERS into the
"kernel" subdirectory of that directory because dh_installmodules does not
support modules that are directly in the $KVERS directory.

CC: Sajjad Lateef <slateef at nicira.com>
---
 ...tch-datapath-module-_KVERS_.postinst.modules.in |    2 --
 debian/rules.modules                               |    3 ++-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in b/debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in
index 0268300..2ed4753 100755
--- a/debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in
+++ b/debian/openvswitch-datapath-module-_KVERS_.postinst.modules.in
@@ -5,8 +5,6 @@
 
 set -e
 
-depmod -a
-
 #DEBHELPER#
 
 # If the switch is running, restart it.  This ensures that we are using the
diff --git a/debian/rules.modules b/debian/rules.modules
index 4f39cee..4ca3d92 100755
--- a/debian/rules.modules
+++ b/debian/rules.modules
@@ -20,7 +20,7 @@ kdist_clean:
 kdist_config: prep-deb-files
 
 .PHONY: binary-modules
-binary-modules: DSTDIR = $(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)
+binary-modules: DSTDIR = $(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)/kernel
 binary-modules: prep-deb-files
 	dh_testdir
 	dh_testroot
@@ -30,6 +30,7 @@ binary-modules: prep-deb-files
 	cd openvswitch && $(MAKE) -C datapath/linux-2.6
 	install -d -m755 $(DSTDIR)
 	install -m644 openvswitch/datapath/linux-2.6/*_mod.ko $(DSTDIR)/
+	dh_installmodules
 	dh_installdocs
 	dh_installchangelogs
 	dh_compress
-- 
1.7.1





More information about the dev mailing list