3
3
%global hv_vss_daemon hypervvssd
4
4
%global hv_fcopy_daemon hypervfcopyd
5
5
6
+ %global snapver .20180415git
7
+ %global udev_prefix 70
6
8
# nodebuginfo
7
9
# norootforbuild
8
10
@@ -16,30 +18,78 @@ License: GPLv2+
16
18
Summary: Microsoft hyper-v daemons
17
19
Version: 1
18
20
Release: 0.29%{?snapver }%{?dist }
19
- Source0: hv_kvp_daemon.c
20
- Source1: hypervkvpd.service
21
- Source2: hypervkvp.rules
22
- Source3: hv_get_dhcp_info.sh
23
- Source4: hv_get_dns_info.sh
24
- Source5: hv_set_ifconfig.sh
25
- Source6: hv_vss_daemon.c
26
- Source7: hypervvss.rules
27
- Source8: hypervvssd.service
28
- Source9: hv_fcopy_daemon.c
29
- Source10: hypervfcopy.rules
21
+ Source0: hv_kvp_daemon.c
22
+ Source1: hypervkvpd.service
23
+ Source2: hypervkvp.rules
24
+ Source3: hv_get_dhcp_info.sh
25
+ Source4: hv_get_dns_info.sh
26
+ Source5: hv_set_ifconfig.sh
27
+ Source6: hv_vss_daemon.c
28
+ Source7: hypervvss.rules
29
+ Source8: hypervvssd.service
30
+ Source9: hv_fcopy_daemon.c
31
+ Source10: hypervfcopy.rules
30
32
Source11: hypervfcopyd.service
31
- Source12: Makefile
33
+ Source12: Makefile
32
34
Source13: Build
33
35
BuildRoot: %{_tmppath }/%{name }-%{version }-build
34
36
Requires: kernel >= 3.10.0-123
35
- BuildRequires: systemd, kernel-headers
36
- Requires(post): systemd
37
- Requires(preun): systemd
38
- Requires(postun): systemd
39
-
37
+ Requires: hypervkvpd = %{version }-%{release }
38
+ Requires: hypervvssd = %{version }-%{release }
39
+ Requires: hypervfcopyd = %{version }-%{release }
40
+ BuildRequires: systemd, kernel-headers
40
41
41
42
%description
42
- Suite of daemons that are needed when Linux guest is running on Windows host with HyperV.
43
+ Suite of daemons that are needed when Linux guest is running on Windows host with HyperV.
44
+
45
+ %package -n hypervkvpd
46
+ Summary: HyperV key value pair (KVP) daemon
47
+ Group: System Environment/Daemons
48
+ Requires: kernel >= 3.10.0-123
49
+ BuildRequires: systemd, kernel-headers
50
+ Requires(post): systemd
51
+ Requires(preun): systemd
52
+ Requires(postun): systemd
53
+
54
+ %description -n hypervkvpd
55
+ Hypervkvpd is an implementation of HyperV key value pair (KVP)
56
+ functionality for Linux. The daemon first registers with the
57
+ kernel driver. After this is done it collects information
58
+ requested by Windows Host about the Linux Guest. It also supports
59
+ IP injection functionality on the Guest.
60
+
61
+ %package -n hypervvssd
62
+ Summary: HyperV VSS daemon
63
+ Group: System Environment/Daemons
64
+ Requires: kernel >= 3.10.0-123
65
+ BuildRequires: systemd, kernel-headers
66
+ Requires(post): systemd
67
+ Requires(preun): systemd
68
+ Requires(postun): systemd
69
+
70
+ %description -n hypervvssd
71
+ Hypervvssd is an implementation of HyperV VSS functionality
72
+ for Linux. The daemon is used for host initiated guest snapshot
73
+ on HyperV hypervisor. The daemon first registers with the
74
+ kernel driver. After this is done it waits for instructions
75
+ from Windows Host if to "freeze" or "thaw" the filesystem
76
+ on the Linux Guest.
77
+
78
+ %package -n hypervfcopyd
79
+ Summary: HyperV FCOPY daemon
80
+ Group: System Environment/Daemons
81
+ Requires: kernel >= 3.10.0-123
82
+ BuildRequires: systemd, kernel-headers
83
+ Requires(post): systemd
84
+ Requires(preun): systemd
85
+ Requires(postun): systemd
86
+
87
+ %description -n hypervfcopyd
88
+ Hypervfcopyd is an implementation of file copy service functionality
89
+ for Linux Guest running on HyperV. The daemon enables host to copy
90
+ a file (over VMBUS) into the Linux Guest. The daemon first registers
91
+ with the kernel driver. After this is done it waits for instructions
92
+ from Windows Host.
43
93
44
94
%prep
45
95
%setup -Tc
@@ -57,14 +107,15 @@ cp -pvL %{SOURCE10} %{hv_fcopy_daemon}.service
57
107
58
108
cp -pvL %{SOURCE12 } Makefile
59
109
if [ ! -e "%{SOURCE13 }" ]; then
60
- touch %{SOURCE13 }
110
+ touch %{SOURCE13 }
61
111
fi
62
112
cp -pvL %{SOURCE13 } Build
63
113
%build
64
114
make clean
65
115
make
66
116
67
117
%install
118
+ rm -rf %{buildroot }
68
119
69
120
mkdir -p %{buildroot }%{_sbindir }
70
121
install -p -m 0755 hv_kvp_daemon %{buildroot }%{_sbindir }/%{hv_kvp_daemon }
@@ -79,9 +130,9 @@ install -p -m 0644 %{SOURCE11} %{buildroot}%{_unitdir}
79
130
80
131
# Udev rules
81
132
mkdir -p %{buildroot }%{_udevrulesdir }
82
- install -p -m 0644 %{SOURCE2 } %{buildroot }%{_udevrulesdir }/%{udev_prefix }-70- hv_kvp.rules
83
- install -p -m 0644 %{SOURCE7 } %{buildroot }%{_udevrulesdir }/%{udev_prefix }-70- hv_vss.rules
84
- install -p -m 0644 %{SOURCE10 } %{buildroot }%{_udevrulesdir }/%{udev_prefix }-70- hv_fcopy.rules
133
+ install -p -m 0644 %{SOURCE2 } %{buildroot }%{_udevrulesdir }/%{udev_prefix }-hv_kvp.rules
134
+ install -p -m 0644 %{SOURCE7 } %{buildroot }%{_udevrulesdir }/%{udev_prefix }-hv_vss.rules
135
+ install -p -m 0644 %{SOURCE10 } %{buildroot }%{_udevrulesdir }/%{udev_prefix }-hv_fcopy.rules
85
136
86
137
# Shell scripts for the KVP daemon
87
138
mkdir -p %{buildroot }%{_libexecdir }/%{hv_kvp_daemon }
@@ -92,41 +143,67 @@ install -p -m 0755 %{SOURCE5} %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_set
92
143
# Directory for pool files
93
144
mkdir -p %{buildroot }%{_sharedstatedir }/hyperv
94
145
95
- %preun
96
- if [ $1 -eq 0 ]; then # package is being erased, not upgraded
97
- echo " Removing Package.."
98
- echo " Stopping KVP Daemon...."
99
- systemctl stop hypervkvpd
100
- echo " Stopping FCOPY Daemon...."
101
- systemctl stop hypervfcopyd
102
- echo " Stopping VSS Daemon...."
103
- systemctl stop hypervvssd
104
- rm -rf %{_sharedstatedir}/hyperv || :
146
+ %post -n hypervkvpd
147
+ if [ $1 -gt 1 ] ; then
148
+ # Upgrade
149
+ systemctl --no-reload disable hypervkvpd.service > /dev/null 2>&1 || :
105
150
fi
106
151
107
- %post
108
- if [ $1 > 1 ] ; then
109
- # Upgrade
110
- systemctl --no-reload disable hypervkvpd.service > /dev/null 2>&1 || :
111
- systemctl --no-reload disable hypervvssd.service > /dev/null 2>&1 || :
112
- systemctl --no-reload disable hypervfcopyd.service > /dev/null 2>&1 || :
113
- fi
152
+ %preun -n hypervkvpd
153
+ %systemd_preun hypervkvpd.service
114
154
115
- %postun
155
+ %postun -n hypervkvpd
156
+ # hypervkvpd daemon does NOT support restarting (driver, neither)
116
157
%systemd_postun hypervkvpd.service
158
+ # If removing the package, delete %%{_sharedstatedir}/hyperv directory
159
+ if [ " $1 " -eq " 0" ] ; then
160
+ rm -rf %{_sharedstatedir}/hyperv || :
161
+ fi
162
+
163
+
164
+ %post -n hypervvssd
165
+ if [ $1 -gt 1 ] ; then
166
+ # Upgrade
167
+ systemctl --no-reload disable hypervvssd.service > /dev/null 2>&1 || :
168
+ fi
169
+
170
+ %postun -n hypervvssd
117
171
%systemd_postun hypervvssd.service
172
+
173
+ %preun -n hypervvssd
174
+ %systemd_preun hypervvssd.service
175
+
176
+
177
+ %post -n hypervfcopyd
178
+ if [ $1 -gt 1 ] ; then
179
+ # Upgrade
180
+ systemctl --no-reload disable hypervfcopyd.service > /dev/null 2>&1 || :
181
+ fi
182
+
183
+ %postun -n hypervfcopyd
118
184
%systemd_postun hypervfcopyd.service
119
185
186
+ %preun -n hypervfcopyd
187
+ %systemd_preun hypervfcopyd.service
188
+
189
+
120
190
%files
191
+ # the base package does not contain any files.
192
+
193
+ %files -n hypervkvpd
121
194
%{_sbindir }/%{hv_kvp_daemon }
122
195
%{_unitdir }/hypervkvpd.service
123
- %{_udevrulesdir }/%{udev_prefix }-70- hv_kvp.rules
196
+ %{_udevrulesdir }/%{udev_prefix }-hv_kvp.rules
124
197
%dir %{_libexecdir }/%{hv_kvp_daemon }
125
198
%{_libexecdir }/%{hv_kvp_daemon }/*
126
199
%dir %{_sharedstatedir }/hyperv
200
+
201
+ %files -n hypervvssd
127
202
%{_sbindir }/%{hv_vss_daemon }
128
203
%{_unitdir }/hypervvssd.service
129
- %{_udevrulesdir }/%{udev_prefix }-70-hv_vss.rules
204
+ %{_udevrulesdir }/%{udev_prefix }-hv_vss.rules
205
+
206
+ %files -n hypervfcopyd
130
207
%{_sbindir }/%{hv_fcopy_daemon }
131
208
%{_unitdir }/hypervfcopyd.service
132
- %{_udevrulesdir }/%{udev_prefix }-70- hv_fcopy.rules
209
+ %{_udevrulesdir }/%{udev_prefix }-hv_fcopy.rules
0 commit comments