]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix: move ldconfig after library workaround
authorAlexander Tsoy <alexander@tsoy.me>
Thu, 17 Dec 2020 21:01:32 +0000 (00:01 +0300)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 8 Feb 2021 21:44:32 +0000 (22:44 +0100)
Commit de3cb0e3214c moved libpthread workaround after the code that runs
ldconfig. As a result, if installed in a non-default path, libgcc_s.so.1
could not be found by dynamic linker.

dracut.sh

index ea26b646020f18d8917366d5259d768ffd5e8600..ffaa53d5364ebf9e3c3250527d22e9ce2d8538ed 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1872,20 +1872,6 @@ for ((i=0; i < ${#include_src[@]}; i++)); do
     fi
 done
 
-if [[ $kernel_only != yes ]]; then
-    # make sure that library links are correct and up to date
-    for f in $dracutsysrootdir/etc/ld.so.conf $dracutsysrootdir/etc/ld.so.conf.d/*; do
-        [[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}"
-    done
-    if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then
-        if [[ $EUID = 0 ]]; then
-            derror "ldconfig exited ungracefully"
-        else
-            derror "ldconfig might need uid=0 (root) for chroot()"
-        fi
-    fi
-fi
-
 if [[ $do_hardlink = yes ]] && command -v hardlink >/dev/null; then
     dinfo "*** Hardlinking files ***"
     hardlink "$initdir" 2>&1
@@ -2068,6 +2054,20 @@ if [[ $kernel_only != yes ]]; then
     fi
 fi
 
+if [[ $kernel_only != yes ]]; then
+    # make sure that library links are correct and up to date
+    for f in $dracutsysrootdir/etc/ld.so.conf $dracutsysrootdir/etc/ld.so.conf.d/*; do
+        [[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}"
+    done
+    if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then
+        if [[ $EUID = 0 ]]; then
+            derror "ldconfig exited ungracefully"
+        else
+            derror "ldconfig might need uid=0 (root) for chroot()"
+        fi
+    fi
+fi
+
 if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
     dinfo "*** Stripping files ***"
     find "$initdir" -type f \