Skip to content

Commit

Permalink
dracut: 90zfs: module-setup: try /lib*/libgcc_s.so*, relax /u/l/gcc path
Browse files Browse the repository at this point in the history
SUSE stores the library at /lib64/libgcc_s.so.1 (/lib/libgcc_s.so.1 for
i686 glibc), which is in the search path

Also relax the /usr/lib path to catch systems similar to SUSE
(/usr/lib64/gcc/x86_64-suse-linux/10/libgcc_s.so) but without
the top-level lib64

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#11750
Closes openzfs#12108
  • Loading branch information
nabijaczleweli authored and behlendorf committed Jun 8, 2021
1 parent f802a57 commit 24f0505
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions contrib/dracut/90zfs/module-setup.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ install() {
# On systems with gcc-config (Gentoo, Funtoo, etc.):
# Use the current profile to resolve the appropriate path
s="$(gcc-config -c)"
dracut_install "/usr/lib/gcc/${s%-*}/${s##*-}/libgcc_s.so.1"
elif ls /usr/lib/libgcc_s.so* >/dev/null 2>&1; then
dracut_install "/usr/lib/gcc/${s%-*}/${s##*-}/libgcc_s.so"*
elif [ "$(echo /usr/lib/libgcc_s.so*)" != "/usr/lib/libgcc_s.so*" ]; then
# Try a simple path first
dracut_install /usr/lib/libgcc_s.so*
elif [ "$(echo /lib*/libgcc_s.so*)" != "/lib*/libgcc_s.so*" ]; then
# SUSE
dracut_install /lib*/libgcc_s.so*
else
# Fallback: Guess the path and include all matches
dracut_install /usr/lib/gcc/*/*/libgcc_s.so*
dracut_install /usr/lib*/gcc/**/libgcc_s.so*
fi
dracut_install @mounthelperdir@/mount.zfs
dracut_install @udevdir@/vdev_id
Expand Down

0 comments on commit 24f0505

Please sign in to comment.