From a0fc0432ee4df18dfcf3d1434f403c0c933d5b4c Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Thu, 28 Aug 2025 15:56:20 +0200 Subject: [PATCH 1/3] overlay coreos-base/oem-hyperv: Turn it into sysext Signed-off-by: Krzesimir Nowak --- build_library/vm_image_util.sh | 9 ++++++--- ...10.ebuild => common-oem-files-0-r11.ebuild} | 1 + ...0.1.0-r1.ebuild => oem-hyperv-0.2.0.ebuild} | 18 ++++-------------- 3 files changed, 11 insertions(+), 17 deletions(-) rename sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/{common-oem-files-0-r10.ebuild => common-oem-files-0-r11.ebuild} (99%) rename sdk_container/src/third_party/coreos-overlay/coreos-base/oem-hyperv/{oem-hyperv-0.1.0-r1.ebuild => oem-hyperv-0.2.0.ebuild} (58%) diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index dce01f9c05..0190863083 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -299,12 +299,15 @@ IMG_hetzner_OEM_SYSEXT=oem-hetzner ## hyper-v IMG_hyperv_DISK_FORMAT=vhd -IMG_hyperv_OEM_PACKAGE=oem-hyperv +IMG_hyperv_OEM_USE=hyperv +IMG_hyperv_OEM_PACKAGE=common-oem-files +IMG_hyperv_OEM_SYSEXT=oem-hyperv ## hyper-v vhdx IMG_hyperv_vhdx_DISK_FORMAT=vhdx -IMG_hyperv_vhdx_OEM_PACKAGE=oem-hyperv - +IMG_hyperv_vhdx_OEM_USE=hyperv +IMG_hyperv_vhdx_OEM_PACKAGE=common-oem-files +IMG_hyperv_vhdx_OEM_SYSEXT=oem-hyperv ## cloudsigma IMG_cloudsigma_DISK_FORMAT=qcow2 diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r10.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r11.ebuild similarity index 99% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r10.ebuild rename to sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r11.ebuild index dbf575dbf3..d77890980e 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r10.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r11.ebuild @@ -48,6 +48,7 @@ ARM64_ONLY_OEMIDS=( AMD64_ONLY_OEMIDS=( digitalocean gce + hyperv vmware ) 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.2.0.ebuild similarity index 58% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/oem-hyperv/oem-hyperv-0.1.0-r1.ebuild rename to sdk_container/src/third_party/coreos-overlay/coreos-base/oem-hyperv/oem-hyperv-0.2.0.ebuild index 079bcd7984..99dd94e836 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.2.0.ebuild @@ -1,7 +1,7 @@ # Copyright (c) 2013 CoreOS, Inc.. All rights reserved. # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 DESCRIPTION="OEM suite for Hyper-V" HOMEPAGE="" @@ -12,21 +12,11 @@ SLOT="0" KEYWORDS="amd64" IUSE="" -# no source directory -S="${WORKDIR}" - RDEPEND=" app-emulation/hv-daemons " -src_prepare() { - default - sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \ - "${FILESDIR}/oem-release" > "${T}/oem-release" || die -} +OEM_NAME="Microsoft Hyper-V" -src_install() { - insinto "/oem" - doins "${FILESDIR}/grub.cfg" - doins "${T}/oem-release" -} +# no source directory +S="${WORKDIR}" From 41b3553153196295fa1e0bff955e32f96d5e5719 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 29 Aug 2025 15:18:10 +0200 Subject: [PATCH 2/3] build_library/disk_util: Fix a warning Python warns about an invalid escaped sequence (\s) within a string - make the string raw, so python stops treating backslashes as special characters. Signed-off-by: Krzesimir Nowak --- build_library/disk_util | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_library/disk_util b/build_library/disk_util index f94317e3c1..8550605a99 100755 --- a/build_library/disk_util +++ b/build_library/disk_util @@ -799,7 +799,7 @@ def Verity(options): '--hash-offset', part['fs_bytes'], loop_dev, loop_dev]).decode('utf8') print(verityout.strip()) - m = re.search("Root hash:\s+([a-f0-9]{64})$", verityout, re.IGNORECASE|re.MULTILINE) + m = re.search(r'Root hash:\s+([a-f0-9]{64})$', verityout, re.IGNORECASE|re.MULTILINE) if not m: raise Exception("Failed to parse verity output!") From 72840ecac701812e4489ff89ec4b113a21f267c6 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 29 Aug 2025 15:30:31 +0200 Subject: [PATCH 3/3] changelog: Add an entry Signed-off-by: Krzesimir Nowak --- changelog/changes/2025-08-29-hyperv-sysext.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/changes/2025-08-29-hyperv-sysext.md diff --git a/changelog/changes/2025-08-29-hyperv-sysext.md b/changelog/changes/2025-08-29-hyperv-sysext.md new file mode 100644 index 0000000000..066d933a37 --- /dev/null +++ b/changelog/changes/2025-08-29-hyperv-sysext.md @@ -0,0 +1 @@ +- Hyper-V images now use a systemd-sysext image for layering additional platform-specific software on top of `/usr`