RHEL 9.0.0 Alpha bootstrap

The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/hyperv-daemons#954743ecc596b5bcc5c0fd1913242d83e8de2c30
This commit is contained in:
Petr Šabata 2020-10-15 13:16:14 +02:00
parent 1b7b5e9c2d
commit bc902d917e
9 changed files with 405 additions and 0 deletions

9
.gitignore vendored
View File

@ -0,0 +1,9 @@
/hv_get_dhcp_info.sh
/hv_get_dns_info.sh
/hv_kvp_daemon.c
/hv_set_ifconfig.sh
/hv_vss_daemon.c
/COPYING
/hv_fcopy_daemon.c
/lsvmbus
/bondvf.sh

362
hyperv-daemons.spec Normal file
View File

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

1
hypervfcopy.rules Normal file
View File

@ -0,0 +1 @@
SUBSYSTEM=="misc", KERNEL=="vmbus/hv_fcopy", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hypervfcopyd.service"

7
hypervfcopyd.service Normal file
View File

@ -0,0 +1,7 @@
[Unit]
Description=Hyper-V FCOPY daemon
BindsTo=sys-devices-virtual-misc-vmbus\x21hv_fcopy.device
IgnoreOnIsolate=1
[Service]
ExecStart=/usr/sbin/hypervfcopyd -n

1
hypervkvp.rules Normal file
View File

@ -0,0 +1 @@
SUBSYSTEM=="misc", KERNEL=="vmbus/hv_kvp", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hypervkvpd.service"

9
hypervkvpd.service Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=Hyper-V KVP daemon
BindsTo=sys-devices-virtual-misc-vmbus\x21hv_kvp.device
After=network.target
IgnoreOnIsolate=1
[Service]
Type=simple
ExecStart=/usr/sbin/hypervkvpd -n

1
hypervvss.rules Normal file
View File

@ -0,0 +1 @@
SUBSYSTEM=="misc", KERNEL=="vmbus/hv_vss", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hypervvssd.service"

7
hypervvssd.service Normal file
View File

@ -0,0 +1,7 @@
[Unit]
Description=Hyper-V VSS daemon
BindsTo=sys-devices-virtual-misc-vmbus\x21hv_vss.device
IgnoreOnIsolate=1
[Service]
ExecStart=/usr/sbin/hypervvssd -n

8
sources Normal file
View File

@ -0,0 +1,8 @@
SHA512 (hv_get_dhcp_info.sh) = 4a9503f2a368cc078e00cdc7d3313d3e6f9c8e18c68e6b9ba0a1b6e4c8c0dbf8183d33158588097b275b7afba08d548187e27cdde05e3321065251389b1bdc63
SHA512 (hv_get_dns_info.sh) = 876effabea3ffe1daaa9c68dfa9b254d740003716f081aa524a1bdbd81724f744bd9dd900f2fdd94764d67584d3e853b26576aa8b53d6f6df94b12702a167428
SHA512 (hv_kvp_daemon.c) = a9c1d1f2d4829d7796fb16b3fe36d2707df0fb6beb430b8b778ee6c65734a04fc9fd5bd22cb63627cb9574a1d7afa18fe3e1d26b56e0ec49130e2b40d1845133
SHA512 (hv_set_ifconfig.sh) = da6bbd90a265ebab7f63985c57ba8a19c1a9e3ca1e15f361663ec166c85647ecfb89e805a9b51134ebcd896b98a9dc4e2104665d3a0d2f3b5494e61cffbd8d86
SHA512 (hv_vss_daemon.c) = bf18b77a2bde83a41837744b578f225f97caae47f2c82e83567a11e87a449d1814586d0a9aa149b4b0512710dfa0db6ebe14c7079740d99cd208f9b670f62164
SHA512 (hv_fcopy_daemon.c) = d69d8fb82f84d2044e6e02a104c7aa3da8c09e8f7d7b42e7d79ba6ff52a01ff4602f0dea6bf2189709c568c280393e160aaa750c539a3ac7a1282bd401be2c42
SHA512 (COPYING) = fbb1e0f29741e900a81ccbe76102103365423d310e9987dfc5858174999911037a9ad48270a3d0b86f245e91868ed73813ca273584be43816f53517858f3aabd
SHA512 (lsvmbus) = 43be38dd1ef8b2864a3f37a29a440478a69879ea4882a7ded8e42c2464b7325c1b0da3c7e001154da5f892641b6f60d75e7dbab287a9e9cfcf9567ea9eeec8e0