]> git.proxmox.com Git - zfsonlinux.git/blob - zfs-patches/0012-Fix-with-systemd-on-Debian-based-distributions-6963.patch
update SPL to 0.7.7
[zfsonlinux.git] / zfs-patches / 0012-Fix-with-systemd-on-Debian-based-distributions-6963.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: LOLi <loli10K@users.noreply.github.com>
3 Date: Sun, 17 Dec 2017 23:08:48 +0100
4 Subject: [PATCH] Fix --with-systemd on Debian-based distributions (#6963)
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 These changes propagate the "--with-systemd" configure option to the
10 RPM spec file, allowing Debian-based distributions to package
11 systemd-related files.
12
13 Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
14 Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
15 Closes #6591
16 Closes #6963
17 (cherry picked from commit 03658d5081c64e14898cc9be45da3305b27fac9e)
18 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
19 ---
20 rpm/generic/zfs.spec.in | 2 +-
21 config/user-systemd.m4 | 20 ++++++++++++++++----
22 config/zfs-build.m4 | 2 +-
23 3 files changed, 18 insertions(+), 6 deletions(-)
24
25 diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in
26 index 8df57fa46..4a911b4c2 100644
27 --- a/rpm/generic/zfs.spec.in
28 +++ b/rpm/generic/zfs.spec.in
29 @@ -87,11 +87,11 @@ BuildRequires: libblkid-devel
30 BuildRequires: libudev-devel
31 BuildRequires: libattr-devel
32 %endif
33 +
34 %if 0%{?_systemd}
35 Requires(post): systemd
36 Requires(preun): systemd
37 Requires(postun): systemd
38 -BuildRequires: systemd
39 %endif
40
41 # The zpool iostat/status -c scripts call some utilities like lsblk and iostat
42 diff --git a/config/user-systemd.m4 b/config/user-systemd.m4
43 index c2105abce..de2a44f10 100644
44 --- a/config/user-systemd.m4
45 +++ b/config/user-systemd.m4
46 @@ -2,7 +2,8 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
47 AC_ARG_ENABLE(systemd,
48 AC_HELP_STRING([--enable-systemd],
49 [install systemd unit/preset files [[default: yes]]]),
50 - [],enable_systemd=yes)
51 + [enable_systemd=$enableval],
52 + [enable_systemd=check])
53
54 AC_ARG_WITH(systemdunitdir,
55 AC_HELP_STRING([--with-systemdunitdir=DIR],
56 @@ -19,16 +20,27 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
57 [install systemd module load files into dir [[/usr/lib/modules-load.d]]]),
58 systemdmoduleloaddir=$withval,systemdmodulesloaddir=/usr/lib/modules-load.d)
59
60 + AS_IF([test "x$enable_systemd" = xcheck], [
61 + AS_IF([systemctl --version >/dev/null 2>&1],
62 + [enable_systemd=yes],
63 + [enable_systemd=no])
64 + ])
65
66 - AS_IF([test "x$enable_systemd" = xyes],
67 - [
68 + AC_MSG_CHECKING(for systemd support)
69 + AC_MSG_RESULT([$enable_systemd])
70 +
71 + AS_IF([test "x$enable_systemd" = xyes], [
72 ZFS_INIT_SYSTEMD=systemd
73 ZFS_MODULE_LOAD=modules-load.d
74 + DEFINE_SYSTEMD='--with systemd --define "_unitdir $(systemdunitdir)" --define "_presetdir $(systemdpresetdir)"'
75 modulesloaddir=$systemdmodulesloaddir
76 - ])
77 + ],[
78 + DEFINE_SYSTEMD='--without systemd'
79 + ])
80
81 AC_SUBST(ZFS_INIT_SYSTEMD)
82 AC_SUBST(ZFS_MODULE_LOAD)
83 + AC_SUBST(DEFINE_SYSTEMD)
84 AC_SUBST(systemdunitdir)
85 AC_SUBST(systemdpresetdir)
86 AC_SUBST(modulesloaddir)
87 diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
88 index 17cc80462..5eaa49c87 100644
89 --- a/config/zfs-build.m4
90 +++ b/config/zfs-build.m4
91 @@ -160,7 +160,7 @@ AC_DEFUN([ZFS_AC_RPM], [
92 ])
93
94 RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1"'
95 - RPM_DEFINE_UTIL='--define "_dracutdir $(dracutdir)" --define "_udevdir $(udevdir)" --define "_udevruledir $(udevruledir)" --define "_initconfdir $(DEFAULT_INITCONF_DIR)" $(DEFINE_INITRAMFS)'
96 + RPM_DEFINE_UTIL='--define "_dracutdir $(dracutdir)" --define "_udevdir $(udevdir)" --define "_udevruledir $(udevruledir)" --define "_initconfdir $(DEFAULT_INITCONF_DIR)" $(DEFINE_INITRAMFS) $(DEFINE_SYSTEMD)'
97 RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)" --define "require_spldir $(SPL)" --define "require_splobj $(SPL_OBJ)" --define "ksrc $(LINUX)" --define "kobj $(LINUX_OBJ)"'
98 RPM_DEFINE_DKMS=
99
100 --
101 2.14.2
102