aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorнаб <nabijaczleweli@nabijaczleweli.xyz>2021-05-23 13:48:26 +0000
committerBrian Behlendorf <behlendorf1@llnl.gov>2021-06-04 21:01:08 +0000
commitcfc8dd198368dbf4e76c21731ebab35789d2fdd1 (patch)
treeb2b09c14cfe13ad6f1c250d3b5220569a2c6510e
parent50353dbd05a771378ef2eebd3bcb4ab5a0029f43 (diff)
dracut: 90zfs: module-setup: try /lib*/libgcc_s.so*, relax /u/l/gcc path
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 #11750 Closes #12108
-rwxr-xr-xcontrib/dracut/90zfs/module-setup.sh.in9
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in
index 6122551c3ae7..817da5b2b4a9 100755
--- a/contrib/dracut/90zfs/module-setup.sh.in
+++ b/contrib/dracut/90zfs/module-setup.sh.in
@@ -49,13 +49,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
# shellcheck disable=SC2050
if [ @LIBFETCH_DYNAMIC@ != 0 ]; then