diff mbox series

[2/3,G] UBUNTU: [packaging] add signed modules for the 418-server and the 440-server flavours

Message ID 20200716133818.1163228-2-alberto.milone@canonical.com
State New
Headers show
Series Add the new NVIDIA 450 and the new server series | expand

Commit Message

Alberto Milone July 16, 2020, 1:38 p.m. UTC
Enable building only on amd64 using the do_dkms_nvidia_server flag.

Also, modify the regular expression in 2-binary-arch.mk, so that
names such as nvidia-440srv are allowed.

BugLink: https://bugs.launchpad.net/bugs/1881137

Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
---
 debian.master/rules.d/amd64.mk  |  1 +
 debian/dkms-versions            |  6 ++++--
 debian/rules                    | 11 ++++++++---
 debian/rules.d/2-binary-arch.mk |  5 +++++
 debian/scripts/dkms-build       |  2 +-
 5 files changed, 19 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/debian.master/rules.d/amd64.mk b/debian.master/rules.d/amd64.mk
index b1f62a796c22..d253402ae066 100644
--- a/debian.master/rules.d/amd64.mk
+++ b/debian.master/rules.d/amd64.mk
@@ -23,5 +23,6 @@  do_tools_common = true
 do_tools_acpidbg = true
 do_zfs		= true
 do_dkms_nvidia  = true
+do_dkms_nvidia_server = true
 do_dkms_vbox    = true
 do_dkms_wireguard = true
diff --git a/debian/dkms-versions b/debian/dkms-versions
index 0a5d3ba35e37..9c90b5bb5720 100644
--- a/debian/dkms-versions
+++ b/debian/dkms-versions
@@ -1,6 +1,8 @@ 
 zfs-linux 0.8.3-1ubuntu12
-nvidia-graphics-drivers-390 390.132-0ubuntu2
+nvidia-graphics-drivers-390 0
 nvidia-graphics-drivers-435 0
-nvidia-graphics-drivers-440 440.82+really.440.64-0ubuntu4
+nvidia-graphics-drivers-440 0
+nvidia-graphics-drivers-418-server 0
+nvidia-graphics-drivers-440-server 0
 virtualbox 6.1.6-dfsg-1
 wireguard-linux-compat 1.0.20200413-1
diff --git a/debian/rules b/debian/rules
index 8585c1c95086..b2fde1f08b3b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -45,6 +45,7 @@  ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
 	disable_d_i=true
 	do_zfs=false
 	do_dkms_nvidia=false
+	do_dkms_nvidia_server=false
 	do_dkms_vbox=false
 	do_dkms_wireguard=false
 endif
@@ -80,6 +81,7 @@  ifneq ($(filter autopkgtest,$(DEB_BUILD_PROFILES)),)
 	disable_d_i=true
 	do_zfs=false
 	do_dkms_nvidia=false
+	do_dkms_nvidia_server=false
 	do_dkms_vbox=false
 endif
 
@@ -90,6 +92,7 @@  ifeq ($(do_mainline_build),true)
 	no_dumpfile=1
 	do_zfs=false
 	do_dkms_nvidia=false
+	do_dkms_nvidia_server=false
 	do_dkms_vbox=false
 	skipabi=true
 	skipmodule=true
@@ -121,9 +124,11 @@  do_any_tools=$(sort $(filter-out false,$(do_linux_tools) $(do_cloud_tools)))
 
 # Versions of dkms packages.
 dkms_zfs_linux_version=$(shell gawk '/^zfs-linux / { print $$2; }' debian/dkms-versions)
-dkms_nvidia_390_version=$(shell gawk '/^nvidia-graphics-drivers-390/ { print $$2; }' debian/dkms-versions)
-dkms_nvidia_435_version=$(shell gawk '/^nvidia-graphics-drivers-435/ { print $$2; }' debian/dkms-versions)
-dkms_nvidia_440_version=$(shell gawk '/^nvidia-graphics-drivers-440/ { print $$2; }' debian/dkms-versions)
+dkms_nvidia_390_version=$(shell gawk '/^nvidia-graphics-drivers-390 / { print $$2; }' debian/dkms-versions)
+dkms_nvidia_435_version=$(shell gawk '/^nvidia-graphics-drivers-435 / { print $$2; }' debian/dkms-versions)
+dkms_nvidia_440_version=$(shell gawk '/^nvidia-graphics-drivers-440 / { print $$2; }' debian/dkms-versions)
+dkms_nvidia_418_server_version=$(shell gawk '/^nvidia-graphics-drivers-418-server / { print $$2; }' debian/dkms-versions)
+dkms_nvidia_440_server_version=$(shell gawk '/^nvidia-graphics-drivers-440-server / { print $$2; }' debian/dkms-versions)
 dkms_vbox_guest_version=$(shell gawk '/^virtualbox/ { print $$2; }' debian/dkms-versions)
 dkms_wireguard_version=$(shell gawk '/^wireguard-linux-compat / { print $$2; }' debian/dkms-versions)
 
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index be10f172c232..192a4cd4184d 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -408,6 +408,11 @@  ifeq ($(do_dkms_nvidia),true)
 	$(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-440, pool/restricted/n/nvidia-graphics-drivers-440/nvidia-kernel-source-440_$(dkms_nvidia_440_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-440/nvidia-dkms-440_$(dkms_nvidia_440_version)_$(arch).deb)
 endif
 
+ifeq ($(do_dkms_nvidia_server),true)
+	$(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-418srv, pool/restricted/n/nvidia-graphics-drivers-418-server/nvidia-kernel-source-418-server_$(dkms_nvidia_418_server_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-418-server/nvidia-dkms-418-server_$(dkms_nvidia_418_server_version)_$(arch).deb)
+	$(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-440srv, pool/restricted/n/nvidia-graphics-drivers-440-server/nvidia-kernel-source-440-server_$(dkms_nvidia_440_server_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-440-server/nvidia-dkms-440-server_$(dkms_nvidia_440_server_version)_$(arch).deb)
+endif
+
 ifeq ($(do_extras_package),true)
 	$(if $(filter true,$(do_dkms_vbox)),$(call build_dkms, $(mods_pkg_name)-$*, $(pkgdir_ex)/lib/modules/$(abi_release)-$*/kernel, "", virtualbox-guest, pool/multiverse/v/virtualbox/virtualbox-guest-dkms_$(dkms_vbox_guest_version)_all.deb))
 endif
diff --git a/debian/scripts/dkms-build b/debian/scripts/dkms-build
index 15fc5d1bab23..089ba4ead13d 100755
--- a/debian/scripts/dkms-build
+++ b/debian/scripts/dkms-build
@@ -242,7 +242,7 @@  done
 # as squirreled away, and the log in case it is useful.  Finally pass a formed
 # signing command line in case we need to do that.
 dkms_build_specific="$srcdir/$0--$package"
-dkms_build_generic=$(echo "$dkms_build_specific" | sed -n -e 's/-[0-9][0-9]*$/-N/p')
+dkms_build_generic=$(echo "$dkms_build_specific" | sed -n -e 's/-[0-9][0-9]*[a-z]*$/-N/p')
 for dkms_build in "$dkms_build_specific" "$dkms_build_generic"
 do
 	if [ -z "$dkms_build" -o ! -e "$dkms_build" ]; then