]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(nfs): do not set DRACUT_RESOLVE_LAZY for musl
authorJo Zzsi <jozzsicsataban@gmail.com>
Sat, 4 Jan 2025 12:17:12 +0000 (07:17 -0500)
committerLaszlo <laszlo.gombos@gmail.com>
Sat, 11 Jan 2025 02:32:28 +0000 (21:32 -0500)
Also move inst_libdir_file as the last step to handle
the error case better.

Fixes https://github.com/dracut-ng/dracut-ng/issues/1087

dracut.sh
modules.d/95nfs/module-setup.sh

index daae85b8a24b5c728b5ffa240e6de5ef1fa098c8..88b14f3eb1b25cc0f1efda87425fa733e4925fe2 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1357,7 +1357,11 @@ if [[ $early_microcode == yes ]] || { [[ $acpi_override == yes ]] && [[ -d $acpi
     mkdir "$early_cpio_dir"
 fi
 
-[[ "$dracutsysrootdir" ]] || [[ "$noexec" ]] || export DRACUT_RESOLVE_LAZY="1"
+if ${DRACUT_LDD:-ldd} "${dracutsysrootdir}/bin/sh" | grep -q musl &> /dev/null; then
+    musl=1
+fi
+
+[[ "$dracutsysrootdir" ]] || [[ "$noexec" ]] || [[ "$musl" ]] || export DRACUT_RESOLVE_LAZY="1"
 
 if [[ $print_cmdline ]]; then
     stdloglvl=0
index d2ed1242d6ea8b58066283bafe5090695c7b33b9..039b4e4c11f1e416f8b93451ee422e74b597da03 100755 (executable)
@@ -94,8 +94,6 @@ install() {
         echo "alias nfs4 nfs" > "$initdir"/etc/modprobe.d/nfs.conf
     fi
 
-    inst_libdir_file 'libnfsidmap_nsswitch.so*' 'libnfsidmap/*.so' 'libnfsidmap*.so*'
-
     _nsslibs=$(
         cat "$dracutsysrootdir"/{,usr/}etc/nsswitch.conf 2> /dev/null \
             | sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' \
@@ -140,4 +138,6 @@ install() {
     done
 
     dracut_need_initqueue
+
+    inst_libdir_file 'libnfsidmap_nsswitch.so*' 'libnfsidmap/*.so' 'libnfsidmap*.so*'
 }