diff mbox series

[bionic/master,2/2] UBUNTU: [Packaging] expose versioned provides for contained dkms binaries

Message ID 20200619104242.285201-6-apw@canonical.com
State New
Headers show
Series None | expand

Commit Message

Andy Whitcroft June 19, 2020, 10:42 a.m. UTC
We carry a number of DKMS based kernel modules.  Add versioned provides
for those using the -modules namespace so they can be depended on.

BugLink: https://bugs.launchpad.net/bugs/1861284
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 debian/control.d/generic      | 1 +
 debian/control.d/generic-lpae | 1 +
 debian/control.d/lowlatency   | 1 +
 debian/control.d/virtual      | 1 +
 debian/rules                  | 6 ++++++
 5 files changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/debian/control.d/generic b/debian/control.d/generic
index 45079cf..e20ca34 100644
--- a/debian/control.d/generic
+++ b/debian/control.d/generic
@@ -9,6 +9,7 @@  Description: Generic Linux kernel headers
 Package: linux-image-generic@SUFFIX@
 Architecture: i386 amd64 armhf arm64 powerpc ppc64el s390x
 Section: kernel
+Provides: ${dkms:zfs-modules} ${dkms:virtualbox-guest-modules} ${dkms:wireguard-linux-compat-modules}
 Depends: ${misc:Depends}, linux-image-${kernel-abi-version}-generic, linux-modules-extra-${kernel-abi-version}-generic [i386 amd64 arm64 powerpc ppc64el s390x], linux-firmware, intel-microcode [amd64 i386], amd64-microcode [amd64 i386]
 Recommends: thermald [i386 amd64]
 Description: Generic Linux kernel image
diff --git a/debian/control.d/generic-lpae b/debian/control.d/generic-lpae
index bd37c8f..818e93e 100644
--- a/debian/control.d/generic-lpae
+++ b/debian/control.d/generic-lpae
@@ -9,6 +9,7 @@  Description: Generic LPAE Linux kernel headers
 Package: linux-image-generic-lpae@SUFFIX@
 Architecture: armhf
 Section: kernel
+Provides: ${dkms:wireguard-linux-compat-modules}
 Depends: ${misc:Depends}, linux-image-${kernel-abi-version}-generic-lpae, linux-firmware
 Recommends: thermald [i386 amd64]
 Description: Generic LPAE Linux kernel image
diff --git a/debian/control.d/lowlatency b/debian/control.d/lowlatency
index 81a4796..baacfc4 100644
--- a/debian/control.d/lowlatency
+++ b/debian/control.d/lowlatency
@@ -10,6 +10,7 @@  Package: linux-image-lowlatency@SUFFIX@
 Architecture: i386 amd64
 Section: kernel
 Depends: ${misc:Depends}, linux-image-${kernel-abi-version}-lowlatency, linux-firmware, intel-microcode [amd64 i386], amd64-microcode [amd64 i386]
+Provides: ${dkms:zfs-modules} ${dkms:virtualbox-guest-modules} ${dkms:wireguard-linux-compat-modules}
 Recommends: thermald [i386 amd64]
 Description: lowlatency Linux kernel image
  This package will always depend on the latest lowlatency kernel image
diff --git a/debian/control.d/virtual b/debian/control.d/virtual
index 1197312..6c11eea 100644
--- a/debian/control.d/virtual
+++ b/debian/control.d/virtual
@@ -9,6 +9,7 @@  Package: linux-image-virtual@SUFFIX@
 Architecture: i386 amd64 arm64 powerpc ppc64el s390x
 Section: kernel
 Depends: ${misc:Depends}, linux-image-${kernel-abi-version}-generic
+Provides: ${dkms:zfs-modules} ${dkms:virtualbox-guest-modules} ${dkms:wireguard-linux-compat-modules}
 Description: Virtual Linux kernel image
  This package will always depend on the latest minimal generic kernel image
  used for virtual instances.
diff --git a/debian/rules b/debian/rules
index c496b17..3c80af0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -43,6 +43,10 @@  clean: debian/control
 	dh_testroot
 	dh_clean
 
+# Versions of dkms packages.
+dkms_zfs_linux_version=$(shell gawk '/^zfs-linux / { print $$2; }' debian/dkms-versions)
+dkms_wireguard_version=$(shell gawk '/^wireguard-linux-compat / { print $$2; }' debian/dkms-versions)
+
 debian/control: $(control_files)
 	rm -f debian/control.tmp
 	for i in $^; do \
@@ -61,6 +65,8 @@  debian/control: $(control_files)
 gencontrol_flags = -Vkernel-version=$(KERNEL_VERSION)
 gencontrol_flags += -Vkernel-abi-version=$(KERNEL_ABI_VERSION)
 gencontrol_flags += -Vgeneric-depends=$(GENERIC_DEP)
+gencontrol_flags += -Vdkms:zfs-modules="zfs-modules (= $(dkms_zfs_linux_version)),"
+gencontrol_flags += -Vdkms:wireguard-linux-compat-modules="wireguard-modules (= $(dkms_wireguard_version)),"
 
 build-%:
 	: