diff mbox series

[3/10,B,SRU,Hwe] UBUNTU: [packaging] add signed modules for nvidia 418-server 440-server

Message ID 20200825154756.3753617-4-alberto.milone@canonical.com
State New
Headers show
Series [1/10,B,SRU] UBUNTU: [packaging] add signed modules for nvidia 450 and 450-server | expand

Commit Message

Alberto Milone Aug. 25, 2020, 3:47 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
---
 debian.master/rules.d/amd64.mk  |  1 +
 debian/dkms-versions            |  2 ++
 debian/rules                    | 11 ++++++++---
 debian/rules.d/2-binary-arch.mk |  5 +++++
 debian/scripts/dkms-build       |  2 +-
 5 files changed, 17 insertions(+), 4 deletions(-)

Comments

Stefan Bader Aug. 26, 2020, 9:04 a.m. UTC | #1
On 25.08.20 17:47, Alberto Milone wrote:
> 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
> ---
>  debian.master/rules.d/amd64.mk  |  1 +
>  debian/dkms-versions            |  2 ++
>  debian/rules                    | 11 ++++++++---
>  debian/rules.d/2-binary-arch.mk |  5 +++++
>  debian/scripts/dkms-build       |  2 +-
>  5 files changed, 17 insertions(+), 4 deletions(-)
> 
> 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

For the b/hwe kernel changes (5.3) I would probably drop this change and turn
off nvidia as well. The source set has no longer lrm, so it is not gaining
anything but build time here.

I would say we will do that when applying, so no need to re-send.

-Stefan

>  do_dkms_vbox    = true
>  do_dkms_wireguard = true
> diff --git a/debian/dkms-versions b/debian/dkms-versions
> index 93c5b2e2efbe..f4b24c7f87e3 100644
> --- a/debian/dkms-versions
> +++ b/debian/dkms-versions
> @@ -2,5 +2,7 @@ zfs-linux 0.8.1-1ubuntu14.4
>  nvidia-graphics-drivers-390 390.138-0ubuntu0.19.10.1
>  nvidia-graphics-drivers-440 440.100-0ubuntu0.19.10.1
>  nvidia-graphics-drivers-435 435.21-0ubuntu2
> +nvidia-graphics-drivers-418-server 0
> +nvidia-graphics-drivers-440-server 0
>  virtualbox 6.0.14-dfsg-1
>  wireguard-linux-compat 1.0.20200611-1ubuntu1~19.10.1
> diff --git a/debian/rules b/debian/rules
> index be87007d6ac1..5884455e0f4f 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_440_version=$(shell gawk '/^nvidia-graphics-drivers-440/ { print $$2; }' debian/dkms-versions)
> -dkms_nvidia_435_version=$(shell gawk '/^nvidia-graphics-drivers-435/ { 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 72adce739413..81f93f249b83 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -404,6 +404,11 @@ ifeq ($(do_dkms_nvidia),true)
>  	$(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-435, pool/restricted/n/nvidia-graphics-drivers-435/nvidia-kernel-source-435_$(dkms_nvidia_435_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-435/nvidia-dkms-435_$(dkms_nvidia_435_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)/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 638b3122a05d..c1751ffaa016 100755
> --- a/debian/scripts/dkms-build
> +++ b/debian/scripts/dkms-build
> @@ -234,7 +234,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
>
Stefan Bader Aug. 31, 2020, 9:40 a.m. UTC | #2
On 25.08.20 17:47, Alberto Milone wrote:
> 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
> ---

Applied with modifications to not actually build server modules for anything to
bionic/linux-hwe. Thanks.

-Stefan

>  debian/rules                    | 11 ++++++++---
>  debian/rules.d/2-binary-arch.mk |  5 +++++
>  debian/scripts/dkms-build       |  2 +-
>  5 files changed, 17 insertions(+), 4 deletions(-)
> 

<cut>

> diff --git a/debian/rules b/debian/rules
> index be87007d6ac1..5884455e0f4f 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_440_version=$(shell gawk '/^nvidia-graphics-drivers-440/ { print $$2; }' debian/dkms-versions)
> -dkms_nvidia_435_version=$(shell gawk '/^nvidia-graphics-drivers-435/ { 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 72adce739413..81f93f249b83 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -404,6 +404,11 @@ ifeq ($(do_dkms_nvidia),true)
>  	$(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-435, pool/restricted/n/nvidia-graphics-drivers-435/nvidia-kernel-source-435_$(dkms_nvidia_435_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-435/nvidia-dkms-435_$(dkms_nvidia_435_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)/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 638b3122a05d..c1751ffaa016 100755
> --- a/debian/scripts/dkms-build
> +++ b/debian/scripts/dkms-build
> @@ -234,7 +234,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
>
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 93c5b2e2efbe..f4b24c7f87e3 100644
--- a/debian/dkms-versions
+++ b/debian/dkms-versions
@@ -2,5 +2,7 @@  zfs-linux 0.8.1-1ubuntu14.4
 nvidia-graphics-drivers-390 390.138-0ubuntu0.19.10.1
 nvidia-graphics-drivers-440 440.100-0ubuntu0.19.10.1
 nvidia-graphics-drivers-435 435.21-0ubuntu2
+nvidia-graphics-drivers-418-server 0
+nvidia-graphics-drivers-440-server 0
 virtualbox 6.0.14-dfsg-1
 wireguard-linux-compat 1.0.20200611-1ubuntu1~19.10.1
diff --git a/debian/rules b/debian/rules
index be87007d6ac1..5884455e0f4f 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_440_version=$(shell gawk '/^nvidia-graphics-drivers-440/ { print $$2; }' debian/dkms-versions)
-dkms_nvidia_435_version=$(shell gawk '/^nvidia-graphics-drivers-435/ { 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 72adce739413..81f93f249b83 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -404,6 +404,11 @@  ifeq ($(do_dkms_nvidia),true)
 	$(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-435, pool/restricted/n/nvidia-graphics-drivers-435/nvidia-kernel-source-435_$(dkms_nvidia_435_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-435/nvidia-dkms-435_$(dkms_nvidia_435_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)/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 638b3122a05d..c1751ffaa016 100755
--- a/debian/scripts/dkms-build
+++ b/debian/scripts/dkms-build
@@ -234,7 +234,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