From fdc82bd1cbdaab222a256f59658c194511d191e8 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Wed, 11 Sep 2024 19:09:58 +0200 Subject: [PATCH] oem-azure: add hyperv daemons This change adds hyperv daemons hv_fcopy, hv_kvp, and hv_vss to the Azure OEM sysext. hv_kvp specifically is needed to submit OS version information to the Azure hypervisor. The daemons, tough userspace programs, are built from the kernel sources as they are included in the Linux kernel. Signed-off-by: Thilo Fromm --- .../hv-daemons/files/hv_fcopy_daemon.service | 9 ++++++ .../hv-daemons/files/hv_kvp_daemon.service | 11 ++++++++ .../hv-daemons/files/hv_vss_daemon.service | 10 +++++++ .../hv-daemons/hv-daemons-6.6.48.ebuild | 28 +++++++++++++++++++ .../app-emulation/hv-daemons/metadata.xml | 4 +++ .../oem-azure/oem-azure-2.9.1.1-r2.ebuild | 1 + 6 files changed, 63 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_fcopy_daemon.service create mode 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_kvp_daemon.service create mode 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_vss_daemon.service create mode 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/hv-daemons-6.6.48.ebuild create mode 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/metadata.xml diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_fcopy_daemon.service b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_fcopy_daemon.service new file mode 100644 index 0000000000..c4d63d39ed --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_fcopy_daemon.service @@ -0,0 +1,9 @@ +[Unit] +Description=Hyper-V FCOPY daemon +ConditionPathExists=/dev/vmbus/hv_fcopy + +[Service] +ExecStart=/usr/bin/hv_fcopy_daemon --no-daemon + +[Install] +WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_kvp_daemon.service b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_kvp_daemon.service new file mode 100644 index 0000000000..2237a2b3db --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_kvp_daemon.service @@ -0,0 +1,11 @@ +[Unit] +Description=Hyper-V KVP daemon +BindsTo=sys-devices-virtual-misc-vmbus\x21hv_kvp.device +ConditionPathExists=/dev/vmbus/hv_kvp + +[Service] +Type=exec +ExecStart=/usr/bin/hv_kvp_daemon --no-daemon + +[Install] +WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_vss_daemon.service b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_vss_daemon.service new file mode 100644 index 0000000000..5587479a4c --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_vss_daemon.service @@ -0,0 +1,10 @@ +[Unit] +Description=Hyper-V VSS daemon +ConditionPathExists=/dev/vmbus/hv_vss + +[Service] +Type=exec +ExecStart=/usr/bin/hv_vss_daemon --no-daemon + +[Install] +WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/hv-daemons-6.6.48.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/hv-daemons-6.6.48.ebuild new file mode 100644 index 0000000000..ea9a5fbeb5 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/hv-daemons-6.6.48.ebuild @@ -0,0 +1,28 @@ +# Copyright 2044-2016 The Flatcar Maintainers +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +COREOS_SOURCE_REVISION="" +inherit coreos-kernel savedconfig systemd + +DESCRIPTION="HyperV guest support daemons." +KEYWORDS="amd64 arm64" + +src_compile() { + # Build hv_vss_daemon, hv_kvp_daemon, hv_fcopy_daemon + kmake tools/hv +} + +src_install() { + dobin "${S}/build/tools/hv/hv_fcopy_daemon" + dobin "${S}/build/tools/hv/hv_kvp_daemon" + dobin "${S}/build/tools/hv/hv_vss_daemon" + + systemd_dounit "${FILESDIR}/hv_fcopy_daemon.service" + systemd_dounit "${FILESDIR}/hv_kvp_daemon.service" + systemd_dounit "${FILESDIR}/hv_vss_daemon.service" + + systemd_enable_service "multi-user.target" "hv_fcopy_daemon.service" + systemd_enable_service "multi-user.target" "hv_kvp_daemon.service" + systemd_enable_service "multi-user.target" "hv_vss_daemon.service" +} diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/metadata.xml b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/metadata.xml new file mode 100644 index 0000000000..097975e3ad --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/metadata.xml @@ -0,0 +1,4 @@ + + + + diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.9.1.1-r2.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.9.1.1-r2.ebuild index de93bdad65..5e04e16569 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.9.1.1-r2.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.9.1.1-r2.ebuild @@ -17,6 +17,7 @@ IUSE="" RDEPEND=" ~app-emulation/wa-linux-agent-${PV} net-misc/chrony + app-emulation/hv-daemons " # for coreos-base/common-oem-files