Blame SPECS/hyperv-daemons.spec

146f51
# Hyper-V KVP daemon binary name
146f51
%global hv_kvp_daemon hypervkvpd
146f51
# Hyper-V VSS daemon binary name
146f51
%global hv_vss_daemon hypervvssd
146f51
# Hyper-V FCOPY daemon binary name
146f51
%global hv_fcopy_daemon hypervfcopyd
146f51
# snapshot version
146f51
%global snapver .20180415git
146f51
# use hardened build
146f51
%global _hardened_build 1
146f51
# udev rules prefix
146f51
%global udev_prefix 70
146f51
146f51
Name:     hyperv-daemons
146f51
Version:  0
8d7d92
Release:  0.29%{?snapver}%{?dist}
146f51
Summary:  Hyper-V daemons suite
146f51
146f51
Group:    System Environment/Daemons
146f51
License:  GPLv2
146f51
URL:      http://www.kernel.org
146f51
146f51
# Source files obtained from kernel upstream 4.17-rc1 (60cc43fc888428bb2f18f08997432d426a243338)
146f51
# git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
146f51
Source0:  COPYING
146f51
146f51
# HYPERV KVP DAEMON
146f51
Source1:  hv_kvp_daemon.c
146f51
Source2:  hv_get_dhcp_info.sh
146f51
Source3:  hv_get_dns_info.sh
146f51
Source4:  hv_set_ifconfig.sh
146f51
Source5:  hypervkvpd.service
146f51
Source6:  hypervkvp.rules
146f51
146f51
# HYPERV VSS DAEMON
146f51
Source100:  hv_vss_daemon.c
146f51
Source101:  hypervvssd.service
146f51
Source102:  hypervvss.rules
146f51
146f51
# HYPERV FCOPY DAEMON
146f51
Source200:  hv_fcopy_daemon.c
146f51
Source201:  hypervfcopyd.service
146f51
Source202:  hypervfcopy.rules
146f51
146f51
# HYPERV TOOLS
146f51
Source301:  lsvmbus
146f51
146f51
# Make lsvmbus Python3 compatible
146f51
Patch0: 0001-tools-hv-update-lsvmbus-to-be-compatible-with-python.patch
146f51
146f51
# Do not set NM_CONTROLED=no
146f51
Patch1: 0002-hv_set_ifconfig_nm_enable.patch
d7bfd7
# For bz#1769920 - [Hyper-V][RHEL8] Running 'systemctl isolate' on any target stops hyperv-daemon services
d7bfd7
Patch2: hpvd-Set-IgnoreOnIsolate-1-in-systemd-units.patch
8d7d92
# For bz#1816750 - [Hyper-V][RHEL8.3] Update Hyper-V tools
8d7d92
Patch3: hvd-Update-C-files-and-scripts-to-kernel-version-5.7-rc1.patch
8d7d92
# For bz#1816750 - [Hyper-V][RHEL8.3] Update Hyper-V tools
8d7d92
Patch4: hvd-Add-vmbus_testing-tool-build-files.patch
146f51
146f51
# Hyper-V is available only on x86 architectures
146f51
# The base empty (a.k.a. virtual) package can not be noarch
146f51
# due to http://www.rpm.org/ticket/78
146f51
ExclusiveArch:  i686 x86_64
146f51
146f51
Requires:       hypervkvpd = %{version}-%{release}
146f51
Requires:       hypervvssd = %{version}-%{release}
146f51
Requires:       hypervfcopyd = %{version}-%{release}
146f51
BuildRequires:  gcc
146f51
146f51
%description
146f51
Suite of daemons that are needed when Linux guest
146f51
is running on Windows Host with Hyper-V.
146f51
146f51
146f51
%package -n hypervkvpd
146f51
Summary: Hyper-V key value pair (KVP) daemon
146f51
Group:   System Environment/Daemons
146f51
Requires: %{name}-license = %{version}-%{release}
146f51
BuildRequires: systemd, kernel-headers
146f51
Requires(post):   systemd
146f51
Requires(preun):  systemd
146f51
Requires(postun): systemd
146f51
146f51
%description -n hypervkvpd
146f51
Hypervkvpd is an implementation of Hyper-V key value pair (KVP)
146f51
functionality for Linux. The daemon first registers with the
146f51
kernel driver. After this is done it collects information
146f51
requested by Windows Host about the Linux Guest. It also supports
146f51
IP injection functionality on the Guest.
146f51
146f51
146f51
%package -n hypervvssd
146f51
Summary: Hyper-V VSS daemon
146f51
Group:   System Environment/Daemons
146f51
Requires: %{name}-license = %{version}-%{release}
146f51
BuildRequires: systemd, kernel-headers
146f51
Requires(post):   systemd
146f51
Requires(preun):  systemd
146f51
Requires(postun): systemd
146f51
146f51
%description -n hypervvssd
146f51
Hypervvssd is an implementation of Hyper-V VSS functionality
146f51
for Linux. The daemon is used for host initiated guest snapshot
146f51
on Hyper-V hypervisor. The daemon first registers with the
146f51
kernel driver. After this is done it waits for instructions
146f51
from Windows Host if to "freeze" or "thaw" the filesystem
146f51
on the Linux Guest.
146f51
146f51
146f51
%package -n hypervfcopyd
146f51
Summary: Hyper-V FCOPY daemon
146f51
Group:   System Environment/Daemons
146f51
Requires: %{name}-license = %{version}-%{release}
146f51
BuildRequires: systemd, kernel-headers
146f51
Requires(post):   systemd
146f51
Requires(preun):  systemd
146f51
Requires(postun): systemd
146f51
146f51
%description -n hypervfcopyd
146f51
Hypervfcopyd is an implementation of file copy service functionality
146f51
for Linux Guest running on Hyper-V. The daemon enables host to copy
146f51
a file (over VMBUS) into the Linux Guest. The daemon first registers
146f51
with the kernel driver. After this is done it waits for instructions
146f51
from Windows Host.
146f51
146f51
146f51
%package license
146f51
Summary:    License of the Hyper-V daemons suite
146f51
Group:      Applications/System
146f51
BuildArch:  noarch
146f51
146f51
%description license
146f51
Contains license of the Hyper-V daemons suite.
146f51
146f51
%package -n hyperv-tools
146f51
Summary:    Tools for Hyper-V guests
146f51
Group:      Applications/System
146f51
BuildArch:  noarch
146f51
146f51
%description -n hyperv-tools
146f51
Contains tools and scripts useful for Hyper-V guests.
146f51
146f51
%prep
146f51
%setup -Tc
146f51
cp -pvL %{SOURCE0} COPYING
146f51
146f51
cp -pvL %{SOURCE1} hv_kvp_daemon.c
d7bfd7
cp -pvL %{SOURCE2} hv_get_dhcp_info.sh
d7bfd7
cp -pvL %{SOURCE3} hv_get_dns_info.sh
d7bfd7
cp -pvL %{SOURCE4} hv_set_ifconfig.sh
d7bfd7
cp -pvL %{SOURCE5} hypervkvpd.service
d7bfd7
cp -pvL %{SOURCE6} hypervkvp.rules
146f51
cp -pvL %{SOURCE100} hv_vss_daemon.c
d7bfd7
cp -pvL %{SOURCE101} hypervvssd.service
d7bfd7
cp -pvL %{SOURCE102} hypervvss.rules
146f51
cp -pvL %{SOURCE200} hv_fcopy_daemon.c
d7bfd7
cp -pvL %{SOURCE201} hypervfcopyd.service
d7bfd7
cp -pvL %{SOURCE202} hypervfcopy.rules
146f51
146f51
cp -pvL %{SOURCE301} lsvmbus
146f51
%patch0 -p3 -b .lsvmbus_python3
146f51
146f51
cp -pvL %{SOURCE4} hv_set_ifconfig.sh
146f51
%patch1 -p0 -b .hv_set_ifconfig_nm_enable
d7bfd7
%patch2 -p1
8d7d92
%patch3 -p1
8d7d92
%patch4 -p1
146f51
146f51
%build
146f51
# HYPERV KVP DAEMON
146f51
gcc $RPM_OPT_FLAGS -c hv_kvp_daemon.c
146f51
gcc $RPM_LD_FLAGS  hv_kvp_daemon.o -o %{hv_kvp_daemon}
146f51
146f51
# HYPERV VSS DAEMON
146f51
gcc $RPM_OPT_FLAGS -c hv_vss_daemon.c
146f51
gcc $RPM_LD_FLAGS hv_vss_daemon.o -o %{hv_vss_daemon}
146f51
146f51
# HYPERV FCOPY DAEMON
146f51
gcc $RPM_OPT_FLAGS -c hv_fcopy_daemon.c
146f51
gcc $RPM_LD_FLAGS hv_fcopy_daemon.o -o %{hv_fcopy_daemon}
146f51
146f51
%install
146f51
rm -rf %{buildroot}
146f51
146f51
mkdir -p %{buildroot}%{_sbindir}
146f51
install -p -m 0755 %{hv_kvp_daemon} %{buildroot}%{_sbindir}
146f51
install -p -m 0755 %{hv_vss_daemon} %{buildroot}%{_sbindir}
146f51
install -p -m 0755 %{hv_fcopy_daemon} %{buildroot}%{_sbindir}
146f51
# Systemd unit file
146f51
mkdir -p %{buildroot}%{_unitdir}
d7bfd7
install -p -m 0644 hypervkvpd.service %{buildroot}%{_unitdir}
d7bfd7
install -p -m 0644 hypervvssd.service %{buildroot}%{_unitdir}
d7bfd7
install -p -m 0644 hypervfcopyd.service %{buildroot}%{_unitdir}
146f51
# Udev rules
146f51
mkdir -p %{buildroot}%{_udevrulesdir}
d7bfd7
install -p -m 0644 hypervkvp.rules %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
d7bfd7
install -p -m 0644 hypervvss.rules %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
d7bfd7
install -p -m 0644 hypervfcopy.rules %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
146f51
# Shell scripts for the KVP daemon
146f51
mkdir -p %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}
d7bfd7
install -p -m 0755 hv_get_dhcp_info.sh %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dhcp_info
d7bfd7
install -p -m 0755 hv_get_dns_info.sh %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dns_info
146f51
install -p -m 0755 hv_set_ifconfig.sh %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_set_ifconfig
146f51
# Directory for pool files
146f51
mkdir -p %{buildroot}%{_sharedstatedir}/hyperv
146f51
146f51
# Tools
146f51
install -p -m 0755 lsvmbus %{buildroot}%{_sbindir}/
146f51
sed -i 's,#!/usr/bin/env python,#!%{__python3},' %{buildroot}%{_sbindir}/lsvmbus
8d7d92
install -p -m 0755 vmbus_testing %{buildroot}%{_sbindir}/
146f51
146f51
%post -n hypervkvpd
146f51
if [ $1 -gt 1 ] ; then
146f51
	# Upgrade
146f51
	systemctl --no-reload disable hypervkvpd.service >/dev/null 2>&1 || :
146f51
fi
146f51
146f51
%preun -n hypervkvpd
146f51
%systemd_preun hypervkvpd.service
146f51
146f51
%postun -n hypervkvpd
146f51
# hypervkvpd daemon does NOT support restarting (driver, neither)
146f51
%systemd_postun hypervkvpd.service
146f51
# If removing the package, delete %%{_sharedstatedir}/hyperv directory
146f51
if [ "$1" -eq "0" ] ; then
146f51
    rm -rf %{_sharedstatedir}/hyperv || :
146f51
fi
146f51
146f51
146f51
%post -n hypervvssd
146f51
if [ $1 -gt 1 ] ; then
146f51
	# Upgrade
146f51
	systemctl --no-reload disable hypervvssd.service >/dev/null 2>&1 || :
146f51
fi
146f51
146f51
%postun -n hypervvssd
146f51
%systemd_postun hypervvssd.service
146f51
146f51
%preun -n hypervvssd
146f51
%systemd_preun hypervvssd.service
146f51
146f51
146f51
%post -n hypervfcopyd
146f51
if [ $1 -gt 1 ] ; then
146f51
	# Upgrade
146f51
	systemctl --no-reload disable hypervfcopyd.service >/dev/null 2>&1 || :
146f51
fi
146f51
146f51
%postun -n hypervfcopyd
146f51
%systemd_postun hypervfcopyd.service
146f51
146f51
%preun -n hypervfcopyd
146f51
%systemd_preun hypervfcopyd.service
146f51
146f51
146f51
%files
146f51
# the base package does not contain any files.
146f51
146f51
%files -n hypervkvpd
146f51
%{_sbindir}/%{hv_kvp_daemon}
146f51
%{_unitdir}/hypervkvpd.service
146f51
%{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
146f51
%dir %{_libexecdir}/%{hv_kvp_daemon}
146f51
%{_libexecdir}/%{hv_kvp_daemon}/*
146f51
%dir %{_sharedstatedir}/hyperv
146f51
146f51
%files -n hypervvssd
146f51
%{_sbindir}/%{hv_vss_daemon}
146f51
%{_unitdir}/hypervvssd.service
146f51
%{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
146f51
146f51
%files -n hypervfcopyd
146f51
%{_sbindir}/%{hv_fcopy_daemon}
146f51
%{_unitdir}/hypervfcopyd.service
146f51
%{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
146f51
146f51
%files license
146f51
%doc COPYING
146f51
146f51
%files -n hyperv-tools
146f51
%{_sbindir}/lsvmbus
8d7d92
%{_sbindir}/vmbus_testing
146f51
146f51
%changelog
8d7d92
* Wed Apr 15 2020 Miroslav Rezanina <mrezanin@redhat.com> - 0-0.29.20180415git.el8
8d7d92
- hvd-Update-C-files-and-scripts-to-kernel-version-5.7-rc1.patch [bz#1816750]
8d7d92
- hvd-Add-vmbus_testing-tool-build-files.patch [bz#1816750]
8d7d92
- Resolves: bz#1816750
8d7d92
  ([Hyper-V][RHEL8.3] Update Hyper-V tools)
8d7d92
d7bfd7
* Tue Nov 19 2019 Miroslav Rezanina <mrezanin@redhat.com> - 0-0.28.20180415git.el8
d7bfd7
- hpvd-Set-IgnoreOnIsolate-1-in-systemd-units.patch [bz#1769920]
d7bfd7
- Resolves: bz#1769920
d7bfd7
  ([Hyper-V][RHEL8] Running 'systemctl isolate' on any target stops hyperv-daemon services)
d7bfd7
146f51
* Mon Sep 03 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.27.20180415git
146f51
- Do not set NM_CONTROLLED=no (#1624355)
146f51
146f51
* Wed Aug 01 2018 Charalampos Stratakis <cstratak@redhat.com> - 0-0.26.20180415git
146f51
- Fix python shebangs
146f51
146f51
* Mon Jun 11 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.25.20180415git
146f51
- Switch lsvmbus to Python3
146f51
146f51
* Thu Apr 26 2018 Tomas Hozza <thozza@redhat.com> - 0-0.24.20180415git
146f51
- Added gcc as an explicit BuildRequires
146f51
146f51
* Thu Apr 19 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.23.20180415git
146f51
- Rebase to 4.17-rc1
146f51
146f51
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.22.20170105git
146f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
146f51
146f51
* Mon Dec 11 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.21.20170105git
146f51
- Rebase to 4.15-rc2, drop fedora patches as changes are upstream
146f51
- Start kvpd after network.target
146f51
146f51
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.20.20170105git
146f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
146f51
146f51
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.19.20170105git
146f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
146f51
146f51
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.18.20170105git
146f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
146f51
146f51
* Wed Jan 11 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.17.20160728git
146f51
- Use '-gt' instead of '>' to do the right comparison (#1412033)
146f51
146f51
* Thu Jan 05 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.16.20160728git
146f51
- Rebase to 4.9
146f51
- hyperv-tools subpackage added
146f51
146f51
* Thu Jul 28 2016 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.15.20160728git
146f51
- Rebase to 4.8-rc0 (20160728 git snapshot)
146f51
- Disable services and remove ConditionVirtualization, multi-user.target
146f51
  dependencies switching to udev-only activation (#1331577)
146f51
146f51
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.14.20150702git
146f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
146f51
146f51
* Wed Nov 18 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.13.20150702git
146f51
- Add udev rules to properly restart services (#1195029)
146f51
- Spec cleanup
146f51
146f51
* Thu Jul 02 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.12.20150702git
146f51
- Rebase to 4.2-rc0 (20150702 git snapshot)
146f51
- Switch to new chardev-based communication layer (#1195029)
146f51
146f51
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.11.20150108git
146f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
146f51
146f51
* Thu Jan 08 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.10.20150108git
146f51
- Rebase to 3.19-rc3 (20150108 git snapshot)
146f51
- Drop 'nodaemon' patches, use newly introduced '-n' option
146f51
146f51
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.9.20140714git
146f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
146f51
146f51
* Mon Jul 14 2014 Tomas Hozza <thozza@redhat.com> - 0-0.8.20140714git
146f51
- Update the File copy daemon to the latest git snapshot
146f51
- Fix hyperfcopyd.service to check for /dev/vmbus/hv_fcopy
146f51
146f51
* Wed Jun 11 2014 Tomas Hozza <thozza@redhat.com> - 0-0.7.20140611git
146f51
- Fix FTBFS (#1106781)
146f51
- Use kernel-headers instead of kernel-devel for building
146f51
- package new Hyper-V fcopy daemon as hypervfcopyd sub-package
146f51
146f51
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.6.20140219git
146f51
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
146f51
146f51
* Wed Feb 19 2014 Tomas Hozza <thozza@redhat.com> - 0-0.5.20140219git
146f51
- rebase to the latest git snapshot next-20140219
146f51
  - KVP, VSS: removed inclusion of linux/types.h
146f51
  - VSS: Ignore VFAT mounts during freeze operation
146f51
146f51
* Fri Jan 10 2014 Tomas Hozza <thozza@redhat.com> - 0-0.4.20131022git
146f51
- provide 'hyperv-daemons' package for convenient installation of all daemons
146f51
146f51
* Tue Oct 22 2013 Tomas Hozza <thozza@redhat.com> - 0-0.3.20131022git
146f51
- rebase to the latest git snapshot next-20130927 (obtained 2013-10-22)
146f51
  - KVP, VSS: daemon use single buffer for send/recv
146f51
  - KVP: FQDN is obtained on start and cached
146f51
146f51
* Fri Sep 20 2013 Tomas Hozza <thozza@redhat.com> - 0-0.2.20130826git
146f51
- Use 'hypervkvpd' directory in libexec for KVP daemon scripts (#1010268)
146f51
- daemons are now WantedBy multi-user.target instead of basic.target (#1010260)
146f51
146f51
* Mon Aug 26 2013 Tomas Hozza <thozza@redhat.com> - 0-0.1.20130826git
146f51
- Initial package