File: 2100-zfs-load-module.patch

package info (click to toggle)
zfs-linux 2.3.2-2
  • links: PTS, VCS
  • area: contrib
  • in suites: sid, trixie
  • size: 71,496 kB
  • sloc: ansic: 392,648; sh: 67,208; asm: 47,693; python: 8,160; makefile: 5,100; perl: 839; sed: 41
file content (76 lines) | stat: -rw-r--r-- 2,271 bytes parent folder | download | duplicates (2)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Description: explicitly load the ZFS module via systemd service
Author: Ubuntu developers
Forwarded: not needed
--- a/etc/systemd/system/zfs-import-cache.service.in
+++ b/etc/systemd/system/zfs-import-cache.service.in
@@ -3,7 +3,9 @@
 Documentation=man:zpool(8)
 DefaultDependencies=no
 Requires=systemd-udev-settle.service
+Requires=zfs-load-module.service
 After=systemd-udev-settle.service
+After=zfs-load-module.service
 After=cryptsetup.target
 After=multipathd.service
 After=systemd-remount-fs.service
--- a/etc/systemd/system/zfs-import-scan.service.in
+++ b/etc/systemd/system/zfs-import-scan.service.in
@@ -3,7 +3,9 @@
 Documentation=man:zpool(8)
 DefaultDependencies=no
 Requires=systemd-udev-settle.service
+Requires=zfs-load-module.service
 After=systemd-udev-settle.service
+After=zfs-load-module.service
 After=cryptsetup.target
 After=multipathd.service
 Before=zfs-import.target
--- /dev/null
+++ b/etc/systemd/system/zfs-load-module.service.in
@@ -0,0 +1,17 @@
+[Unit]
+Description=Install ZFS kernel module
+DefaultDependencies=no
+Requires=systemd-udev-settle.service
+After=systemd-udev-settle.service
+After=cryptsetup.target
+Before=dracut-mount.service
+After=systemd-remount-fs.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/sbin/modprobe zfs
+
+[Install]
+WantedBy=zfs-mount.service
+WantedBy=zfs.target
--- a/contrib/dracut/90zfs/module-setup.sh.in
+++ b/contrib/dracut/90zfs/module-setup.sh.in
@@ -95,7 +95,8 @@
 
 		for _service in \
 			"zfs-import-scan.service" \
-			"zfs-import-cache.service"; do
+			"zfs-import-cache.service" \
+            "zfs-load-module.service"; do
 			inst_simple "${systemdsystemunitdir}/${_service}"
 			systemctl -q --root "${initdir}" add-wants zfs-import.target "${_service}"
 
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -52,6 +52,7 @@
 	%D%/systemd/system/50-zfs.preset
 
 systemdunit_DATA = \
+	%D%/systemd/system/zfs-load-module.service \
 	%D%/systemd/system/zfs-import-cache.service \
 	%D%/systemd/system/zfs-import-scan.service \
 	%D%/systemd/system/zfs-import.target \
--- a/etc/systemd/system/50-zfs.preset
+++ b/etc/systemd/system/50-zfs.preset
@@ -7,3 +7,4 @@
 enable zfs-zed.service
 enable zfs-volume-wait.service
 enable zfs.target
+enable zfs-load-module.service