Skip to content

Commit

Permalink
Merge pull request #362 from aafeijoo-suse/059-bsc1228659
Browse files Browse the repository at this point in the history
fix(dracut): ldd output borked with `--sysroot` (bsc#1228659)
  • Loading branch information
aafeijoo-suse authored Aug 9, 2024
2 parents 88fc133 + 338864d commit 9a22b6b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dracut-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ if ! [[ $libdirs ]]; then
export libdirs
fi

# ldd needs LD_LIBRARY_PATH pointing to the libraries within the sysroot directory
if [[ -n $dracutsysrootdir ]]; then
for lib in $libdirs; do
mapfile -t -d '' lib_subdirs < <(find "$lib" -type d -print0 2> /dev/null)
for lib_subdir in "${lib_subdirs[@]}"; do
LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+"$LD_LIBRARY_PATH":}$dracutsysrootdir$lib_subdir"
done
done
export LD_LIBRARY_PATH
fi

# helper function for check() in module-setup.sh
# to check for required installed binaries
# issues a standardized warning message
Expand Down

0 comments on commit 9a22b6b

Please sign in to comment.