Skip to content

Commit

Permalink
dkms.conf.in: Install all kernel modules.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
yew011 committed Apr 18, 2015
1 parent 1c79bef commit f315ae4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
9 changes: 9 additions & 0 deletions datapath/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 '_' '-';
2 changes: 2 additions & 0 deletions datapath/Modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 7 additions & 3 deletions debian/dkms.conf.in
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f315ae4

Please sign in to comment.