summaryrefslogtreecommitdiff
path: root/sys-fs/zfs/files/2.1.2-openrc-vendor.patch
blob: abe222aa5b840572ef1f3431ca1f2de021404ed8 (plain)
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
From 6ef28c526ba7199a3740407d764b6505618ca8ba Mon Sep 17 00:00:00 2001
From: Peter Levine <plevine457@gmail.com>
Date: Fri, 29 Oct 2021 18:34:37 -0400
Subject: [PATCH] Set DEFAULT_INIT_SHELL to /sbin/openrc-run for Gentoo and
 Alpine

Gentoo and Alpine always set the rc init scripts' shebang to
#!/sbin/openrc-run, whether or not openrc is installed.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Peter Levine <plevine457@gmail.com>
Closes #12683
Closes #12692
---
 config/zfs-build.m4 | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
index 27041c054c2..ec4a2026bf5 100644
--- a/config/zfs-build.m4
+++ b/config/zfs-build.m4
@@ -564,15 +564,11 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
 		*)          DEFAULT_INIT_SCRIPT=lsb    ;;
 	esac
 
-	# On gentoo, it's possible that OpenRC isn't installed.  Check if
-	# /sbin/openrc-run exists, and if not, fall back to generic defaults.
-
-	DEFAULT_INIT_SHELL="/bin/sh"
-	AS_IF([test "$DEFAULT_INIT_SCRIPT" = "openrc"], [
-		AS_IF([test -x "/sbin/openrc-run"],
-			[DEFAULT_INIT_SHELL="/sbin/openrc-run"],
-			[DEFAULT_INIT_SCRIPT=lsb])
-	])
+	case "$VENDOR" in
+		gentoo)     DEFAULT_INIT_SHELL="/sbin/openrc-run";;
+		alpine)     DEFAULT_INIT_SHELL="/sbin/openrc-run";;
+		*)          DEFAULT_INIT_SHELL="/bin/sh"         ;;
+	esac
 
 	AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT:$DEFAULT_INIT_SHELL])
 	AC_SUBST(DEFAULT_INIT_SCRIPT)