0b8dad
From 2ee3efdfa0c7f12c2f8446721937bfe713858854 Mon Sep 17 00:00:00 2001
0b8dad
From: Kairui Song <kasong@redhat.com>
0b8dad
Date: Mon, 9 Aug 2021 18:23:43 +0800
0b8dad
Subject: [PATCH] fix(squash): apply FIPS and libpthread workaround
0b8dad
0b8dad
There are some workarounds in dracut.sh for FIPS/libpthread covering
0b8dad
some hidden lib dependency issues. These workarounds didn't take effect
0b8dad
for the squash loader since the squash loader is installed
0b8dad
independently. So apply these workarounds again.
0b8dad
0b8dad
Also skip the lib detection code, since these extra installed libs
0b8dad
are small, and squash loader contents are dropped after switch root,
0b8dad
won't be an issue to be always installed. And this makes the code
0b8dad
cleaner.
0b8dad
0b8dad
Signed-off-by: Kairui Song <kasong@redhat.com>
0b8dad
(cherry picked from commit 5ab18dee996f0eeb2b0bfe354570e1b1af46d025)
0b8dad
0b8dad
Resolves: #1990847
0b8dad
---
0b8dad
 modules.d/99squash/module-setup.sh | 6 ++++++
0b8dad
 1 file changed, 6 insertions(+)
0b8dad
0b8dad
diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh
0b8dad
index 7f5d365a..e73d3184 100644
0b8dad
--- a/modules.d/99squash/module-setup.sh
0b8dad
+++ b/modules.d/99squash/module-setup.sh
0b8dad
@@ -53,6 +53,12 @@ installpost() {
0b8dad
         done
0b8dad
     else
0b8dad
         DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep umount
0b8dad
+
0b8dad
+        # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
0b8dad
+        inst_libdir_file -o "libgcc_s.so*"
0b8dad
+
0b8dad
+        # FIPS workaround for Fedora/RHEL: libcrypto needs libssl when FIPS is enabled
0b8dad
+        [[ $DRACUT_FIPS_MODE ]] && inst_libdir_file -o "libssl.so*"
0b8dad
     fi
0b8dad
 
0b8dad
     hostonly="" instmods "loop" "squashfs" "overlay"