]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dracut): also check libraries when resolving lazy
authorBenjamin Drung <benjamin.drung@canonical.com>
Fri, 6 Feb 2026 22:00:14 +0000 (23:00 +0100)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Fri, 6 Feb 2026 22:41:48 +0000 (17:41 -0500)
Dracut might resolve executable dependencies lazy. In this case all
libraries are installed without resolving their dependencies.

Later Dracut will resolve dependencies of the included executables, but
it will not explicitly check libraries. This will miss resolving
dependencies of libraries that are used via `dlopen()`.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/2193
dracut.sh

index e1aafac7b10848d819d3106a807da4909ef920d2..40bd07b5e2f693edca67ed9fb33d7dbe260084e7 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -2860,15 +2860,15 @@ if [[ $kernel_only != yes ]]; then
     fi
 
     if [[ ${DRACUT_RESOLVE_LAZY-} ]] && [[ $DRACUT_INSTALL ]]; then
-        dinfo "*** Resolving executable dependencies ***"
+        dinfo "*** Resolving dependencies for executables and libraries ***"
         # shellcheck disable=SC2086
-        find "$initdir" -type f -perm /0111 -not -name '*.ko*' -print0 \
+        find "$initdir" -type f \( -perm /0111 -or -name '*.so*' \) -not -name '*.ko*' -print0 \
             | xargs -r -0 $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${dracutsysrootdir:+-r "$dracutsysrootdir"} -R ${DRACUT_FIPS_MODE:+-f} --
         # shellcheck disable=SC2181
         if (($? == 0)); then
-            dinfo "*** Resolving executable dependencies done ***"
+            dinfo "*** Resolving dependencies for executables and libraries done ***"
         else
-            dfatal "Resolving executable dependencies failed"
+            dfatal "Resolving dependencies for executables and libraries failed"
             exit 1
         fi
     fi