Package: zfs-linux / 0.6.5.9-5

0246-Fix-regression-that-broke-dracut-initramfs-generatio.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 70cc394d919fb576bc23d3dc2552a55a4c9d1c24 Mon Sep 17 00:00:00 2001
From: Moritz Maxeiner <moritz@ucworks.org>
Date: Wed, 21 Sep 2016 22:35:16 +0200
Subject: [PATCH 246/530] 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 <ben@bjencks.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Moritz Maxeiner <moritz@ucworks.org>
Closes #5089
Closed #5138
---
 contrib/dracut/90zfs/module-setup.sh.in | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in
index 6dff2a8..9c88b32 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
-- 
2.1.4