dkms.conf.in: Install all kernel modules.
authorAlex Wang <alexw@nicira.com>
Fri, 17 Apr 2015 18:30:18 +0000 (11:30 -0700)
committerAlex Wang <alexw@nicira.com>
Sat, 18 Apr 2015 07:56:18 +0000 (00:56 -0700)
With the latest change of separating vports into their own modules,
we need to update the dkms.conf.in and make dkms install all vport
modules.  So, this commit modifies the debian/rules to read all
kernel module names and sets the dkms.conf correctly.

Signed-off-by: Alex Wang <alexw@nicira.com>
datapath/Makefile.am
datapath/Modules.mk
debian/dkms.conf.in
debian/rules

index 1c9e53b..eac9582 100644 (file)
@@ -20,3 +20,12 @@ distfiles: Makefile
          sed -e "s|^$$srcdirstrip/||;t" \
              -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | sort -u > $@
 CLEANFILES = distfiles
+
+# Print name of all modules.
+print-build-modules:
+       @if test -z "$(build_modules)"; \
+       then \
+          echo "Could not find any kernel module."; \
+          exit 1; \
+       fi
+       @echo "$(build_modules)" | tr '_' '-';
\ No newline at end of file
index e9f4079..b1210c5 100644 (file)
@@ -10,6 +10,8 @@ both_modules = \
        vport_gre \
        vport_lisp \
        vport_vxlan
+# When changing the name of 'build_modules', please also update the
+# print-build-modules in Makefile.am.
 build_modules = $(both_modules)        # Modules to build
 dist_modules = $(both_modules) # Modules to distribute
 
index a477761..2c90b4d 100644 (file)
@@ -1,7 +1,11 @@
+MODULES=( __MODULES__ )
+
 PACKAGE_NAME="openvswitch"
 PACKAGE_VERSION="__VERSION__"
 MAKE="./configure --with-linux='${kernel_source_dir}' && make -C datapath/linux"
-BUILT_MODULE_NAME[0]=openvswitch
-BUILT_MODULE_LOCATION[0]=datapath/linux/
-DEST_MODULE_LOCATION[0]=/kernel/drivers/net/openvswitch/
+for __idx in ${!MODULES[@]}; do
+    BUILT_MODULE_NAME[__idx]=${MODULES[__idx]}
+    BUILT_MODULE_LOCATION[__idx]=datapath/linux/
+    DEST_MODULE_LOCATION[__idx]=/kernel/drivers/net/openvswitch/
+done
 AUTOINSTALL=yes
index a5dccac..fc6ce57 100755 (executable)
@@ -105,8 +105,11 @@ install-indep: build-indep
        # copy the source
        cd debian/$(pdkms)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION) && tar xvzf $(CURDIR)/_debian/openvswitch.tar.gz && mv openvswitch/* openvswitch/.[a-z]* . && rmdir openvswitch
 
+       # check we can get kernel module names
+       $(MAKE) -C _debian/datapath print-build-modules
+
        # Prepare dkms.conf from the dkms.conf.in template
-       sed "s/__VERSION__/$(DEB_UPSTREAM_VERSION)/g" debian/dkms.conf.in > debian/$(pdkms)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/dkms.conf
+       sed "s/__VERSION__/$(DEB_UPSTREAM_VERSION)/g; s/__MODULES__/$(shell $(MAKE) -C _debian/datapath print-build-modules | grep -v make)/" debian/dkms.conf.in > debian/$(pdkms)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/dkms.conf
 
        # We don't need the debian folder in there, just upstream sources...
        rm -rf debian/$(pdkms)/usr/src/$(PACKAGE)-$(DEB_UPSTREAM_VERSION)/debian