129194
# HyperV KVP daemon binary name
129194
%global hv_kvp_daemon hypervkvpd
129194
# HyperV VSS daemon binary name
129194
%global hv_vss_daemon hypervvssd
129194
# HyperV FCOPY daemon binary name
129194
%global hv_fcopy_daemon hypervfcopyd
129194
# snapshot version
129194
%global snapver .20180415git
129194
# use hardened build
129194
%global _hardened_build 1
129194
# udev rules prefix
129194
%global udev_prefix 70
129194
129194
Name:     hyperv-daemons
129194
Version:  0
129194
Release:  0.34%{?snapver}%{?dist}
129194
Summary:  HyperV daemons suite
129194
129194
Group:    System Environment/Daemons
129194
License:  GPLv2
129194
URL:      http://www.kernel.org
129194
129194
# Source files obtained from kernel upstream v4.17-rc1
129194
Source0:  COPYING
129194
129194
# HYPERV KVP DAEMON
129194
Source1:  hv_kvp_daemon.c
129194
Source2:  hv_get_dhcp_info.sh
129194
Source3:  hv_get_dns_info.sh
129194
Source4:  hv_set_ifconfig.sh
129194
Source5:  hypervkvpd.service
129194
Source6:  hypervkvp.rules
129194
129194
# HYPERV VSS DAEMON
129194
Source100:  hv_vss_daemon.c
129194
Source101:  hypervvssd.service
129194
Source102:  hypervvss.rules
129194
129194
# HYPERV FCOPY DAEMON
129194
Source200:  hv_fcopy_daemon.c
129194
Source201:  hypervfcopyd.service
129194
Source202:  hypervfcopy.rules
129194
129194
# HYPERV TOOLS
129194
Source301:  lsvmbus
129194
129194
# rhbz#1577692
129194
Patch1:  0001-Tools-hv-vss-fix-loop-device-detection.patch
129194
129194
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
129194
# HyperV is available only on x86 architectures
129194
ExclusiveArch:  x86_64
129194
Requires:       hypervkvpd = %{version}-%{release}
129194
Requires:       hypervvssd = %{version}-%{release}
129194
Requires:       hypervfcopyd = %{version}-%{release}
129194
129194
%description
129194
Suite of daemons that are needed when Linux guest
129194
is running on Windows Host with HyperV.
129194
129194
129194
%package -n hypervkvpd
129194
Summary: HyperV key value pair (KVP) daemon
129194
Group:   System Environment/Daemons
129194
Requires: %{name}-license = %{version}-%{release}
129194
Requires: kernel >= 3.10.0-384.el7
129194
BuildRequires: systemd, kernel-headers
129194
Requires(post):   systemd
129194
Requires(preun):  systemd
129194
Requires(postun): systemd
129194
129194
%description -n hypervkvpd
129194
Hypervkvpd is an implementation of HyperV key value pair (KVP) 
129194
functionality for Linux. The daemon first registers with the
129194
kernel driver. After this is done it collects information 
129194
requested by Windows Host about the Linux Guest. It also supports
129194
IP injection functionality on the Guest.
129194
129194
129194
%package -n hypervvssd
129194
Summary: HyperV VSS daemon
129194
Group:   System Environment/Daemons
129194
Requires: %{name}-license = %{version}-%{release}
129194
Requires: kernel >= 3.10.0-384.el7
129194
BuildRequires: systemd, kernel-headers
129194
Requires(post):   systemd
129194
Requires(preun):  systemd
129194
Requires(postun): systemd
129194
Conflicts: selinux-policy < 3.13.1-197.el7
129194
129194
%description -n hypervvssd
129194
Hypervvssd is an implementation of HyperV VSS functionality
129194
for Linux. The daemon is used for host initiated guest snapshot
129194
on HyperV hypervisor. The daemon first registers with the
129194
kernel driver. After this is done it waits for instructions 
129194
from Windows Host if to "freeze" or "thaw" the filesystem
129194
on the Linux Guest.
129194
129194
129194
%package -n hypervfcopyd
129194
Summary: HyperV FCOPY daemon
129194
Group:   System Environment/Daemons
129194
Requires: %{name}-license = %{version}-%{release}
129194
Requires: kernel >= 3.10.0-384.el7
129194
BuildRequires: systemd, kernel-headers
129194
Requires(post):   systemd
129194
Requires(preun):  systemd
129194
Requires(postun): systemd
129194
129194
%description -n hypervfcopyd
129194
Hypervfcopyd is an implementation of file copy service functionality
129194
for Linux Guest running on HyperV. The daemon enables host to copy
129194
a file (over VMBUS) into the Linux Guest. The daemon first registers
129194
with the kernel driver. After this is done it waits for instructions 
129194
from Windows Host.
129194
129194
129194
%package license
129194
Summary:    License of the HyperV daemons suite
129194
Group:      Applications/System
129194
BuildArch:  noarch
129194
129194
%description license
129194
Contains license of the HyperV daemons suite.
129194
129194
%package -n hyperv-tools
129194
Summary:    Tools for Hyper-V guests
129194
Group:      Applications/System
129194
BuildArch:  noarch
129194
129194
%description -n hyperv-tools
129194
Contains tools and scripts useful for Hyper-V guests.
129194
129194
%prep
129194
%setup -Tc
129194
cp -pvL %{SOURCE0} COPYING
129194
129194
cp -pvL %{SOURCE1} hv_kvp_daemon.c
129194
cp -pvL %{SOURCE2} hv_get_dhcp_info.sh
129194
cp -pvL %{SOURCE3} hv_get_dns_info.sh
129194
cp -pvL %{SOURCE4} hv_set_ifconfig.sh
129194
cp -pvL %{SOURCE5} hypervkvpd.service
129194
129194
cp -pvL %{SOURCE100} hv_vss_daemon.c
129194
cp -pvL %{SOURCE101} hypervvssd.service
129194
129194
cp -pvL %{SOURCE200} hv_fcopy_daemon.c
129194
cp -pvL %{SOURCE201} hypervfcopyd.service
129194
129194
%patch1 -p3 -b .vss_fix_loop_detect
129194
129194
%build
129194
# HYPERV KVP DAEMON
129194
gcc \
129194
    $RPM_OPT_FLAGS \
129194
    -c hv_kvp_daemon.c
129194
    
129194
gcc \
129194
    $RPM_LD_FLAGS \
129194
    hv_kvp_daemon.o \
129194
    -o %{hv_kvp_daemon}
129194
129194
# HYPERV VSS DAEMON
129194
gcc \
129194
    $RPM_OPT_FLAGS \
129194
    -c hv_vss_daemon.c
129194
    
129194
gcc \
129194
    $RPM_LD_FLAGS \
129194
    hv_vss_daemon.o \
129194
    -o %{hv_vss_daemon}
129194
129194
# HYPERV FCOPY DAEMON
129194
gcc \
129194
    $RPM_OPT_FLAGS \
129194
    -c hv_fcopy_daemon.c
129194
    
129194
gcc \
129194
    $RPM_LD_FLAGS \
129194
    hv_fcopy_daemon.o \
129194
    -o %{hv_fcopy_daemon}
129194
129194
129194
%install
129194
rm -rf %{buildroot}
129194
129194
mkdir -p %{buildroot}%{_sbindir}
129194
install -p -m 0755 %{hv_kvp_daemon} %{buildroot}%{_sbindir}
129194
install -p -m 0755 %{hv_vss_daemon} %{buildroot}%{_sbindir}
129194
install -p -m 0755 %{hv_fcopy_daemon} %{buildroot}%{_sbindir}
129194
# Systemd unit file
129194
mkdir -p %{buildroot}%{_unitdir}
129194
install -p -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}
129194
install -p -m 0644 %{SOURCE101} %{buildroot}%{_unitdir}
129194
install -p -m 0644 %{SOURCE201} %{buildroot}%{_unitdir}
129194
# Udev rules
129194
mkdir -p %{buildroot}%{_udevrulesdir}
129194
install -p -m 0644 %{SOURCE6} %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
129194
install -p -m 0644 %{SOURCE102} %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
129194
install -p -m 0644 %{SOURCE202} %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
129194
# Shell scripts for the KVP daemon
129194
mkdir -p %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}
129194
install -p -m 0755 %{SOURCE2} %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dhcp_info
129194
install -p -m 0755 %{SOURCE3} %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dns_info
129194
install -p -m 0755 %{SOURCE4} %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_set_ifconfig
129194
# Directory for pool files
129194
mkdir -p %{buildroot}%{_sharedstatedir}/hyperv
129194
129194
# Tools
129194
install -p -m 0755 %{SOURCE301} %{buildroot}%{_sbindir}/
129194
129194
mkdir -p %{buildroot}%{_datarootdir}/hyperv-tools/
129194
129194
%post -n hypervkvpd
129194
if [ $1 -gt 1 ] ; then
129194
	# Upgrade
129194
	systemctl --no-reload disable hypervkvpd.service >/dev/null 2>&1 || :
129194
fi
129194
129194
%preun -n hypervkvpd
129194
%systemd_preun hypervkvpd.service
129194
129194
%postun -n hypervkvpd
129194
# hypervkvpd daemon does NOT support restarting (driver, neither)
129194
%systemd_postun hypervkvpd.service
129194
# If removing the package, delete %%{_sharedstatedir}/hyperv directory
129194
if [ "$1" -eq "0" ] ; then
129194
    rm -rf %{_sharedstatedir}/hyperv || :
129194
fi
129194
129194
129194
%post -n hypervvssd
129194
if [ $1 -gt 1 ] ; then
129194
	# Upgrade
129194
	systemctl --no-reload disable hypervvssd.service >/dev/null 2>&1 || :
129194
fi
129194
129194
%postun -n hypervvssd
129194
%systemd_postun hypervvssd.service
129194
129194
%preun -n hypervvssd
129194
%systemd_preun hypervvssd.service
129194
129194
129194
%post -n hypervfcopyd
129194
if [ $1 -gt 1 ] ; then
129194
	# Upgrade
129194
	systemctl --no-reload disable hypervfcopyd.service >/dev/null 2>&1 || :
129194
fi
129194
129194
%postun -n hypervfcopyd
129194
%systemd_postun hypervfcopyd.service
129194
129194
%preun -n hypervfcopyd
129194
%systemd_preun hypervfcopyd.service
129194
129194
129194
%files
129194
# the base package does not contain any files.
129194
129194
%files -n hypervkvpd
129194
%{_sbindir}/%{hv_kvp_daemon}
129194
%{_unitdir}/hypervkvpd.service
129194
%{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
129194
%dir %{_libexecdir}/%{hv_kvp_daemon}
129194
%{_libexecdir}/%{hv_kvp_daemon}/*
129194
%dir %{_sharedstatedir}/hyperv
129194
129194
%files -n hypervvssd
129194
%{_sbindir}/%{hv_vss_daemon}
129194
%{_unitdir}/hypervvssd.service
129194
%{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
129194
129194
%files -n hypervfcopyd
129194
%{_sbindir}/%{hv_fcopy_daemon}
129194
%{_unitdir}/hypervfcopyd.service
129194
%{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
129194
129194
%files license
129194
%doc COPYING
129194
129194
%files -n hyperv-tools
129194
%{_sbindir}/lsvmbus
129194
%{_datarootdir}/hyperv-tools
129194
129194
%changelog
129194
* Mon Jun 18 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.34.20180415git
129194
- Skip freezing filesystems backed by loop upstream patches (#1577692)
129194
129194
* Thu Apr 19 2018 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.33.20180415git
129194
- Update to upstream v4.17-rc1, drop no longer needed bondvf.sh script
129194
- Fix KVP with SR-IOV (#1567022)
129194
129194
* Wed Jan 03 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.32.20161211git
129194
- Include 'Avoid reading past allocated blocks from KVP file' fix (#1529745)
129194
129194
* Mon Dec 11 2017 Eduardo Otubo <otubo@redhat.com> - 0-0.31.20161211git
129194
- Start KVP daemon after network is setup (#1377550)
129194
129194
* Thu Jan 19 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.30.20161211git
129194
- Use '-gt' instead of '>' to do the right comparison (#1414822)
129194
- hyperv-tools subpackage added (#1378710)
129194
- Update to upstream v4.9 (#1406397)
129194
129194
* Tue Aug 16 2016 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.29.20150216git
129194
- Switch units to udev-only activation (#1367240)
129194
129194
* Wed Jun 22 2016 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.28.20150216git
129194
- Close /dev/vmbus/hv_kvp fd on popen (#1347659)
129194
129194
* Fri May 15 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.27.20150216git
129194
- 2016-02-16 git snapshot
129194
- Add udev rules to support host-side activation (#1304005)
129194
129194
* Fri May 15 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.26.20150402git
129194
- 2015-04-02 git snapshot
129194
- VSS: skip all readonly-mounted filesystems (#1160584)
129194
- VSS: support partitions mounted several times (#1169724)
129194
129194
* Thu Oct 9 2014 Matej Muzila <mmuzila@redhat.com> - 0-0.25.20141008git
129194
- Daemons updated to the last git snapshot
129194
- Use kernel-headers instead of kernel-devel to build
129194
- Added Hyper-V fcopy daemon as hypervfcopyd subpackage
129194
129194
* Mon Feb 17 2014 Tomas Hozza <thozza@redhat.com> - 0-0.24.20130826git
129194
- VSS: Ignore VFAT mounts on freeze/thaw (#1064094)
129194
129194
* Fri Jan 10 2014 Tomas Hozza <thozza@redhat.com> - 0-0.23.20130826git
129194
- Provide 'hyperv-daemons' package for convenient installation of all daemons (#1051450)
129194
129194
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 0-0.22.20130826git
129194
- Mass rebuild 2013-12-27
129194
129194
* Thu Sep 26 2013 Tomas Hozza <thozza@redhat.com> - 0-0.21.20130826git
129194
- Use 'hypervkvpd' directory in libexec for KVP daemon scripts (#1010280)
129194
- daemons are now WantedBy multi-user.target instead of basic.target (#1010284)
129194
129194
* Mon Sep 23 2013 Tomas Hozza <thozza@redhat.com> - 0-0.20.20130826git
129194
- Build daemons only for x86_64 architecture (#1010220)
129194
- Bump release to 20 to prevent RHEL6 -> RHEL7 update path issues
129194
129194
* Mon Aug 26 2013 Tomas Hozza <thozza@redhat.com> - 0-0.1.20130826git
129194
- Initial package