diff mbox series

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

Message ID 20210503091241.142103-1-juergh@canonical.com
State New
Headers show
Series [Unstable] UBUNTU: [Packaging] Update modules.ignore just before the ABI check | expand

Commit Message

Juerg Haefliger May 3, 2021, 9:12 a.m. UTC
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@canonical.com>
---
 debian/rules               |  8 --------
 debian/rules.d/4-checks.mk | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 8 deletions(-)

Comments

Tim Gardner May 3, 2021, 11:51 a.m. UTC | #1
Acked-by: Tim Gardner <tim.gardner@canonical.com>


On 5/3/21 3:12 AM, Juerg Haefliger wrote:
> 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@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)
>   
>
diff mbox series

Patch

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)