[Unstable][PATCH] UBUNTU: [Packaging] Update modules.ignore just before the ABI check

Juerg Haefliger juerg.haefliger at canonical.com
Mon May 3 09:12:41 UTC 2021


There are certain conditions under which enabled DKMS modules are not
generated during a package build. In order to prevent a subsequent
'missing modules' ABI check failure, the list of DKMS modules is added to
the modules.ignore file. Currently, that file is generated/updated every
time debian/rules is called. This is somewhat problematic since it also
happens during regular kernel preparation and could lead to accidential
commitment of these (temporary) modifications (stranger things have been
committed, cough). To fix that, update/generate modules.ignore just before
the ABI check which happens in a rule that is typically only invoked when
building packages.

Signed-off-by: Juerg Haefliger <juergh at canonical.com>
---
 debian/rules               |  8 --------
 debian/rules.d/4-checks.mk | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/debian/rules b/debian/rules
index 1d53ecc1df7f..d73f3f1636a5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -112,14 +112,6 @@ ifneq ($(do_tools),true)
 	do_tools_host=
 endif
 
-ifeq ($(do_zfs),false)
-	do_zfs_disable:=$(shell for m in $$(cat $(DROOT)/zfs-modules.ignore); do grep -qxF $$m $(prev_abidir)/../modules.ignore 2>/dev/null || echo $$m >> $(prev_abidir)/../modules.ignore; done)
-endif
-
-ifeq ($(do_dkms_wireguard),false)
-	do_wireguard_disable:=$(shell for m in $$(cat $(DROOT)/wireguard-modules.ignore); do grep -qxF $$m $(prev_abidir)/../modules.ignore 2>/dev/null || echo $$m >> $(prev_abidir)/../modules.ignore; done)
-endif
-
 # Either tools package needs the common source preparation
 do_any_tools=$(sort $(filter-out false,$(do_linux_tools) $(do_cloud_tools)))
 
diff --git a/debian/rules.d/4-checks.mk b/debian/rules.d/4-checks.mk
index b99a1023fe5b..b5337b354b17 100644
--- a/debian/rules.d/4-checks.mk
+++ b/debian/rules.d/4-checks.mk
@@ -7,6 +7,20 @@ abi-check-%: install-%
 # Check the module list against the last release (always)
 module-check-%: install-%
 	@echo Debug: $@
+ifeq ($(do_zfs),false)
+	# Ignore zfs DKMS modules
+	@for m in $$(cat $(DROOT)/zfs-modules.ignore); do \
+		grep -qxF $$m $(prev_abidir)/../modules.ignore 2>/dev/null || \
+		echo $$m >> $(prev_abidir)/../modules.ignore; \
+	done
+endif
+ifeq ($(do_dkms_wireguard),false)
+	# Ignore wireguard DKMS modules
+	@for m in $$(cat $(DROOT)/wireguard-modules.ignore); do \
+		grep -qxF $$m $(prev_abidir)/../modules.ignore 2>/dev/null || \
+		echo $$m >> $(prev_abidir)/../modules.ignore; \
+	done
+endif
 	@perl -f $(DROOT)/scripts/module-check "$*" \
 		"$(prev_abidir)" "$(abidir)" $(skipmodule)
 
-- 
2.27.0




More information about the kernel-team mailing list