1 |
From aee803b81dd69ffdbad8be6dee29843c161656d5 Mon Sep 17 00:00:00 2001 |
2 |
From: Colin Guthrie <colin@mageia.org> |
3 |
Date: Sat, 30 Aug 2014 12:23:39 +0100 |
4 |
Subject: [PATCH] Revert "Drop fedora-storage-init; conflict with older lvm & |
5 |
dmraid so we get the required versions that allow us to do so. |
6 |
(<prajnoha@redhat.com>)" |
7 |
|
8 |
This reverts commit 6091b58b60f532d8e3f317b99f7ea85d99853db3. |
9 |
|
10 |
Conflicts: |
11 |
Makefile |
12 |
|
13 |
We likely want to go the same way as Fedora, but not sure all the bits |
14 |
are in place right now... |
15 |
--- |
16 |
Makefile | 2 ++ |
17 |
initscripts.spec | 2 -- |
18 |
systemd/fedora-storage-init | 41 +++++++++++++++++++++++++ |
19 |
systemd/system/fedora-storage-init-late.service | 16 ++++++++++ |
20 |
systemd/system/fedora-storage-init.service | 16 ++++++++++ |
21 |
systemd/system/fedora-wait-storage.service | 18 +++++++++++ |
22 |
6 files changed, 93 insertions(+), 2 deletions(-) |
23 |
create mode 100644 systemd/fedora-storage-init |
24 |
create mode 100644 systemd/system/fedora-storage-init-late.service |
25 |
create mode 100644 systemd/system/fedora-storage-init.service |
26 |
create mode 100644 systemd/system/fedora-wait-storage.service |
27 |
|
28 |
diff --git a/Makefile b/Makefile |
29 |
index 1248e67..e0b7e5b 100644 |
30 |
--- a/Makefile |
31 |
+++ b/Makefile |
32 |
@@ -109,6 +109,8 @@ install: |
33 |
ln -s ../fedora-autorelabel-mark.service $(ROOT)/usr/lib/systemd/system/basic.target.wants |
34 |
ln -s ../fedora-readonly.service $(ROOT)/usr/lib/systemd/system/local-fs.target.wants |
35 |
ln -s ../fedora-import-state.service $(ROOT)/usr/lib/systemd/system/local-fs.target.wants |
36 |
+ ln -s ../fedora-storage-init.service $(ROOT)/usr/lib/systemd/system/local-fs.target.wants |
37 |
+ ln -s ../fedora-storage-init-late.service $(ROOT)/usr/lib/systemd/system/local-fs.target.wants |
38 |
ln -s ../mandriva-save-dmesg.service $(ROOT)/usr/lib/systemd/system/basic.target.wants |
39 |
ln -s ../mandriva-everytime.service $(ROOT)/usr/lib/systemd/system/basic.target.wants |
40 |
|
41 |
diff --git a/initscripts.spec b/initscripts.spec |
42 |
index 983a55b..a0f3280 100644 |
43 |
--- a/initscripts.spec |
44 |
+++ b/initscripts.spec |
45 |
@@ -16,8 +16,6 @@ Requires: bash >= 3.0 |
46 |
Requires: procps-ng >= 3.3.8-16 |
47 |
Conflicts: systemd < 23-1 |
48 |
Conflicts: systemd-units < 23-1 |
49 |
-Conflicts: lvm2 < 2.02.98-3 |
50 |
-Conflicts: dmraid < 1.0.0.rc16-18 |
51 |
Requires: systemd |
52 |
Requires: iproute, /sbin/arping, findutils |
53 |
# Not strictly required, but nothing else requires it |
54 |
diff --git a/systemd/fedora-storage-init b/systemd/fedora-storage-init |
55 |
new file mode 100644 |
56 |
index 0000000..565d811 |
57 |
--- /dev/null |
58 |
+++ b/systemd/fedora-storage-init |
59 |
@@ -0,0 +1,41 @@ |
60 |
+#!/bin/bash |
61 |
+# |
62 |
+# Storage initialization |
63 |
+ |
64 |
+. /etc/init.d/functions |
65 |
+ |
66 |
+[ -z "${cmdline}" ] && cmdline=$(cat /proc/cmdline) |
67 |
+ |
68 |
+if ! strstr "$cmdline" nompath && [ -f /etc/multipath.conf ] && \ |
69 |
+ [ -x /sbin/multipath ]; then |
70 |
+ modprobe dm-multipath > /dev/null 2>&1 |
71 |
+ /sbin/multipath -u -v 0 |
72 |
+ if [ -x /sbin/kpartx ]; then |
73 |
+ /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -u -a -p p" >/dev/null |
74 |
+ fi |
75 |
+fi |
76 |
+ |
77 |
+if ! strstr "$cmdline" nodmraid && [ -x /sbin/dmraid ]; then |
78 |
+ modprobe dm-mirror >/dev/null 2>&1 |
79 |
+ dmraidsets=$(LC_ALL=C /sbin/dmraid -s -c -i) |
80 |
+ if [ "$?" = "0" ]; then |
81 |
+ SAVEIFS=$IFS |
82 |
+ IFS=$(echo -en "\n\b") |
83 |
+ for dmname in $dmraidsets; do |
84 |
+ if [[ "$dmname" == isw_* ]] && \ |
85 |
+ ! strstr "$cmdline" noiswmd; then |
86 |
+ continue |
87 |
+ fi |
88 |
+ /sbin/dmraid -ay -i --rm_partitions -p "$dmname" >/dev/null 2>&1 |
89 |
+ /sbin/kpartx -u -a -p p "/dev/mapper/$dmname" |
90 |
+ done |
91 |
+ IFS=$SAVEIFS |
92 |
+ fi |
93 |
+fi |
94 |
+ |
95 |
+# Start any MD RAID arrays that haven't been started yet |
96 |
+[ -r /proc/mdstat ] && [ -r /dev/md/md-device-map ] && /sbin/mdadm -IRs |
97 |
+ |
98 |
+if [ -x /sbin/lvm ]; then |
99 |
+ action $"Setting up Logical Volume Management:" /sbin/lvm vgchange -a y --sysinit |
100 |
+fi |
101 |
diff --git a/systemd/system/fedora-storage-init-late.service b/systemd/system/fedora-storage-init-late.service |
102 |
new file mode 100644 |
103 |
index 0000000..69ad089 |
104 |
--- /dev/null |
105 |
+++ b/systemd/system/fedora-storage-init-late.service |
106 |
@@ -0,0 +1,16 @@ |
107 |
+[Unit] |
108 |
+Description=Initialize storage subsystems (RAID, LVM, etc.) |
109 |
+DefaultDependencies=no |
110 |
+Conflicts=shutdown.target |
111 |
+After=cryptsetup.target fedora-storage-init.service |
112 |
+Before=local-fs.target shutdown.target |
113 |
+Wants=fedora-wait-storage.service |
114 |
+ConditionFileIsExecutable=|/sbin/lvm |
115 |
+ConditionFileIsExecutable=|/sbin/dmraid |
116 |
+ConditionPathExists=|/etc/multipath.conf |
117 |
+ |
118 |
+[Service] |
119 |
+ExecStart=/lib/systemd/fedora-storage-init |
120 |
+Type=oneshot |
121 |
+TimeoutSec=0 |
122 |
+RemainAfterExit=yes |
123 |
diff --git a/systemd/system/fedora-storage-init.service b/systemd/system/fedora-storage-init.service |
124 |
new file mode 100644 |
125 |
index 0000000..6d8e39f |
126 |
--- /dev/null |
127 |
+++ b/systemd/system/fedora-storage-init.service |
128 |
@@ -0,0 +1,16 @@ |
129 |
+[Unit] |
130 |
+Description=Initialize storage subsystems (RAID, LVM, etc.) |
131 |
+DefaultDependencies=no |
132 |
+Conflicts=shutdown.target |
133 |
+After=fedora-wait-storage.service |
134 |
+Before=local-fs.target shutdown.target |
135 |
+Wants=fedora-wait-storage.service |
136 |
+ConditionFileIsExecutable=|/sbin/lvm |
137 |
+ConditionFileIsExecutable=|/sbin/dmraid |
138 |
+ConditionPathExists=|/etc/multipath.conf |
139 |
+ |
140 |
+[Service] |
141 |
+ExecStart=/lib/systemd/fedora-storage-init |
142 |
+Type=oneshot |
143 |
+TimeoutSec=0 |
144 |
+RemainAfterExit=yes |
145 |
diff --git a/systemd/system/fedora-wait-storage.service b/systemd/system/fedora-wait-storage.service |
146 |
new file mode 100644 |
147 |
index 0000000..9d3b6ae |
148 |
--- /dev/null |
149 |
+++ b/systemd/system/fedora-wait-storage.service |
150 |
@@ -0,0 +1,18 @@ |
151 |
+[Unit] |
152 |
+Description=Wait for storage scan |
153 |
+DefaultDependencies=no |
154 |
+Conflicts=shutdown.target |
155 |
+After=systemd-udev-settle.service |
156 |
+Before=local-fs.target shutdown.target |
157 |
+Wants=systemd-udev-settle.service |
158 |
+ |
159 |
+[Service] |
160 |
+ExecStart=-/sbin/rmmod scsi_wait_scan |
161 |
+ExecStart=-/sbin/modprobe scsi_wait_scan |
162 |
+ExecStart=-/sbin/rmmod scsi_wait_scan |
163 |
+Type=oneshot |
164 |
+TimeoutSec=0 |
165 |
+RemainAfterExit=yes |
166 |
+StandardInput=null |
167 |
+StandardOutput=null |
168 |
+StandardError=null |
169 |
-- |
170 |
1.9.2 |
171 |
|