diff options
author | Moritz Maxeiner <[email protected]> | 2016-09-21 22:35:16 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-09-21 13:35:16 -0700 |
commit | 70cc394d919fb576bc23d3dc2552a55a4c9d1c24 (patch) | |
tree | f29138522b7261a84e3e2fe2801909b0b04e58b1 /contrib/dracut/90zfs | |
parent | 609603a5d3356c2c69c926038eee6755e0183d27 (diff) |
Fix regression that broke dracut initramfs generation
Based upon @ryao's initial fix for 1c73494394fc9de9283b3fd4f00bcdf4bd300a7
( 5e9843405f63fdabe76e87b92b81a127d488abc7 ) this one also uses
`command -v` instead of `type`, but additionally only applies the
fix to close zfsonlinux/zfs#4749 when `libgcc_s.so.1` has not been included
by dracut automatically (verified by whether `zpool` links directly to
`libgcc_s.so`), as well as change the fallback option to match `libgcc_s.so*`.
Tested-by: Ben Jencks <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Moritz Maxeiner <[email protected]>
Closes #5089
Closed #5138
Diffstat (limited to 'contrib/dracut/90zfs')
-rwxr-xr-x | contrib/dracut/90zfs/module-setup.sh.in | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in index 6dff2a824..9c88b3245 100755 --- a/contrib/dracut/90zfs/module-setup.sh.in +++ b/contrib/dracut/90zfs/module-setup.sh.in @@ -38,11 +38,17 @@ install() { dracut_install grep dracut_install @sbindir@/zfs dracut_install @sbindir@/zpool - # Include libgcc_s.so.1 to workaround zfsonlinux/zfs#4749 - if type gcc-config 2>&1 1>/dev/null; then + # Workaround for zfsonlinux/zfs#4749 by ensuring libgcc_s.so(.1) is included + if [[ -n "$(ldd @sbindir@/zpool | grep -F 'libgcc_s.so')" ]]; then + # Dracut will have already tracked and included it + :; + elif command -v gcc-config 2>&1 1>/dev/null; then + # On systems with gcc-config (Gentoo, Funtoo, etc.): + # Use the current profile to resolve the appropriate path dracut_install "/usr/lib/gcc/$(s=$(gcc-config -c); echo ${s%-*}/${s##*-})/libgcc_s.so.1" else - dracut_install /usr/lib/gcc/*/*/libgcc_s.so.1 + # Fallback: Guess the path and include all matches + dracut_install /usr/lib/gcc/*/*/libgcc_s.so* fi dracut_install @sbindir@/mount.zfs dracut_install @udevdir@/vdev_id |