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

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