diff mbox series

[V2,4/6,SRU,Unstable] UBUNTU: [Packaging] add arch= in dkms-versions

Message ID 20220422171021.2382248-14-vicamo.yang@canonical.com
State New
Headers show
Series None | expand

Commit Message

You-Sheng Yang April 22, 2022, 5:10 p.m. UTC
From: "You-Sheng Yang (vicamo)" <vicamo.yang@canonical.com>

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

Signed-off-by: You-Sheng Yang (vicamo) <vicamo.yang@canonical.com>
---
 debian.master/rules.d/amd64.mk   | 2 --
 debian.master/rules.d/arm64.mk   | 1 -
 debian.master/rules.d/ppc64el.mk | 1 -
 debian.master/rules.d/s390x.mk   | 2 --
 debian/dkms-versions             | 4 ++--
 debian/rules                     | 5 +++++
 debian/rules.d/0-common-vars.mk  | 5 +++++
 7 files changed, 12 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/debian.master/rules.d/amd64.mk b/debian.master/rules.d/amd64.mk
index 2288c25a7a52..d0384f0227a4 100644
--- a/debian.master/rules.d/amd64.mk
+++ b/debian.master/rules.d/amd64.mk
@@ -20,6 +20,4 @@  do_tools_host = true
 do_extras_package = true
 do_tools_common = true
 do_tools_acpidbg = true
-do_zfs		= true
-do_v4l2loopback	= true
 do_odm_drivers  = true
diff --git a/debian.master/rules.d/arm64.mk b/debian.master/rules.d/arm64.mk
index e0415a4075ac..d215e1bda1fe 100644
--- a/debian.master/rules.d/arm64.mk
+++ b/debian.master/rules.d/arm64.mk
@@ -19,4 +19,3 @@  do_tools_perf_jvmti = true
 do_tools_bpftool = true
 
 do_dtbs		= true
-do_zfs		= true
diff --git a/debian.master/rules.d/ppc64el.mk b/debian.master/rules.d/ppc64el.mk
index ec8f7e914614..b205a5153b51 100644
--- a/debian.master/rules.d/ppc64el.mk
+++ b/debian.master/rules.d/ppc64el.mk
@@ -16,4 +16,3 @@  do_tools_perf_jvmti = true
 do_tools_bpftool  = true
 
 #do_flavour_image_package = false
-do_zfs		= true
diff --git a/debian.master/rules.d/s390x.mk b/debian.master/rules.d/s390x.mk
index 4b3698fc9c45..0620c638a724 100644
--- a/debian.master/rules.d/s390x.mk
+++ b/debian.master/rules.d/s390x.mk
@@ -17,5 +17,3 @@  do_tools_cpupower = true
 do_tools_perf     = true
 do_tools_perf_jvmti = true
 do_tools_bpftool  = true
-
-do_zfs		= true
diff --git a/debian/dkms-versions b/debian/dkms-versions
index 28408b5b3ccb..94888e3539e3 100644
--- a/debian/dkms-versions
+++ b/debian/dkms-versions
@@ -1,2 +1,2 @@ 
-v4l2loopback 0.12.5-1ubuntu5 modulename=v4l2loopback debpath=pool/universe/v/v4l2loopback/v4l2loopback-dkms_0.12.5-1ubuntu5_all.deb rprovides=v4l2loopback-modules rprovides=v4l2loopback-dkms
-zfs-linux 2.1.2-1ubuntu3 modulename=zfs debpath=pool/universe/z/zfs-linux/zfs-dkms_2.1.2-1ubuntu3_all.deb rprovides=spl-modules rprovides=spl-dkms rprovides=zfs-modules rprovides=zfs-dkms
+v4l2loopback 0.12.5-1ubuntu5 modulename=v4l2loopback debpath=pool/universe/v/v4l2loopback/v4l2loopback-dkms_0.12.5-1ubuntu5_all.deb arch=amd64 rprovides=v4l2loopback-modules rprovides=v4l2loopback-dkms
+zfs-linux 2.1.2-1ubuntu3 modulename=zfs debpath=pool/universe/z/zfs-linux/zfs-dkms_2.1.2-1ubuntu3_all.deb arch=amd64 arch=arm64 arch=ppc64el arch=s390x rprovides=spl-modules rprovides=spl-dkms rprovides=zfs-modules rprovides=zfs-dkms
diff --git a/debian/rules b/debian/rules
index 894bb5960437..16623f8bd9b4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -40,6 +40,11 @@  do_tools_host?=false
 do_tools_perf_jvmti?=false
 do_enforce_all?=false
 
+# Default settings for DKMS modules.
+$(foreach _m,$(all_dkms_modules), \
+  $(eval do_$(_m) ?= $(if $(filter $(arch),$(filter-out $(dkms_exclude),$(if $(filter __all__,$(dkms_$(_m)_archs)),$(arch),$(dkms_$(_m)_archs)) $(dkms_include))),true,false)) \
+)
+
 # Don't build tools in a cross compile environment.
 ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
 	do_tools=false
diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
index fcbfffc06eba..b3409ac3614d 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -305,5 +305,10 @@  $(foreach _line,$(shell gawk '{ OFS = "!"; $$1 = $$1; print }' $(DROOT)/dkms-ver
     , \
     $(error debpath for $(_deb_pkgname) not specified.) \
   ) \
+  $(if $(filter arch=%,$(_params)), \
+    $(eval dkms_$(_m)_archs = $(patsubst arch=%,%,$(filter arch=%,$(_params)))) \
+    , \
+    $(eval dkms_$(_m)_archs = __all__) \
+  ) \
   $(eval dkms_$(_m)_rprovides = $(patsubst rprovides=%,%,$(filter rprovides=%,$(_params)))) \
 )