]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh: Move the library workaround after squash
authorKairui Song <kasong@redhat.com>
Mon, 8 Jun 2020 19:03:18 +0000 (03:03 +0800)
committerHarald Hoyer <harald@hoyer.xyz>
Thu, 2 Jul 2020 15:05:23 +0000 (17:05 +0200)
Ensure the workaround is also valid when dracut-squash module is used

Signed-off-by: Kairui Song <kasong@redhat.com>
dracut.sh

index 81c6d654a2f65492da9836537abbb96967fb8b6e..9ee722c940fc2161b4ba617607d865d7757bf30a 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1661,15 +1661,6 @@ if [[ $kernel_only != yes ]]; then
     # Now we are done with lazy resolving, always install dependencies
     unset DRACUT_RESOLVE_LAZY
     export DRACUT_RESOLVE_DEPS=1
-
-    # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
-    for _dir in $libdirs; do
-        for _f in "$dracutsysrootdir$_dir/libpthread.so"*; do
-            [[ -e "$_f" ]] || continue
-            inst_libdir_file "libgcc_s.so*"
-            break 2
-        done
-    done
 fi
 
 for ((i=0; i < ${#include_src[@]}; i++)); do
@@ -1941,6 +1932,17 @@ if dracut_module_included "squash"; then
     done
 fi
 
+if [[ $kernel_only != yes ]]; then
+    # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
+    for _dir in $libdirs; do
+        for _f in "$dracutsysrootdir$_dir/libpthread.so"*; do
+            [[ -e "$_f" ]] || continue
+            inst_libdir_file "libgcc_s.so*"
+            break 2
+        done
+    done
+fi
+
 if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
     dinfo "*** Stripping files ***"
     find "$initdir" -type f \