Commit 9a8f8fb0 authored by David Johnson's avatar David Johnson

Use a better strategy to workaround intel module source dir layout.

The intel NIC modules store their src in a subdir, and there is no
top-level Makefile.  DKMS doesn't help you fire off a build in a subdir
of the src (although it is happy to pull modules from a subdir!).

Prior to this commit, my strategy only worked for build against the
running kernel.  Now we use a kernel Makefile "hack" to always include
the src subdir (obj-y += src/) for each of these modules.

I also could've just copied the src/* files into the packages -- but
that wouldn't have been nice -- and would have left out the COPYRIGHT
files, etc.
parent aaa5b6e0
......@@ -2,13 +2,16 @@
include /usr/share/dpkg/pkg-info.mk
MODNAME = i40e
%:
dh $@ --with dkms
override_dh_install:
echo 'obj-y += src/' > build/$(MODNAME)-$(DEB_VERSION_UPSTREAM)/Makefile
dh_install \
build/i40e-$(DEB_VERSION_UPSTREAM)/* \
usr/src/i40e-dkms-$(DEB_VERSION_UPSTREAM)
build/$(MODNAME)-$(DEB_VERSION_UPSTREAM)/* \
usr/src/$(MODNAME)-dkms-$(DEB_VERSION_UPSTREAM)
override_dh_dkms:
dh_dkms -V $(DEB_VERSION_UPSTREAM) -- dkms.conf
......
PACKAGE_NAME="i40e-dkms"
PACKAGE_VERSION="#MODULE_VERSION#"
MAKE="'make' -C src/ KERNELDIR=/lib/modules/${kernelver}/build"
CLEAN="'make' -C src/ KERNELDIR=/lib/modules/${kernelver}/build clean"
BUILT_MODULE_LOCATION=src/
BUILT_MODULE_NAME[0]="i40e"
DEST_MODULE_LOCATION[0]="/updates/dkms"
......
......@@ -23,6 +23,7 @@ DKMS version of the i40e kernel module.
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/src/%{module}-%{version}/
cp -pR %{_builddir}/%{srcdirname}/* %{buildroot}/usr/src/%{module}-%{version}/
echo 'obj-y += src/' > %{buildroot}/usr/src/%{module}-%{version}/Makefile
cp -p %{_sourcedir}/dkms.conf %{buildroot}/usr/src/%{module}-%{version}/
%clean
......
......@@ -2,13 +2,16 @@
include /usr/share/dpkg/pkg-info.mk
MODNAME = i40evf
%:
dh $@ --with dkms
override_dh_install:
echo 'obj-y += src/' > build/$(MODNAME)-$(DEB_VERSION_UPSTREAM)/Makefile
dh_install \
build/i40evf-$(DEB_VERSION_UPSTREAM)/* \
usr/src/i40evf-dkms-$(DEB_VERSION_UPSTREAM)
build/$(MODNAME)-$(DEB_VERSION_UPSTREAM)/* \
usr/src/$(MODNAME)-dkms-$(DEB_VERSION_UPSTREAM)
override_dh_dkms:
dh_dkms -V $(DEB_VERSION_UPSTREAM) -- dkms.conf
......
PACKAGE_NAME="i40evf-dkms"
PACKAGE_VERSION="#MODULE_VERSION#"
MAKE="'make' -C src/ KERNELDIR=/lib/modules/${kernelver}/build"
CLEAN="'make' -C src/ KERNELDIR=/lib/modules/${kernelver}/build clean"
BUILT_MODULE_LOCATION=src/
BUILT_MODULE_NAME[0]="i40evf"
DEST_MODULE_LOCATION[0]="/updates/dkms"
......
......@@ -23,6 +23,7 @@ DKMS version of the i40evf kernel module.
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/src/%{module}-%{version}/
cp -pR %{_builddir}/%{srcdirname}/* %{buildroot}/usr/src/%{module}-%{version}/
echo 'obj-y += src/' > %{buildroot}/usr/src/%{module}-%{version}/Makefile
cp -p %{_sourcedir}/dkms.conf %{buildroot}/usr/src/%{module}-%{version}/
%clean
......
......@@ -2,13 +2,16 @@
include /usr/share/dpkg/pkg-info.mk
MODNAME = ixgbe
%:
dh $@ --with dkms
override_dh_install:
echo 'obj-y += src/' > build/$(MODNAME)-$(DEB_VERSION_UPSTREAM)/Makefile
dh_install \
build/ixgbe-$(DEB_VERSION_UPSTREAM)/* \
usr/src/ixgbe-dkms-$(DEB_VERSION_UPSTREAM)
build/$(MODNAME)-$(DEB_VERSION_UPSTREAM)/* \
usr/src/$(MODNAME)-dkms-$(DEB_VERSION_UPSTREAM)
override_dh_dkms:
dh_dkms -V $(DEB_VERSION_UPSTREAM) -- dkms.conf
......
PACKAGE_NAME="ixgbe-dkms"
PACKAGE_VERSION="#MODULE_VERSION#"
MAKE="'make' -C src/ KERNELDIR=/lib/modules/${kernelver}/build"
CLEAN="'make' -C src/ KERNELDIR=/lib/modules/${kernelver}/build clean"
BUILT_MODULE_LOCATION=src/
BUILT_MODULE_NAME[0]="ixgbe"
DEST_MODULE_LOCATION[0]="/updates/dkms"
......
......@@ -23,6 +23,7 @@ DKMS version of the ixgbe kernel module.
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/src/%{module}-%{version}/
cp -pR %{_builddir}/%{srcdirname}/* %{buildroot}/usr/src/%{module}-%{version}/
echo 'obj-y += src/' > %{buildroot}/usr/src/%{module}-%{version}/Makefile
cp -p %{_sourcedir}/dkms.conf %{buildroot}/usr/src/%{module}-%{version}/
%clean
......
......@@ -2,13 +2,16 @@
include /usr/share/dpkg/pkg-info.mk
MODNAME = ixgbevf
%:
dh $@ --with dkms
override_dh_install:
echo 'obj-y += src/' > build/$(MODNAME)-$(DEB_VERSION_UPSTREAM)/Makefile
dh_install \
build/ixgbevf-$(DEB_VERSION_UPSTREAM)/* \
usr/src/ixgbevf-dkms-$(DEB_VERSION_UPSTREAM)
build/$(MODNAME)-$(DEB_VERSION_UPSTREAM)/* \
usr/src/$(MODNAME)-dkms-$(DEB_VERSION_UPSTREAM)
override_dh_dkms:
dh_dkms -V $(DEB_VERSION_UPSTREAM) -- dkms.conf
......
PACKAGE_NAME="ixgbevf-dkms"
PACKAGE_VERSION="#MODULE_VERSION#"
MAKE="'make' -C src/ KERNELDIR=/lib/modules/${kernelver}/build"
CLEAN="'make' -C src/ KERNELDIR=/lib/modules/${kernelver}/build clean"
BUILT_MODULE_LOCATION=src/
BUILT_MODULE_NAME[0]="ixgbevf"
DEST_MODULE_LOCATION[0]="/updates/dkms"
......
......@@ -23,6 +23,7 @@ DKMS version of the ixgbevf kernel module.
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/src/%{module}-%{version}/
cp -pR %{_builddir}/%{srcdirname}/* %{buildroot}/usr/src/%{module}-%{version}/
echo 'obj-y += src/' > %{buildroot}/usr/src/%{module}-%{version}/Makefile
cp -p %{_sourcedir}/dkms.conf %{buildroot}/usr/src/%{module}-%{version}/
%clean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment