From patchwork Fri Jan 22 16:23:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 1430426 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DMl1R4ZY8z9sVF; Sat, 23 Jan 2021 03:23:23 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1l2zDU-0004DU-QB; Fri, 22 Jan 2021 16:23:20 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l2zDR-0004Cj-Db for kernel-team@lists.ubuntu.com; Fri, 22 Jan 2021 16:23:17 +0000 Received: from mail-ej1-f70.google.com ([209.85.218.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l2zDR-0006XK-5q for kernel-team@lists.ubuntu.com; Fri, 22 Jan 2021 16:23:17 +0000 Received: by mail-ej1-f70.google.com with SMTP id jg11so2392331ejc.23 for ; Fri, 22 Jan 2021 08:23:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EMmPFXHsQ+xb0qojdOlouXtZwBUGg+IHBSV2p/E9lwo=; b=hKkw9mMLyiQI1s+31o41yA+I/FX0soIloQz4FXZX4h5J3SQZId4CNgIGQemRVVu4h4 ShDeKrpgJsaPS0zGWW53ErCGwZtiZfMMB8Q94KR4dGYfukXgoJMKPLI8K8JmunYQcw3Z 1XuxKYMjo8cysQbYwbnToqxDsKh1DBmsl7sx12WOWLq3bVHX9axWIHchMYs8Bc6BJDRx +OG0w8Kyi8J9sQtcAcm5hX8/3eWPC91hzdSo4gTxjp2PBUuLnajwO4G8nmEjsbIi1kld jFo2Gex5+ptgAUYsDf2mPxsxhyRo0DXhpp5eHcHUWyWFtfv2wmDDxJdZl0TvJNfD5U/c VrXg== X-Gm-Message-State: AOAM532/S6VEA6HFu/9f+BT3HZKVa1g5onYW4eD0rYgHHOWMyfrYnmnZ cTsIBQNXOuMqp2H5j0fSHQbSx8dWMueGVbQpXOp/ENq5lK2r7f4mtQo5uKGkw72ZGNlwLygumpE skLqRmNAXVw8KAMSCIS3CDB2XTdKwClqizCwyCV6oIQ== X-Received: by 2002:aa7:d1d7:: with SMTP id g23mr3799670edp.6.1611332596466; Fri, 22 Jan 2021 08:23:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2DW+BwXyN7adZNwXn65jMWumrl5rJJZerXNBUK3lUeb5KsSIDqfTHT9JEU6eJlPUe1lDVDw== X-Received: by 2002:aa7:d1d7:: with SMTP id g23mr3799654edp.6.1611332596200; Fri, 22 Jan 2021 08:23:16 -0800 (PST) Received: from localhost ([2001:470:6973:2:cb60:1396:20d7:1932]) by smtp.gmail.com with ESMTPSA id i18sm5646715edr.2.2021.01.22.08.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 08:23:15 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH] UBUNTU: [Packaging] nvidia -- use dkms-versions to define versions built Date: Fri, 22 Jan 2021 16:23:02 +0000 Message-Id: <20210122162312.459010-2-apw@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210122162312.459010-1-apw@canonical.com> References: <20210122162312.459010-1-apw@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andy Whitcroft Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Currently each and every Nvidia version added or removed from dkms-versions requires a pair of corresponding changes to debian/rules and debian/rules.d/2-binary-arch.mk. Switch to using the listed versions in debian/dkms-versions to generate the rules we need during build. Signed-off-by: Andy Whitcroft Acked-by: Kamal Mostafa --- debian/rules | 12 ++++-------- debian/rules.d/2-binary-arch.mk | 24 ++++++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/debian/rules b/debian/rules index 8c3c71a298e7..e490836b813d 100755 --- a/debian/rules +++ b/debian/rules @@ -125,17 +125,13 @@ 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_450_version=$(shell gawk '/^nvidia-graphics-drivers-450 / { print $$2; }' debian/dkms-versions) -dkms_nvidia_455_version=$(shell gawk '/^nvidia-graphics-drivers-455 / { print $$2; }' debian/dkms-versions) -dkms_nvidia_460_version=$(shell gawk '/^nvidia-graphics-drivers-460 / { 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_nvidia_450_server_version=$(shell gawk '/^nvidia-graphics-drivers-450-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) +# NVIDIA DKMS package gross series split into desktop and server. +nvidia_desktop_series=$(shell sed -n -e 's/^nvidia-graphics-drivers-\([0-9][0-9]*\) .*/\1/p' debian/dkms-versions) +nvidia_server_series=$(shell sed -n -e 's/^nvidia-graphics-drivers-\([0-9][0-9]*-server\) .*/\1/p' debian/dkms-versions) + # Debian Build System targets binary: binary-indep binary-arch diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 703fd2ade338..593d711a3adb 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -63,6 +63,18 @@ define build_dkms = CROSS_COMPILE=$(CROSS_COMPILE) $(SHELL) $(DROOT)/scripts/dkms-build $(dkms_dir) $(abi_release)-$* '$(call build_dkms_sign,$(builddir)/build-$*)' $(1) $(2) $(3) $(4) $(5) endef +# nvidia_build_payload 450 450 450_450.102.04-0ubuntu0.20.04.1 +# nvidia_build_payload 450-server 450srv 50.102.04-0ubuntu0.20.04.1 +define nvidia_build_payload = + $(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-$(2), pool/restricted/n/nvidia-graphics-drivers-$(1)/nvidia-kernel-source-$(1)_$(3)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-$(1)/nvidia-dkms-$(1)_$(3)_$(arch).deb) +endef +# nvidia_build 450 +# nvidia_build 450-server +define nvidia_build = + $(call nvidia_build_payload,$(1),$(shell echo $(1) | sed -e 's/-server/srv/'),$(shell awk '/^nvidia-graphics-drivers-$(1) / {print($$2);}' debian/dkms-versions)) + +endef + define install_control = for which in $(3); \ do \ @@ -403,18 +415,10 @@ endif $(if $(filter true,$(do_dkms_wireguard)),$(call build_dkms, $(mods_pkg_name)-$*, $(pkgdir)/lib/modules/$(abi_release)-$*/kernel, "", wireguard, pool/universe/w/wireguard-linux-compat/wireguard-dkms_$(dkms_wireguard_version)_all.deb)) ifeq ($(do_dkms_nvidia),true) - $(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-390, pool/restricted/n/nvidia-graphics-drivers-390/nvidia-kernel-source-390_$(dkms_nvidia_390_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-390/nvidia-dkms-390_$(dkms_nvidia_390_version)_$(arch).deb) - $(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) - $(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-450, pool/restricted/n/nvidia-graphics-drivers-450/nvidia-kernel-source-450_$(dkms_nvidia_450_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-450/nvidia-dkms-450_$(dkms_nvidia_450_version)_$(arch).deb) - $(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-455, pool/restricted/n/nvidia-graphics-drivers-455/nvidia-kernel-source-455_$(dkms_nvidia_455_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-455/nvidia-dkms-455_$(dkms_nvidia_455_version)_$(arch).deb) - $(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-460, pool/restricted/n/nvidia-graphics-drivers-460/nvidia-kernel-source-460_$(dkms_nvidia_460_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-460/nvidia-dkms-460_$(dkms_nvidia_460_version)_$(arch).deb) + $(foreach series,$(nvidia_desktop_series),$(call nvidia_build,$(series))) 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) - $(call build_dkms, $(bldinfo_pkg_name)-$*, $(pkgdir_bldinfo)/usr/lib/linux/$(abi_release)-$*/signatures, "", nvidia-450srv, pool/restricted/n/nvidia-graphics-drivers-450-server/nvidia-kernel-source-450-server_$(dkms_nvidia_450_server_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-450-server/nvidia-dkms-450-server_$(dkms_nvidia_450_server_version)_$(arch).deb) - + $(foreach series,$(nvidia_server_series),$(call nvidia_build,$(series))) endif ifeq ($(do_extras_package),true)