diff mbox series

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

Message ID 20200302082928.GA10224@xps-13
State New
Headers show
Series [F,/,unstable] UBUNTU: [Packaging] prevent duplicated entries in modules.ignore | expand

Commit Message

Andrea Righi March 2, 2020, 8:29 a.m. UTC
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@canonical.com>
---
 debian/rules | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Seth Forshee March 7, 2020, 2:32 p.m. UTC | #1
On Mon, Mar 02, 2020 at 09:29:28AM +0100, Andrea Righi wrote:
> 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@canonical.com>

Applied to focal/master-next and unstable/master, thanks!
diff mbox series

Patch

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