From fdc82bd1cbdaab222a256f59658c194511d191e8 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Wed, 11 Sep 2024 19:09:58 +0200 Subject: [PATCH 1/7] 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 From 7aa6f9a3767b0954d159a09393fe8afe22675133 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Wed, 11 Sep 2024 20:01:13 +0200 Subject: [PATCH 2/7] hv-daemons-6.6.48.ebuild: use EAPI 8 Co-authored-by: Mathieu Tortuyaux --- .../app-emulation/hv-daemons/hv-daemons-6.6.48.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index ea9a5fbeb5..f4f5c7a2e3 100644 --- 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 @@ -1,7 +1,7 @@ # Copyright 2044-2016 The Flatcar Maintainers # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 COREOS_SOURCE_REVISION="" inherit coreos-kernel savedconfig systemd From 9e97a7811323f4e4a203e0d7c74abde17db325c2 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 12 Sep 2024 09:30:25 +0200 Subject: [PATCH 3/7] hv-daemons: clean-up, version bump for oem-azure Signed-off-by: Thilo Fromm --- .../app-emulation/hv-daemons/files/hv_kvp_daemon.service | 2 -- .../app-emulation/hv-daemons/files/hv_vss_daemon.service | 1 - .../app-emulation/hv-daemons/hv-daemons-6.6.48.ebuild | 1 - ...{oem-azure-2.9.1.1-r2.ebuild => oem-azure-2.9.1.1-r3.ebuild} | 0 4 files changed, 4 deletions(-) rename sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/{oem-azure-2.9.1.1-r2.ebuild => oem-azure-2.9.1.1-r3.ebuild} (100%) 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 index 2237a2b3db..40964cc02d 100644 --- 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 @@ -1,10 +1,8 @@ [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] 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 index 5587479a4c..ffccc5cd46 100644 --- 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 @@ -3,7 +3,6 @@ Description=Hyper-V VSS daemon ConditionPathExists=/dev/vmbus/hv_vss [Service] -Type=exec ExecStart=/usr/bin/hv_vss_daemon --no-daemon [Install] 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 index f4f5c7a2e3..eac339d8bf 100644 --- 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 @@ -2,7 +2,6 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=8 -COREOS_SOURCE_REVISION="" inherit coreos-kernel savedconfig systemd DESCRIPTION="HyperV guest support daemons." 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-r3.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.9.1.1-r2.ebuild rename to sdk_container/src/third_party/coreos-overlay/coreos-base/oem-azure/oem-azure-2.9.1.1-r3.ebuild From da588cbaf0b889fb68270f4d6a67dbaf40cda979 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 12 Sep 2024 10:28:31 +0200 Subject: [PATCH 4/7] hv-daemons: use symlink, add to kernel update workflow Signed-off-by: Thilo Fromm --- .github/workflows/kernel-apply-patch.sh | 10 +++++++++- .../app-emulation/hv-daemons/hv-daemons-6.6.50.ebuild | 1 + ...hv-daemons-6.6.48.ebuild => hv-daemons-9999.ebuild} | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 120000 sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/hv-daemons-6.6.50.ebuild rename sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/{hv-daemons-6.6.48.ebuild => hv-daemons-9999.ebuild} (93%) diff --git a/.github/workflows/kernel-apply-patch.sh b/.github/workflows/kernel-apply-patch.sh index 560e8e7e98..14c2216624 100755 --- a/.github/workflows/kernel-apply-patch.sh +++ b/.github/workflows/kernel-apply-patch.sh @@ -11,6 +11,7 @@ if ! check_remote_branch "linux-${VERSION_NEW}-${TARGET_BRANCH}"; then exit 0 fi +# Dive into ebuild repo section of SDK pushd "${SDK_OUTER_OVERLAY}" # trim the 3rd part in the input semver, e.g. from 5.4.1 to 5.4 @@ -31,6 +32,12 @@ for pkg in sources modules kernel; do popd done +# Update hyperv daemons ebuild soft-link to reflect new kernel version +find -D exec app-emulation/hv-daemons/ -type l -exec rm '{}' \; +ln -s app-emulation/hv-daemons/hv-daemons-9999.ebuild \ + app-emulation/hv-daemons/hv-daemons-${VERSION_NEW}.ebuild + +# Leave ebuild repo section of SDK popd function get_lwn_link() { @@ -72,7 +79,8 @@ generate_update_changelog 'Linux' "${VERSION_NEW}" "${URL}" 'linux' "${OLD_VERSI commit_changes sys-kernel/coreos-sources "${VERSION_OLD}" "${VERSION_NEW}" \ sys-kernel/coreos-modules \ - sys-kernel/coreos-kernel + sys-kernel/coreos-kernel \ + app-emulation/hv-daemons cleanup_repo diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/hv-daemons-6.6.50.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/hv-daemons-6.6.50.ebuild new file mode 120000 index 0000000000..95dcc24d68 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/hv-daemons-6.6.50.ebuild @@ -0,0 +1 @@ +hv-daemons-9999.ebuild \ No newline at end of file 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-9999.ebuild similarity index 93% rename from sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/hv-daemons-6.6.48.ebuild rename to sdk_container/src/third_party/coreos-overlay/app-emulation/hv-daemons/hv-daemons-9999.ebuild index eac339d8bf..9b6b44dba9 100644 --- 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-9999.ebuild @@ -2,11 +2,16 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=8 + inherit coreos-kernel savedconfig systemd DESCRIPTION="HyperV guest support daemons." KEYWORDS="amd64 arm64" +if [[ "${PV}" == 9999 ]]; then + KEYWORDS="~amd64 ~arm64" +fi + src_compile() { # Build hv_vss_daemon, hv_kvp_daemon, hv_fcopy_daemon kmake tools/hv From d74359b593e8cec5cd872415b3ad6b0de4aef57e Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 12 Sep 2024 12:11:13 +0200 Subject: [PATCH 5/7] changelog: add hv_daemons --- changelog/changes/2024-09-12-azure-hv-daemons.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/changes/2024-09-12-azure-hv-daemons.md diff --git a/changelog/changes/2024-09-12-azure-hv-daemons.md b/changelog/changes/2024-09-12-azure-hv-daemons.md new file mode 100644 index 0000000000..51fa66598a --- /dev/null +++ b/changelog/changes/2024-09-12-azure-hv-daemons.md @@ -0,0 +1 @@ +- azure-oem: Added hyperV daemons `kvp`, `vss`, and `fcopy` for better integration with the Azure hypervisor ([scripts#2309](https://github.com/flatcar/scripts/pull/2309)). From a821b47d9b2b0c6bc7aecd68b0e4143ef446f0a6 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 12 Sep 2024 12:17:43 +0200 Subject: [PATCH 6/7] hv-daemons: added to oem-hyperv, too --- changelog/changes/2024-09-12-azure-hv-daemons.md | 2 +- .../coreos-base/oem-hyperv/oem-hyperv-0.1.0-r1.ebuild | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog/changes/2024-09-12-azure-hv-daemons.md b/changelog/changes/2024-09-12-azure-hv-daemons.md index 51fa66598a..55c2d65053 100644 --- a/changelog/changes/2024-09-12-azure-hv-daemons.md +++ b/changelog/changes/2024-09-12-azure-hv-daemons.md @@ -1 +1 @@ -- azure-oem: Added hyperV daemons `kvp`, `vss`, and `fcopy` for better integration with the Azure hypervisor ([scripts#2309](https://github.com/flatcar/scripts/pull/2309)). +- oem-azure, oem-hyperv: Add daemons `kvp`, `vss`, and `fcopy` for better HyperV hypervisor integration with Flatcar guests ([scripts#2309](https://github.com/flatcar/scripts/pull/2309)). diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-hyperv/oem-hyperv-0.1.0-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-hyperv/oem-hyperv-0.1.0-r1.ebuild index b7b9e3d1a8..079bcd7984 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-hyperv/oem-hyperv-0.1.0-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-hyperv/oem-hyperv-0.1.0-r1.ebuild @@ -15,6 +15,10 @@ IUSE="" # no source directory S="${WORKDIR}" +RDEPEND=" + app-emulation/hv-daemons +" + src_prepare() { default sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \ From 27df4a936c2aada97f25b627bdb350a2bbaca53e Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 12 Sep 2024 16:19:59 +0200 Subject: [PATCH 7/7] azure-hv-daemons.md : improve changelog Co-authored-by: Mathieu Tortuyaux --- changelog/changes/2024-09-12-azure-hv-daemons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/changes/2024-09-12-azure-hv-daemons.md b/changelog/changes/2024-09-12-azure-hv-daemons.md index 55c2d65053..50595b42b1 100644 --- a/changelog/changes/2024-09-12-azure-hv-daemons.md +++ b/changelog/changes/2024-09-12-azure-hv-daemons.md @@ -1 +1 @@ -- oem-azure, oem-hyperv: Add daemons `kvp`, `vss`, and `fcopy` for better HyperV hypervisor integration with Flatcar guests ([scripts#2309](https://github.com/flatcar/scripts/pull/2309)). +- Azure, HyperV: Added daemons `kvp`, `vss`, and `fcopy` for better HyperV hypervisor integration with Flatcar guests ([scripts#2309](https://github.com/flatcar/scripts/pull/2309)).