diff --git a/linux-tools/repos/community-x86_64/70-hv_fcopy.rules b/linux-tools/repos/community-x86_64/70-hv_fcopy.rules new file mode 100644 index 00000000000..a186817c38f --- /dev/null +++ b/linux-tools/repos/community-x86_64/70-hv_fcopy.rules @@ -0,0 +1 @@ +SUBSYSTEM=="misc", KERNEL=="vmbus/hv_fcopy", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv_fcopy_daemon.service" diff --git a/linux-tools/repos/community-x86_64/70-hv_kvp.rules b/linux-tools/repos/community-x86_64/70-hv_kvp.rules new file mode 100644 index 00000000000..7193fdda459 --- /dev/null +++ b/linux-tools/repos/community-x86_64/70-hv_kvp.rules @@ -0,0 +1 @@ +SUBSYSTEM=="misc", KERNEL=="vmbus/hv_kvp", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv_kvp_daemon.service" diff --git a/linux-tools/repos/community-x86_64/70-hv_vss.rules b/linux-tools/repos/community-x86_64/70-hv_vss.rules new file mode 100644 index 00000000000..1274dec1ebc --- /dev/null +++ b/linux-tools/repos/community-x86_64/70-hv_vss.rules @@ -0,0 +1 @@ +SUBSYSTEM=="misc", KERNEL=="vmbus/hv_vss", TAG+="systemd", ENV{SYSTEMD_WANTS}+="hv_vss_daemon.service" diff --git a/linux-tools/repos/community-x86_64/PKGBUILD b/linux-tools/repos/community-x86_64/PKGBUILD index 34aaa7859e7..d149caa587a 100644 --- a/linux-tools/repos/community-x86_64/PKGBUILD +++ b/linux-tools/repos/community-x86_64/PKGBUILD @@ -15,7 +15,7 @@ pkgname=( 'x86_energy_perf_policy' ) pkgver=5.0 -pkgrel=1 +pkgrel=2 license=('GPL2') arch=('x86_64') url='https://www.kernel.org' @@ -38,12 +38,26 @@ source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git# 'cpupower.default' 'cpupower.systemd' 'cpupower.service' - 'usbipd.service') + 'usbipd.service' + 'hv_fcopy_daemon.service' + 'hv_kvp_daemon.service' + 'hv_vss_daemon.service' + '70-hv_fcopy.rules' + '70-hv_kvp.rules' + '70-hv_vss.rules' + 'hyperv.patch') md5sums=('SKIP' '56883c159381ba89e50ab8ea65efec77' '34f5ecc19770a1abbcd0fd65bfd1f065' '86c4e419e4ba80835c330d49ba3f56ad' - 'bb35634f480325a78b943f7e10165e86') + 'bb35634f480325a78b943f7e10165e86' + 'a37dddcc7315df2d7c83cc85a47c0e7c' + '5084e43bfeb2886d464e1a14106433bc' + '924179a41faa7d2cb9b2ad7c78b30519' + '2097c32e64e392f33f08dd46be0c4684' + '61e071c84ab563c8544a83eeb714f2a4' + '6672b8451bbbf52ca079ff90193228a3' + 'e2ef70a490c760e99992cf722a45927b') prepare() { cd linux @@ -116,7 +130,7 @@ build() { msg2 'hv' pushd linux/tools/hv - CFLAGS+=' -DKVP_SCRIPTS_PATH=/usr/lib/hyperv/kvp_scripts/' make + CFLAGS+=' -DKVP_SCRIPTS_PATH=\""/usr/lib/hyperv/kvp_scripts/"\"' make popd msg2 'bpf' @@ -258,13 +272,24 @@ package_turbostat() { package_hyperv() { pkgdesc='Hyper-V tools' - depends=('glibc') - - cd linux/tools/hv - for _p in hv_fcopy_daemon hv_kvp_daemon hv_vss_daemon; do - install -Dm755 "$_p" "$pkgdir/usr/bin/$_p" + depends=('glibc' 'iproute2') + install=hyperv.install + + for _p in hv_fcopy hv_kvp hv_vss; do + daemon_name="${_p}_daemon" + install -Dm755 "linux/tools/hv/$daemon_name" "$pkgdir/usr/bin/$daemon_name" + install -Dm644 "$daemon_name.service" "$pkgdir/usr/lib/systemd/system/$daemon_name.service" + install -Dm644 "70-$_p.rules" "$pkgdir/etc/udev/rules.d/70-$_p.rules" + done + kvp_scripts="$pkgdir/usr/lib/hyperv/kvp_scripts" + install -dm755 "$kvp_scripts" + for script in hv_get_dhcp_info hv_get_dns_info hv_set_ifconfig; do + if [ -f "$script.sh" ]; then + install -Dm755 "$script.sh" "$kvp_scripts/$script" + else + install -Dm755 "linux/tools/hv/$script.sh" "$kvp_scripts/$script" + fi done - install -dm755 "$pkgdir/usr/lib/hyperv/kvp_scripts" } package_bpf() { diff --git a/linux-tools/repos/community-x86_64/hv_fcopy_daemon.service b/linux-tools/repos/community-x86_64/hv_fcopy_daemon.service new file mode 100644 index 00000000000..88fed6f5ada --- /dev/null +++ b/linux-tools/repos/community-x86_64/hv_fcopy_daemon.service @@ -0,0 +1,10 @@ +[Unit] +Description=Hyper-V FCOPY Daemon +Documentation=https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/integration-services#hyper-v-guest-service-interface +BindsTo=sys-devices-virtual-misc-vmbus\x21hv_fcopy.device + +[Service] +ExecStart=/usr/sbin/hv_fcopy_daemon -n + +[Install] +WantedBy=multi-user.target diff --git a/linux-tools/repos/community-x86_64/hv_kvp_daemon.service b/linux-tools/repos/community-x86_64/hv_kvp_daemon.service new file mode 100644 index 00000000000..6cd7e9d6c12 --- /dev/null +++ b/linux-tools/repos/community-x86_64/hv_kvp_daemon.service @@ -0,0 +1,10 @@ +[Unit] +Description=Hyper-V Key Value Pair Daemon +Documentation=https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/integration-services#hyper-v-data-exchange-service-kvp +BindsTo=sys-devices-virtual-misc-vmbus\x21hv_kvp.device + +[Service] +ExecStart=/usr/sbin/hv_kvp_daemon -n + +[Install] +WantedBy=multi-user.target diff --git a/linux-tools/repos/community-x86_64/hv_vss_daemon.service b/linux-tools/repos/community-x86_64/hv_vss_daemon.service new file mode 100644 index 00000000000..d12aa1dded2 --- /dev/null +++ b/linux-tools/repos/community-x86_64/hv_vss_daemon.service @@ -0,0 +1,10 @@ +[Unit] +Description=Hyper-V VSS Daemon +Documentation=https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/integration-services#hyper-v-volume-shadow-copy-requestor +BindsTo=sys-devices-virtual-misc-vmbus\x21hv_vss.device + +[Service] +ExecStart=/usr/sbin/hv_vss_daemon -n + +[Install] +WantedBy=multi-user.target diff --git a/linux-tools/repos/community-x86_64/hyperv.install b/linux-tools/repos/community-x86_64/hyperv.install new file mode 100644 index 00000000000..ff37765d826 --- /dev/null +++ b/linux-tools/repos/community-x86_64/hyperv.install @@ -0,0 +1,13 @@ +#!/bin/sh + +# arg 1: the new package version +# arg 2: the old package version +post_upgrade() { + /usr/bin/udevadm trigger +} + +post_remove() { + /usr/bin/udevadm trigger +} + +# vim:set ts=2 sw=2 ft=sh et: diff --git a/linux-tools/repos/community-x86_64/hyperv.patch b/linux-tools/repos/community-x86_64/hyperv.patch new file mode 100644 index 00000000000..408c2b7148f --- /dev/null +++ b/linux-tools/repos/community-x86_64/hyperv.patch @@ -0,0 +1,13 @@ +diff --git a/tools/hv/Makefile b/tools/hv/Makefile +index 5db5e62cebda..058c3dbb7824 100644 +--- a/tools/hv/Makefile ++++ b/tools/hv/Makefile +@@ -2,7 +2,7 @@ + # Makefile for Hyper-V tools + + WARNINGS = -Wall -Wextra +-CFLAGS = $(WARNINGS) -g $(shell getconf LFS_CFLAGS) ++CFLAGS += $(WARNINGS) -g $(shell getconf LFS_CFLAGS) + + CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include +