[F / unstable] [PATCH] UBUNTU: [Packaging] prevent duplicated entries in modules.ignore

Andrea Righi andrea.righi at canonical.com
Mon Mar 2 08:29:28 UTC 2020


If we always append the list of disabled modules to modules.ignore we
may end up having lots of duplicate entries during the kernel cranking
process.

Prevent this by checking which modules are already present in
modules.ignore before appending them.

NOTE: it would be better to generate modules.ignore using some
information from the builder itself, rather than maintaining all the
*.ignore files. But for now, as a first step, let's prevent the
duplicate entries at least.

Signed-off-by: Andrea Righi <andrea.righi at canonical.com>
---
 debian/rules | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/rules b/debian/rules
index 8e455c330326..d1ec78abcabb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -105,15 +105,15 @@ ifneq ($(do_tools),true)
 endif
 
 ifeq ($(do_zfs),false)
-	do_zfs_disable:=$(shell cat $(DROOT)/zfs-modules.ignore >>$(prev_abidir)/../modules.ignore)
+	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_vbox),false)
-	do_vbox_disable:=$(shell cat $(DROOT)/vbox-modules.ignore >>$(prev_abidir)/../modules.ignore)
+	do_vbox_disable:=$(shell for m in $$(cat $(DROOT)/vbox-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 cat $(DROOT)/wireguard-modules.ignore >>$(prev_abidir)/../modules.ignore)
+	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
-- 
2.25.0




More information about the kernel-team mailing list