Blame SOURCES/0476-fips-module-setup.sh-also-blacklist-the-alias-resolv.patch

ace748
From 73cf135d804f18b7a1c51ad30004cab9636d2fe8 Mon Sep 17 00:00:00 2001
ace748
From: Harald Hoyer <harald@redhat.com>
ace748
Date: Wed, 30 Nov 2016 13:54:20 +0100
ace748
Subject: [PATCH] fips/module-setup.sh: also blacklist the alias resolved
ace748
 modules
ace748
ace748
---
ace748
 modules.d/01fips/module-setup.sh | 6 +++++-
ace748
 1 file changed, 5 insertions(+), 1 deletion(-)
ace748
ace748
diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh
ace748
index dc47634..3bf6c33 100755
ace748
--- a/modules.d/01fips/module-setup.sh
ace748
+++ b/modules.d/01fips/module-setup.sh
ace748
@@ -11,7 +11,7 @@ depends() {
ace748
 }
ace748
 
ace748
 installkernel() {
ace748
-    local _fipsmodules _mod
ace748
+    local _fipsmodules _mod i
ace748
 
ace748
     if [[ -f "${srcmods}/modules.fips" ]]; then
ace748
         _fipsmodules="$(cat "${srcmods}/modules.fips")"
ace748
@@ -30,6 +30,10 @@ installkernel() {
ace748
         if hostonly='' instmods -c -s $_mod; then
ace748
             echo $_mod >> "${initdir}/etc/fipsmodules"
ace748
             echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
ace748
+            for i in $(modprobe --resolve-alias $_mod 2>/dev/null); do
ace748
+                [[ $i == $_mod ]] && continue
ace748
+                echo "blacklist $i" >> "${initdir}/etc/modprobe.d/fips.conf"
ace748
+            done
ace748
         fi
ace748
     done
ace748
 }