From 41f5a808bc39516fa6cba745505a9f1ea44c6eb0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 05 2015 13:32:00 +0000 Subject: import hyperv-daemons-0-0.25.20141008git.el7 --- diff --git a/SOURCES/hv_fcopy_daemon.c b/SOURCES/hv_fcopy_daemon.c new file mode 100644 index 0000000..8f96b3e --- /dev/null +++ b/SOURCES/hv_fcopy_daemon.c @@ -0,0 +1,198 @@ +/* + * An implementation of host to guest copy functionality for Linux. + * + * Copyright (C) 2014, Microsoft, Inc. + * + * Author : K. Y. Srinivasan + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or + * NON INFRINGEMENT. See the GNU General Public License for more + * details. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int target_fd; +static char target_fname[W_MAX_PATH]; + +static int hv_start_fcopy(struct hv_start_fcopy *smsg) +{ + int error = HV_E_FAIL; + char *q, *p; + + /* + * If possile append a path seperator to the path. + */ + if (strlen((char *)smsg->path_name) < (W_MAX_PATH - 2)) + strcat((char *)smsg->path_name, "/"); + + p = (char *)smsg->path_name; + snprintf(target_fname, sizeof(target_fname), "%s/%s", + (char *)smsg->path_name, smsg->file_name); + + syslog(LOG_INFO, "Target file name: %s", target_fname); + /* + * Check to see if the path is already in place; if not, + * create if required. + */ + while ((q = strchr(p, '/')) != NULL) { + if (q == p) { + p++; + continue; + } + *q = '\0'; + if (access((char *)smsg->path_name, F_OK)) { + if (smsg->copy_flags & CREATE_PATH) { + if (mkdir((char *)smsg->path_name, 0755)) { + syslog(LOG_ERR, "Failed to create %s", + (char *)smsg->path_name); + goto done; + } + } else { + syslog(LOG_ERR, "Invalid path: %s", + (char *)smsg->path_name); + goto done; + } + } + p = q + 1; + *q = '/'; + } + + if (!access(target_fname, F_OK)) { + syslog(LOG_INFO, "File: %s exists", target_fname); + if (!(smsg->copy_flags & OVER_WRITE)) { + error = HV_ERROR_ALREADY_EXISTS; + goto done; + } + } + + target_fd = open(target_fname, + O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0744); + if (target_fd == -1) { + syslog(LOG_INFO, "Open Failed: %s", strerror(errno)); + goto done; + } + + error = 0; +done: + return error; +} + +static int hv_copy_data(struct hv_do_fcopy *cpmsg) +{ + ssize_t bytes_written; + + bytes_written = pwrite(target_fd, cpmsg->data, cpmsg->size, + cpmsg->offset); + + if (bytes_written != cpmsg->size) + return HV_E_FAIL; + + return 0; +} + +static int hv_copy_finished(void) +{ + close(target_fd); + return 0; +} +static int hv_copy_cancel(void) +{ + close(target_fd); + unlink(target_fname); + return 0; + +} + +int main(void) +{ + int fd, fcopy_fd, len; + int error; + int version = FCOPY_CURRENT_VERSION; + char *buffer[4096 * 2]; + struct hv_fcopy_hdr *in_msg; + + if (daemon(1, 0)) { + syslog(LOG_ERR, "daemon() failed; error: %s", strerror(errno)); + exit(EXIT_FAILURE); + } + + openlog("HV_FCOPY", 0, LOG_USER); + syslog(LOG_INFO, "HV_FCOPY starting; pid is:%d", getpid()); + + fcopy_fd = open("/dev/vmbus/hv_fcopy", O_RDWR); + + if (fcopy_fd < 0) { + syslog(LOG_ERR, "open /dev/vmbus/hv_fcopy failed; error: %d %s", + errno, strerror(errno)); + exit(EXIT_FAILURE); + } + + /* + * Register with the kernel. + */ + if ((write(fcopy_fd, &version, sizeof(int))) != sizeof(int)) { + syslog(LOG_ERR, "Registration failed: %s", strerror(errno)); + exit(EXIT_FAILURE); + } + + while (1) { + /* + * In this loop we process fcopy messages after the + * handshake is complete. + */ + len = pread(fcopy_fd, buffer, (4096 * 2), 0); + if (len < 0) { + syslog(LOG_ERR, "pread failed: %s", strerror(errno)); + exit(EXIT_FAILURE); + } + in_msg = (struct hv_fcopy_hdr *)buffer; + + switch (in_msg->operation) { + case START_FILE_COPY: + error = hv_start_fcopy((struct hv_start_fcopy *)in_msg); + break; + case WRITE_TO_FILE: + error = hv_copy_data((struct hv_do_fcopy *)in_msg); + break; + case COMPLETE_FCOPY: + error = hv_copy_finished(); + break; + case CANCEL_FCOPY: + error = hv_copy_cancel(); + break; + + default: + syslog(LOG_ERR, "Unknown operation: %d", + in_msg->operation); + + } + + if (pwrite(fcopy_fd, &error, sizeof(int), 0) != sizeof(int)) { + syslog(LOG_ERR, "pwrite failed: %s", strerror(errno)); + exit(EXIT_FAILURE); + } + } +} diff --git a/SOURCES/hv_kvp_daemon.c b/SOURCES/hv_kvp_daemon.c index 8fd9ec6..4088b81 100644 --- a/SOURCES/hv_kvp_daemon.c +++ b/SOURCES/hv_kvp_daemon.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -89,6 +88,7 @@ static char *processor_arch; static char *os_build; static char *os_version; static char *lic_version = "Unknown version"; +static char full_domain_name[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; static struct utsname uts_buf; /* @@ -1367,7 +1367,7 @@ setval_error: } -static int +static void kvp_get_domain_name(char *buffer, int length) { struct addrinfo hints, *info ; @@ -1381,12 +1381,12 @@ kvp_get_domain_name(char *buffer, int length) error = getaddrinfo(buffer, NULL, &hints, &info); if (error != 0) { - strcpy(buffer, "getaddrinfo failed\n"); - return error; + snprintf(buffer, length, "getaddrinfo failed: 0x%x %s", + error, gai_strerror(error)); + return; } - strcpy(buffer, info->ai_canonname); + snprintf(buffer, length, "%s", info->ai_canonname); freeaddrinfo(info); - return error; } static int @@ -1433,7 +1433,6 @@ int main(void) int pool; char *if_name; struct hv_kvp_ipaddr_value *kvp_ip_val; - char *kvp_send_buffer; char *kvp_recv_buffer; size_t kvp_recv_buffer_len; @@ -1442,17 +1441,21 @@ int main(void) openlog("KVP", 0, LOG_USER); syslog(LOG_INFO, "KVP starting; pid is:%d", getpid()); - kvp_recv_buffer_len = NLMSG_HDRLEN + sizeof(struct cn_msg) + sizeof(struct hv_kvp_msg); - kvp_send_buffer = calloc(1, kvp_recv_buffer_len); + kvp_recv_buffer_len = NLMSG_LENGTH(0) + sizeof(struct cn_msg) + sizeof(struct hv_kvp_msg); kvp_recv_buffer = calloc(1, kvp_recv_buffer_len); - if (!(kvp_send_buffer && kvp_recv_buffer)) { - syslog(LOG_ERR, "Failed to allocate netlink buffers"); + if (!kvp_recv_buffer) { + syslog(LOG_ERR, "Failed to allocate netlink buffer"); exit(EXIT_FAILURE); } /* * Retrieve OS release information. */ kvp_get_os_info(); + /* + * Cache Fully Qualified Domain Name because getaddrinfo takes an + * unpredictable amount of time to finish. + */ + kvp_get_domain_name(full_domain_name, sizeof(full_domain_name)); if (kvp_file_init()) { syslog(LOG_ERR, "Failed to initialize the pools"); @@ -1488,7 +1491,7 @@ int main(void) /* * Register ourselves with the kernel. */ - message = (struct cn_msg *)kvp_send_buffer; + message = (struct cn_msg *)kvp_recv_buffer; message->id.idx = CN_KVP_IDX; message->id.val = CN_KVP_VAL; @@ -1671,8 +1674,7 @@ int main(void) switch (hv_msg->body.kvp_enum_data.index) { case FullyQualifiedDomainName: - kvp_get_domain_name(key_value, - HV_KVP_EXCHANGE_MAX_VALUE_SIZE); + strcpy(key_value, full_domain_name); strcpy(key_name, "FullyQualifiedDomainName"); break; case IntegrationServicesVersion: diff --git a/SOURCES/hv_vss_daemon.c b/SOURCES/hv_vss_daemon.c index 8611962..6a213b8 100644 --- a/SOURCES/hv_vss_daemon.c +++ b/SOURCES/hv_vss_daemon.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -88,6 +87,8 @@ static int vss_operate(int operation) continue; if (strcmp(ent->mnt_type, "iso9660") == 0) continue; + if (strcmp(ent->mnt_type, "vfat") == 0) + continue; if (strcmp(ent->mnt_dir, "/") == 0) { root_seen = 1; continue; @@ -140,7 +141,6 @@ int main(void) struct cn_msg *incoming_cn_msg; int op; struct hv_vss_msg *vss_msg; - char *vss_send_buffer; char *vss_recv_buffer; size_t vss_recv_buffer_len; @@ -150,10 +150,9 @@ int main(void) openlog("Hyper-V VSS", 0, LOG_USER); syslog(LOG_INFO, "VSS starting; pid is:%d", getpid()); - vss_recv_buffer_len = NLMSG_HDRLEN + sizeof(struct cn_msg) + sizeof(struct hv_vss_msg); - vss_send_buffer = calloc(1, vss_recv_buffer_len); + vss_recv_buffer_len = NLMSG_LENGTH(0) + sizeof(struct cn_msg) + sizeof(struct hv_vss_msg); vss_recv_buffer = calloc(1, vss_recv_buffer_len); - if (!(vss_send_buffer && vss_recv_buffer)) { + if (!vss_recv_buffer) { syslog(LOG_ERR, "Failed to allocate netlink buffers"); exit(EXIT_FAILURE); } @@ -185,7 +184,7 @@ int main(void) /* * Register ourselves with the kernel. */ - message = (struct cn_msg *)vss_send_buffer; + message = (struct cn_msg *)vss_recv_buffer; message->id.idx = CN_VSS_IDX; message->id.val = CN_VSS_VAL; message->ack = 0; diff --git a/SOURCES/hypervfcopyd-0-dont_call_daemon.patch b/SOURCES/hypervfcopyd-0-dont_call_daemon.patch new file mode 100644 index 0000000..190b42d --- /dev/null +++ b/SOURCES/hypervfcopyd-0-dont_call_daemon.patch @@ -0,0 +1,15 @@ +diff -up ./hv_fcopy_daemon.c.daemon_fcopy ./hv_fcopy_daemon.c +--- ./hv_fcopy_daemon.c.daemon_fcopy 2014-02-19 09:55:20.689982023 +0100 ++++ ./hv_fcopy_daemon.c 2014-02-19 09:55:36.700982923 +0100 +@@ -131,11 +131,6 @@ int main(void) + char *buffer[4096 * 2]; + struct hv_fcopy_hdr *in_msg; + +- if (daemon(1, 0)) { +- syslog(LOG_ERR, "daemon() failed; error: %s", strerror(errno)); +- exit(EXIT_FAILURE); +- } +- + openlog("HV_FCOPY", 0, LOG_USER); + syslog(LOG_INFO, "HV_FCOPY starting; pid is:%d", getpid()); + diff --git a/SOURCES/hypervfcopyd.service b/SOURCES/hypervfcopyd.service new file mode 100644 index 0000000..f58698e --- /dev/null +++ b/SOURCES/hypervfcopyd.service @@ -0,0 +1,10 @@ +[Unit] +Description=Hyper-V FCOPY daemon +ConditionVirtualization=microsoft +ConditionPathExists=/dev/vmbus/hv_fcopy + +[Service] +ExecStart=/usr/sbin/hypervfcopyd + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/hypervkvpd-0-include_fix.patch b/SOURCES/hypervkvpd-0-include_fix.patch deleted file mode 100644 index 736396c..0000000 --- a/SOURCES/hypervkvpd-0-include_fix.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up hypervkvpd-0/hv_kvp_daemon.c.include hypervkvpd-0/hv_kvp_daemon.c ---- hypervkvpd-0/hv_kvp_daemon.c.include 2013-03-20 14:47:30.812899613 +0100 -+++ hypervkvpd-0/hv_kvp_daemon.c 2013-03-20 14:47:42.337896971 +0100 -@@ -26,7 +26,7 @@ - #include - #include - #include --#include -+/* #include */ - #include - #include - #include -@@ -35,7 +35,7 @@ - #include - #include - #include --#include -+#include "linux/hyperv.h" - #include - #include - #include diff --git a/SOURCES/hypervvssd-0-fix_includes.patch b/SOURCES/hypervvssd-0-fix_includes.patch deleted file mode 100644 index c65dcaf..0000000 --- a/SOURCES/hypervvssd-0-fix_includes.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ./hv_vss_daemon.c.include ./hv_vss_daemon.c ---- ./hv_vss_daemon.c.include 2013-06-26 10:36:36.444910963 +0200 -+++ ./hv_vss_daemon.c 2013-06-26 10:37:22.115951240 +0200 -@@ -34,7 +34,7 @@ - #include - #include - #include --#include -+#include "linux/hyperv.h" - #include - #include - diff --git a/SOURCES/hypervvssd-0-ignore-VFAT-mounts.patch b/SOURCES/hypervvssd-0-ignore-VFAT-mounts.patch deleted file mode 100644 index 156ee02..0000000 --- a/SOURCES/hypervvssd-0-ignore-VFAT-mounts.patch +++ /dev/null @@ -1,29 +0,0 @@ -From f33b215549938f89aebf862b942366d2aa41c191 Mon Sep 17 00:00:00 2001 -From: K. Y. Srinivasan -Date: Wed, 12 Feb 2014 16:40:22 +0000 -Subject: Tools: hv: vssdaemon: Ignore VFAT mounts during the Freeze operation - -If the guest has a FAT file system mounted, skip it during the FREEZE -operation. With this change we can support host initiated backup of -the guest even when the guest may have FAT file systems mounted. - -Signed-off-by: K. Y. Srinivasan -Signed-off-by: Greg Kroah-Hartman ---- -(limited to 'tools/hv/hv_vss_daemon.c') - -diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c -index 520de3304..6a213b8 100644 ---- a/tools/hv/hv_vss_daemon.c -+++ b/tools/hv/hv_vss_daemon.c -@@ -87,6 +87,8 @@ static int vss_operate(int operation) - continue; - if (strcmp(ent->mnt_type, "iso9660") == 0) - continue; -+ if (strcmp(ent->mnt_type, "vfat") == 0) -+ continue; - if (strcmp(ent->mnt_dir, "/") == 0) { - root_seen = 1; - continue; --- -cgit v0.9.2 diff --git a/SPECS/hyperv-daemons.spec b/SPECS/hyperv-daemons.spec index a0120ea..1a14573 100644 --- a/SPECS/hyperv-daemons.spec +++ b/SPECS/hyperv-daemons.spec @@ -2,71 +2,73 @@ %global hv_kvp_daemon hypervkvpd # HyperV VSS daemon binary name %global hv_vss_daemon hypervvssd +# HyperV FCOPY daemon binary name +%global hv_fcopy_daemon hypervfcopyd # snapshot version -%global snapver .20130826git +%global snapver .20141008git # use hardened build %global _hardened_build 1 Name: hyperv-daemons Version: 0 -Release: 0.24%{?snapver}%{?dist} +Release: 0.25%{?snapver}%{?dist} Summary: HyperV daemons suite Group: System Environment/Daemons License: GPLv2 URL: http://www.kernel.org -# Source files obtained from kernel upstream 2013-08-26. +# Source files obtained from kernel upstream 2014-10-08. # git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git # The daemon and scripts are located in "master branch - /tools/hv" -# COPYING -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/COPYING?id=refs/tags/next-20130822 +# COPYING -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/COPYING?id=refs/tags/next-2014-10-08 Source0: COPYING # HYPERV KVP DAEMON -# hv_kvp_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_kvp_daemon.c?id=refs/tags/next-20130822 +# hv_kvp_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_kvp_daemon.c?id=refs/tags/next-2014-10-08 Source1: hv_kvp_daemon.c -# hv_get_dhcp_info.sh -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_get_dhcp_info.sh?id=refs/tags/next-20130822 +# hv_get_dhcp_info.sh -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_get_dhcp_info.sh?id=refs/tags/next-2014-10-08 Source2: hv_get_dhcp_info.sh -# hv_get_dns_info.sh -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_get_dns_info.sh?id=refs/tags/next-20130822 +# hv_get_dns_info.sh -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_get_dns_info.sh?id=refs/tags/next-2014-10-08 Source3: hv_get_dns_info.sh -# hv_set_ifconfig.sh -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_set_ifconfig.sh?id=refs/tags/next-20130822 +# hv_set_ifconfig.sh -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_set_ifconfig.sh?id=refs/tags/next-2014-10-08 Source4: hv_set_ifconfig.sh Source5: hypervkvpd.service # HYPERV VSS DAEMON -# hv_vss_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_vss_daemon.c?id=refs/tags/next-20130822 +# hv_vss_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_vss_daemon.c?id=refs/tags/next-2014-10-08 Source100: hv_vss_daemon.c Source101: hypervvssd.service +# HYPERV FCOPY DAEMON +# hv_fcopy_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/tools/hv/hv_fcopy_daemon.c?id=refs/tags/next-2014-10-08 +Source200: hv_fcopy_daemon.c +Source201: hypervfcopyd.service + + # HYPERV KVP DAEMON # Correct paths to external scripts ("/usr/libexec/hypervkvpd"). Patch0: hypervkvpd-0-corrected_paths_to_external_scripts.patch -# use quoted include for linux/hyperv.h because we use gcc option -# -iquote for include PATH where it is located. This is because -# some headers in system include PATH are also in kernel-devel -# package. -Patch1: hypervkvpd-0-include_fix.patch # rhbz#872566 -Patch2: hypervkvpd-0-long_file_names_from_readdir.patch +Patch1: hypervkvpd-0-long_file_names_from_readdir.patch # Remove daemon() call and let systemd handle it -Patch3: hypervkvpd-0-dont_call_deamon.patch +Patch2: hypervkvpd-0-dont_call_deamon.patch # HYPERV VSS DAEMON -# use quoted include for linux/hyperv.h because we use gcc option -# -iquote for include PATH where it is located. This is because -# some headers in system include PATH are also in kernel-devel -# package. -Patch100: hypervvssd-0-fix_includes.patch # Remove daemon() call and let systemd handle it -Patch101: hypervvssd-0-dont_call_daemon.patch -# rhbz#1064094 -Patch102: hypervvssd-0-ignore-VFAT-mounts.patch +Patch100: hypervvssd-0-dont_call_daemon.patch + +# HYPERV FCOPY DAEMON +# Remove daemon() call and let systemd handle it +Patch200: hypervfcopyd-0-dont_call_daemon.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # HyperV is available only on x86 architectures ExclusiveArch: x86_64 Requires: hypervkvpd = %{version}-%{release} Requires: hypervvssd = %{version}-%{release} +Requires: hypervfcopyd = %{version}-%{release} %description Suite of daemons that are needed when Linux guest @@ -77,7 +79,7 @@ is running on Windows Host with HyperV. Summary: HyperV key value pair (KVP) daemon Group: System Environment/Daemons Requires: %{name}-license = %{version}-%{release} -BuildRequires: systemd, kernel-devel +BuildRequires: systemd, kernel-headers Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -94,7 +96,7 @@ IP injection functionality on the Guest. Summary: HyperV VSS daemon Group: System Environment/Daemons Requires: %{name}-license = %{version}-%{release} -BuildRequires: systemd, kernel-devel +BuildRequires: systemd, kernel-headers Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -108,6 +110,23 @@ from Windows Host if to "freeze" or "thaw" the filesystem on the Linux Guest. +%package -n hypervfcopyd +Summary: HyperV FCOPY daemon +Group: System Environment/Daemons +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 HyperV. 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 HyperV daemons suite Group: Applications/System @@ -130,24 +149,21 @@ cp -pvL %{SOURCE5} hypervkvpd.service cp -pvL %{SOURCE100} hv_vss_daemon.c cp -pvL %{SOURCE101} hypervvssd.service +cp -pvL %{SOURCE200} hv_fcopy_daemon.c +cp -pvL %{SOURCE201} hypervfcopyd.service + %patch0 -p1 -b .external_scripts -%patch1 -p1 -b .include -%patch2 -p1 -b .long_names -%patch3 -p1 -b .daemon +%patch1 -p1 -b .long_names +%patch2 -p1 -b .daemon -%patch100 -p1 -b .include -%patch101 -p1 -b .daemon -%patch102 -p3 -b .vfat +%patch100 -p1 -b .daemon +%patch200 -p1 -b .daemon_fcopy %build -# kernel-devel version -%{!?kversion: %global kversion `ls %{_usrsrc}/kernels | sort -dr | head -n 1`} - # HYPERV KVP DAEMON gcc \ $RPM_OPT_FLAGS \ - -iquote %{_usrsrc}/kernels/%{kversion}/include \ -c hv_kvp_daemon.c gcc \ @@ -158,7 +174,6 @@ gcc \ # HYPERV VSS DAEMON gcc \ $RPM_OPT_FLAGS \ - -iquote %{_usrsrc}/kernels/%{kversion}/include \ -c hv_vss_daemon.c gcc \ @@ -166,6 +181,16 @@ gcc \ hv_vss_daemon.o \ -o %{hv_vss_daemon} +# HYPERV FCOPY DAEMON +gcc \ + $RPM_OPT_FLAGS \ + -c hv_fcopy_daemon.c + +gcc \ + $RPM_LD_FLAGS \ + hv_fcopy_daemon.o \ + -o %{hv_fcopy_daemon} + %install rm -rf %{buildroot} @@ -173,10 +198,12 @@ 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} mkdir -p %{buildroot}%{_unitdir} # Systemd unit file install -p -m 0644 %{SOURCE5} %{buildroot}%{_unitdir} install -p -m 0644 %{SOURCE101} %{buildroot}%{_unitdir} +install -p -m 0644 %{SOURCE201} %{buildroot}%{_unitdir} # Shell scripts for the KVP daemon mkdir -p %{buildroot}%{_libexecdir}/%{hv_kvp_daemon} install -p -m 0755 hv_get_dhcp_info.sh %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dhcp_info @@ -210,6 +237,17 @@ fi %preun -n hypervvssd %systemd_preun hypervvssd.service + +%post -n hypervfcopyd +%systemd_post hypervfcopyd.service + +%postun -n hypervfcopyd +%systemd_postun hypervfcopyd.service + +%preun -n hypervfcopyd +%systemd_preun hypervfcopyd.service + + %files # the base package does not contain any files. @@ -224,10 +262,19 @@ fi %{_sbindir}/%{hv_vss_daemon} %{_unitdir}/hypervvssd.service +%files -n hypervfcopyd +%{_sbindir}/%{hv_fcopy_daemon} +%{_unitdir}/hypervfcopyd.service + %files license %doc COPYING %changelog +* Thu Oct 9 2014 Matej Muzila - 0-0.25.20141008git +- Daemons updated to the last git snapshot +- Use kernel-headers instead of kernel-devel to build +- Added Hyper-V fcopy daemon as hypervfcopyd subpackage + * Mon Feb 17 2014 Tomas Hozza - 0-0.24.20130826git - VSS: Ignore VFAT mounts on freeze/thaw (#1064094)