b3cd9f
From c99f396a5d456520b34c60f43c589ca39a301955 Mon Sep 17 00:00:00 2001
b3cd9f
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
b3cd9f
Date: Wed, 14 Nov 2018 13:19:27 +0100
b3cd9f
Subject: [PATCH] fips: removed false-positive 'FATAL: Module xxx not found'
b3cd9f
 error message when kernel provides a generic algo for module
b3cd9f
b3cd9f
Resolves: rhbz#1996019
b3cd9f
---
b3cd9f
 modules.d/01fips/fips.sh | 4 ++--
b3cd9f
 1 file changed, 2 insertions(+), 2 deletions(-)
b3cd9f
b3cd9f
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
b3cd9f
index 03da6861..1d57a889 100755
b3cd9f
--- a/modules.d/01fips/fips.sh
b3cd9f
+++ b/modules.d/01fips/fips.sh
b3cd9f
@@ -77,7 +77,7 @@ fips_load_crypto()
b3cd9f
     mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
b3cd9f
     for _module in $FIPSMODULES; do
b3cd9f
         if [ "$_module" != "tcrypt" ]; then
b3cd9f
-            if ! modprobe "${_module}"; then
b3cd9f
+            if ! modprobe "${_module}" 2>/tmp/fips.modprobe_err; then
b3cd9f
                 # check if kernel provides generic algo
b3cd9f
                 _found=0
b3cd9f
                 while read _k _s _v || [ -n "$_k" ]; do
b3cd9f
@@ -86,7 +86,7 @@ fips_load_crypto()
b3cd9f
                     _found=1
b3cd9f
                     break
b3cd9f
                 done 
b3cd9f
-                [ "$_found" = "0" ] && return 1
b3cd9f
+                [ "$_found" = "0" ] && cat /tmp/fips.modprobe_err >&2 && return 1
b3cd9f
             fi
b3cd9f
         fi
b3cd9f
     done
b3cd9f