Blame SPECS/hyperv-daemons.spec

8042be
# Hyper-V KVP daemon binary name
8042be
%global hv_kvp_daemon hypervkvpd
8042be
# Hyper-V VSS daemon binary name
8042be
%global hv_vss_daemon hypervvssd
8042be
# Hyper-V FCOPY daemon binary name
8042be
%global hv_fcopy_daemon hypervfcopyd
8042be
# snapshot version
8042be
%global snapver .20190303git
8042be
# use hardened build
8042be
%global _hardened_build 1
8042be
# udev rules prefix
8042be
%global udev_prefix 70
8042be
8042be
Name:     hyperv-daemons
8042be
Version:  0
8042be
Release:  0.39%{?snapver}%{?dist}
8042be
Summary:  Hyper-V daemons suite
8042be
8042be
License:  GPLv2
8042be
URL:      http://www.kernel.org
8042be
8042be
# Source files obtained from kernel upstream 4.17-rc1 (60cc43fc888428bb2f18f08997432d426a243338)
8042be
# git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
8042be
Source0:  COPYING
8042be
8042be
# HYPERV KVP DAEMON
8042be
Source1:  hv_kvp_daemon.c
8042be
Source2:  hv_get_dhcp_info.sh
8042be
Source3:  hv_get_dns_info.sh
8042be
Source4:  hv_set_ifconfig.sh
8042be
Source5:  hypervkvpd.service
8042be
Source6:  hypervkvp.rules
8042be
8042be
# HYPERV VSS DAEMON
8042be
Source100:  hv_vss_daemon.c
8042be
Source101:  hypervvssd.service
8042be
Source102:  hypervvss.rules
8042be
8042be
# HYPERV FCOPY DAEMON
8042be
Source200:  hv_fcopy_daemon.c
8042be
Source201:  hypervfcopyd.service
8042be
Source202:  hypervfcopy.rules
8042be
8042be
# HYPERV TOOLS
8042be
Source301:  lsvmbus
8042be
8042be
Patch0002: 0002-Do-not-set-NM_CONTROLLED-no.patch
8042be
Patch0004: 0004-Update-C-files-and-scripts-to-kernel-version-5.7-rc1.patch
8042be
Patch0005: 0005-Add-vmbus_testing-tool-build-files.patch
8042be
Patch0006: 0006-tools-hv-change-http-to-https-in-hv_kvp_daemon.c.patch
8042be
# For bz#2026371 - [RHEL9][Hyper-V]The /usr/libexec/hypervkvpd/hv_set_ifconfig need update for RHEL9 since the ifdown/ifup was not supported on RHEL9
8042be
Patch7: hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch
8042be
# For bz#2026371 - [RHEL9][Hyper-V]The /usr/libexec/hypervkvpd/hv_set_ifconfig need update for RHEL9 since the ifdown/ifup was not supported on RHEL9
8042be
Patch8: hpvd-Use-filename-for-connection-profile.patch
8042be
# Source-git patches
8042be
8042be
# Hyper-V is available only on x86 and aarch64 architectures
8042be
# The base empty (a.k.a. virtual) package can not be noarch
8042be
# due to http://www.rpm.org/ticket/78
8042be
ExclusiveArch:  i686 x86_64 aarch64
8042be
8042be
Requires:       hypervkvpd = %{version}-%{release}
8042be
Requires:       hypervvssd = %{version}-%{release}
8042be
Requires:       hypervfcopyd = %{version}-%{release}
8042be
BuildRequires:  gcc
8042be
8042be
8042be
%description
8042be
Suite of daemons that are needed when Linux guest
8042be
is running on Windows Host with Hyper-V.
8042be
8042be
8042be
%package -n hypervkvpd
8042be
Summary: Hyper-V key value pair (KVP) daemon
8042be
Requires: %{name}-license = %{version}-%{release}
8042be
BuildRequires: systemd, kernel-headers
8042be
Requires(post):   systemd
8042be
Requires(preun):  systemd
8042be
Requires(postun): systemd
8042be
8042be
%description -n hypervkvpd
8042be
Hypervkvpd is an implementation of Hyper-V key value pair (KVP)
8042be
functionality for Linux. The daemon first registers with the
8042be
kernel driver. After this is done it collects information
8042be
requested by Windows Host about the Linux Guest. It also supports
8042be
IP injection functionality on the Guest.
8042be
8042be
8042be
%package -n hypervvssd
8042be
Summary: Hyper-V VSS daemon
8042be
Requires: %{name}-license = %{version}-%{release}
8042be
BuildRequires: systemd, kernel-headers
8042be
Requires(post):   systemd
8042be
Requires(preun):  systemd
8042be
Requires(postun): systemd
8042be
8042be
%description -n hypervvssd
8042be
Hypervvssd is an implementation of Hyper-V VSS functionality
8042be
for Linux. The daemon is used for host initiated guest snapshot
8042be
on Hyper-V hypervisor. The daemon first registers with the
8042be
kernel driver. After this is done it waits for instructions
8042be
from Windows Host if to "freeze" or "thaw" the filesystem
8042be
on the Linux Guest.
8042be
8042be
8042be
%package -n hypervfcopyd
8042be
Summary: Hyper-V FCOPY daemon
8042be
Requires: %{name}-license = %{version}-%{release}
8042be
BuildRequires: systemd, kernel-headers
8042be
Requires(post):   systemd
8042be
Requires(preun):  systemd
8042be
Requires(postun): systemd
8042be
8042be
%description -n hypervfcopyd
8042be
Hypervfcopyd is an implementation of file copy service functionality
8042be
for Linux Guest running on Hyper-V. The daemon enables host to copy
8042be
a file (over VMBUS) into the Linux Guest. The daemon first registers
8042be
with the kernel driver. After this is done it waits for instructions
8042be
from Windows Host.
8042be
8042be
8042be
%package license
8042be
Summary:    License of the Hyper-V daemons suite
8042be
BuildArch:  noarch
8042be
8042be
%description license
8042be
Contains license of the Hyper-V daemons suite.
8042be
8042be
%package -n hyperv-tools
8042be
Summary:    Tools for Hyper-V guests
8042be
BuildArch:  noarch
8042be
8042be
%description -n hyperv-tools
8042be
Contains tools and scripts useful for Hyper-V guests.
8042be
8042be
%prep
8042be
%setup -Tc
8042be
cp -pvL %{SOURCE0} COPYING
8042be
8042be
cp -pvL %{SOURCE1} hv_kvp_daemon.c
8042be
cp -pvL %{SOURCE2} hv_get_dhcp_info.sh
8042be
cp -pvL %{SOURCE3} hv_get_dns_info.sh
8042be
cp -pvL %{SOURCE4} hv_set_ifconfig.sh
8042be
cp -pvL %{SOURCE5} hypervkvpd.service
8042be
cp -pvL %{SOURCE6} hypervkvp.rules
8042be
cp -pvL %{SOURCE100} hv_vss_daemon.c
8042be
cp -pvL %{SOURCE101} hypervvssd.service
8042be
cp -pvL %{SOURCE102} hypervvss.rules
8042be
cp -pvL %{SOURCE200} hv_fcopy_daemon.c
8042be
cp -pvL %{SOURCE201} hypervfcopyd.service
8042be
cp -pvL %{SOURCE202} hypervfcopy.rules
8042be
8042be
cp -pvL %{SOURCE301} lsvmbus
8042be
8042be
%patch0002 -p1
8042be
%patch0004 -p1
8042be
%patch0005 -p1
8042be
%patch0006 -p1
8042be
%patch7 -p1
8042be
%patch8 -p1
8042be
8042be
%build
8042be
# HYPERV KVP DAEMON
8042be
%{__cc} $RPM_OPT_FLAGS -c hv_kvp_daemon.c
8042be
%{__cc} $RPM_LD_FLAGS  hv_kvp_daemon.o -o %{hv_kvp_daemon}
8042be
8042be
# HYPERV VSS DAEMON
8042be
%{__cc} $RPM_OPT_FLAGS -c hv_vss_daemon.c
8042be
%{__cc} $RPM_LD_FLAGS hv_vss_daemon.o -o %{hv_vss_daemon}
8042be
8042be
# HYPERV FCOPY DAEMON
8042be
%{__cc} $RPM_OPT_FLAGS -c hv_fcopy_daemon.c
8042be
%{__cc} $RPM_LD_FLAGS hv_fcopy_daemon.o -o %{hv_fcopy_daemon}
8042be
8042be
%install
8042be
rm -rf %{buildroot}
8042be
8042be
mkdir -p %{buildroot}%{_sbindir}
8042be
install -p -m 0755 %{hv_kvp_daemon} %{buildroot}%{_sbindir}
8042be
install -p -m 0755 %{hv_vss_daemon} %{buildroot}%{_sbindir}
8042be
install -p -m 0755 %{hv_fcopy_daemon} %{buildroot}%{_sbindir}
8042be
# Systemd unit file
8042be
mkdir -p %{buildroot}%{_unitdir}
8042be
install -p -m 0644 hypervkvpd.service %{buildroot}%{_unitdir}
8042be
install -p -m 0644 hypervvssd.service %{buildroot}%{_unitdir}
8042be
install -p -m 0644 hypervfcopyd.service %{buildroot}%{_unitdir}
8042be
# Udev rules
8042be
mkdir -p %{buildroot}%{_udevrulesdir}
8042be
install -p -m 0644 hypervkvp.rules %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
8042be
install -p -m 0644 hypervvss.rules %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
8042be
install -p -m 0644 hypervfcopy.rules %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
8042be
# Shell scripts for the KVP daemon
8042be
mkdir -p %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}
8042be
install -p -m 0755 hv_get_dhcp_info.sh %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dhcp_info
8042be
install -p -m 0755 hv_get_dns_info.sh %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dns_info
8042be
install -p -m 0755 hv_set_ifconfig.sh %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_set_ifconfig
8042be
# Directory for pool files
8042be
mkdir -p %{buildroot}%{_sharedstatedir}/hyperv
8042be
8042be
# Tools
8042be
install -p -m 0755 lsvmbus %{buildroot}%{_sbindir}/
8042be
sed -i 's,#!/usr/bin/env python,#!%{__python3},' %{buildroot}%{_sbindir}/lsvmbus
8042be
install -p -m 0755 vmbus_testing %{buildroot}%{_sbindir}/
8042be
8042be
%post -n hypervkvpd
8042be
if [ $1 -gt 1 ] ; then
8042be
	# Upgrade
8042be
	systemctl --no-reload disable hypervkvpd.service >/dev/null 2>&1 || :
8042be
fi
8042be
8042be
%preun -n hypervkvpd
8042be
%systemd_preun hypervkvpd.service
8042be
8042be
%postun -n hypervkvpd
8042be
# hypervkvpd daemon does NOT support restarting (driver, neither)
8042be
%systemd_postun hypervkvpd.service
8042be
# If removing the package, delete %%{_sharedstatedir}/hyperv directory
8042be
if [ "$1" -eq "0" ] ; then
8042be
    rm -rf %{_sharedstatedir}/hyperv || :
8042be
fi
8042be
8042be
8042be
%post -n hypervvssd
8042be
if [ $1 -gt 1 ] ; then
8042be
	# Upgrade
8042be
	systemctl --no-reload disable hypervvssd.service >/dev/null 2>&1 || :
8042be
fi
8042be
8042be
%postun -n hypervvssd
8042be
%systemd_postun hypervvssd.service
8042be
8042be
%preun -n hypervvssd
8042be
%systemd_preun hypervvssd.service
8042be
8042be
8042be
%post -n hypervfcopyd
8042be
if [ $1 -gt 1 ] ; then
8042be
	# Upgrade
8042be
	systemctl --no-reload disable hypervfcopyd.service >/dev/null 2>&1 || :
8042be
fi
8042be
8042be
%postun -n hypervfcopyd
8042be
%systemd_postun hypervfcopyd.service
8042be
8042be
%preun -n hypervfcopyd
8042be
%systemd_preun hypervfcopyd.service
8042be
8042be
8042be
%files
8042be
# the base package does not contain any files.
8042be
8042be
%files -n hypervkvpd
8042be
%{_sbindir}/%{hv_kvp_daemon}
8042be
%{_unitdir}/hypervkvpd.service
8042be
%{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
8042be
%dir %{_libexecdir}/%{hv_kvp_daemon}
8042be
%{_libexecdir}/%{hv_kvp_daemon}/*
8042be
%dir %{_sharedstatedir}/hyperv
8042be
8042be
%files -n hypervvssd
8042be
%{_sbindir}/%{hv_vss_daemon}
8042be
%{_unitdir}/hypervvssd.service
8042be
%{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
8042be
8042be
%files -n hypervfcopyd
8042be
%{_sbindir}/%{hv_fcopy_daemon}
8042be
%{_unitdir}/hypervfcopyd.service
8042be
%{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
8042be
8042be
%files license
8042be
%doc COPYING
8042be
8042be
%files -n hyperv-tools
8042be
%{_sbindir}/lsvmbus
8042be
%{_sbindir}/vmbus_testing
8042be
8042be
%changelog
8042be
* Wed Dec 15 2021 Miroslav Rezanina <mrezanin@redhat.com> - 0-0.39.20190303git
8042be
- hpvd-hv_set_ifconfig.sh-Use-nmcli-commands.patch [bz#2026371]
8042be
- hpvd-Use-filename-for-connection-profile.patch [bz#2026371]
8042be
- Resolves: bz#2026371
8042be
  ([RHEL9][Hyper-V]The /usr/libexec/hypervkvpd/hv_set_ifconfig need update for RHEL9 since the ifdown/ifup was not supported on RHEL9)
8042be
8042be
* Mon Nov 08 2021 Miroslav Rezanina <mrezanin@redhat.com> - 0-0.38.20190303git
8042be
- hpvd-Enable-build-on-aarch64.patch [bz#2020148]
8042be
- Resolves: bz#2020148
8042be
  ([Hyper-V][RHEL9.0][ARM] No hyperv-daemons package built for aarch64 platform)
8042be
8042be
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0-0.37.20190303git
8042be
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
8042be
  Related: rhbz#1991688
8042be
8042be
* Mon May 10 2021 Miroslav Rezanina <mrezanin@redhat.com> - 0-0.36.20190303git
8042be
- Synchronize RHEL 8 changes [rhbz#1957651]
8042be
- Resolves: rhbz#1957651
8042be
  ([Hyper-V][RHEL-9] Update build to rhel format and syncup RHEL 8 content for hyperv-daemons.)
8042be
8042be
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0-0.35.20190303git
8042be
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
8042be
8042be
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.34.20190303git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
8042be
8042be
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.33.20190303git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
8042be
8042be
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.32.20190303git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
8042be
8042be
* Wed Jan 15 2020 Tom Stellard <tstellar@redhat.com> - 0-0.31.20190303git
8042be
- Use __cc macro instead of hard-coding gcc
8042be
8042be
* Fri Nov 08 2019 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.30.20190303git
8042be
- Rebase to 5.4-rc6
8042be
- Add IgnoreOnIsolate to systemd units
8042be
8042be
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.29.20190303git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
8042be
8042be
* Fri Mar 15 2019 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.28.20190303git
8042be
- Rebase to 5.0
8042be
8042be
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.27.20180415git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
8042be
8042be
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.26.20180415git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
8042be
8042be
* Mon Jun 11 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.25.20180415git
8042be
- Switch lsvmbus to Python3
8042be
8042be
* Thu Apr 26 2018 Tomas Hozza <thozza@redhat.com> - 0-0.24.20180415git
8042be
- Added gcc as an explicit BuildRequires
8042be
8042be
* Thu Apr 19 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.23.20180415git
8042be
- Rebase to 4.17-rc1
8042be
8042be
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.22.20170105git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
8042be
8042be
* Mon Dec 11 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.21.20170105git
8042be
- Rebase to 4.15-rc2, drop fedora patches as changes are upstream
8042be
- Start kvpd after network.target
8042be
8042be
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.20.20170105git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
8042be
8042be
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.19.20170105git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
8042be
8042be
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.18.20170105git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
8042be
8042be
* Wed Jan 11 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.17.20160728git
8042be
- Use '-gt' instead of '>' to do the right comparison (#1412033)
8042be
8042be
* Thu Jan 05 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.16.20160728git
8042be
- Rebase to 4.9
8042be
- hyperv-tools subpackage added
8042be
8042be
* Thu Jul 28 2016 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.15.20160728git
8042be
- Rebase to 4.8-rc0 (20160728 git snapshot)
8042be
- Disable services and remove ConditionVirtualization, multi-user.target
8042be
  dependencies switching to udev-only activation (#1331577)
8042be
8042be
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.14.20150702git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
8042be
8042be
* Wed Nov 18 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.13.20150702git
8042be
- Add udev rules to properly restart services (#1195029)
8042be
- Spec cleanup
8042be
8042be
* Thu Jul 02 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.12.20150702git
8042be
- Rebase to 4.2-rc0 (20150702 git snapshot)
8042be
- Switch to new chardev-based communication layer (#1195029)
8042be
8042be
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.11.20150108git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
8042be
8042be
* Thu Jan 08 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.10.20150108git
8042be
- Rebase to 3.19-rc3 (20150108 git snapshot)
8042be
- Drop 'nodaemon' patches, use newly introduced '-n' option
8042be
8042be
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.9.20140714git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
8042be
8042be
* Mon Jul 14 2014 Tomas Hozza <thozza@redhat.com> - 0-0.8.20140714git
8042be
- Update the File copy daemon to the latest git snapshot
8042be
- Fix hyperfcopyd.service to check for /dev/vmbus/hv_fcopy
8042be
8042be
* Wed Jun 11 2014 Tomas Hozza <thozza@redhat.com> - 0-0.7.20140611git
8042be
- Fix FTBFS (#1106781)
8042be
- Use kernel-headers instead of kernel-devel for building
8042be
- package new Hyper-V fcopy daemon as hypervfcopyd sub-package
8042be
8042be
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.6.20140219git
8042be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
8042be
8042be
* Wed Feb 19 2014 Tomas Hozza <thozza@redhat.com> - 0-0.5.20140219git
8042be
- rebase to the latest git snapshot next-20140219
8042be
  - KVP, VSS: removed inclusion of linux/types.h
8042be
  - VSS: Ignore VFAT mounts during freeze operation
8042be
8042be
* Fri Jan 10 2014 Tomas Hozza <thozza@redhat.com> - 0-0.4.20131022git
8042be
- provide 'hyperv-daemons' package for convenient installation of all daemons
8042be
8042be
* Tue Oct 22 2013 Tomas Hozza <thozza@redhat.com> - 0-0.3.20131022git
8042be
- rebase to the latest git snapshot next-20130927 (obtained 2013-10-22)
8042be
  - KVP, VSS: daemon use single buffer for send/recv
8042be
  - KVP: FQDN is obtained on start and cached
8042be
8042be
* Fri Sep 20 2013 Tomas Hozza <thozza@redhat.com> - 0-0.2.20130826git
8042be
- Use 'hypervkvpd' directory in libexec for KVP daemon scripts (#1010268)
8042be
- daemons are now WantedBy multi-user.target instead of basic.target (#1010260)
8042be
8042be
* Mon Aug 26 2013 Tomas Hozza <thozza@redhat.com> - 0-0.1.20130826git
8042be
- Initial package