From 616c1dc5542eb44f14e11d8aeb1b3328c565bfaf Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Tue, 12 Nov 2024 23:30:23 -0500 Subject: [PATCH] osbuild/hyperv: run through zip The artifact we create in the pipeline today is .vhdx.zip. Let's build on the work upstream in [1] and use the new OSBuild zip stage to encapsulate the artifact. [1] https://github.com/osbuild/osbuild/commit/ac8a2a4f309ca1d8619e600f4b677ae0641fcc44 --- src/cmd-osbuild | 4 ++-- src/osbuild-manifests/platform.hyperv.ipp.yaml | 17 ++++++++++++++++- src/vmdeps.txt | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/cmd-osbuild b/src/cmd-osbuild index 2d5f83e983..bc956a4bea 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -10,7 +10,7 @@ dn=$(dirname "$0") declare -A SUPPORTED_PLATFORMS=( ['applehv']='raw.gz' ['gcp']='tar.gz' - ['hyperv']='vhdx' + ['hyperv']='vhdx.zip' ['metal4k']='raw' ['metal']='raw' ['qemu']='qcow2' @@ -360,7 +360,7 @@ main() { # Perform postprocessing case "$platform" in - applehv|gcp) + applehv|gcp|hyperv) # Update the meta.json and builddir with the generated artifact. # Skip Compression on these platforms as they are already compressed. postprocess_artifact "${platform}" "${imgpath}" "${imgname}" 'True' diff --git a/src/osbuild-manifests/platform.hyperv.ipp.yaml b/src/osbuild-manifests/platform.hyperv.ipp.yaml index 82be371ffe..33bf5180f3 100644 --- a/src/osbuild-manifests/platform.hyperv.ipp.yaml +++ b/src/osbuild-manifests/platform.hyperv.ipp.yaml @@ -51,7 +51,7 @@ pipelines: partition: mpp-format-int: '{image.layout[''boot''].partnum}' target: /boot - - name: hyperv + - name: raw-hyperv-image-vhdx build: mpp-format-string: '{qemu_stage_buildroot}' stages: @@ -68,3 +68,18 @@ pipelines: mpp-format-string: '{artifact_name_prefix}-hyperv.{arch}.vhdx' format: type: vhdx + - name: hyperv + build: + mpp-format-string: '{qemu_stage_buildroot}' + stages: + - type: org.osbuild.zip + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-hyperv-image-vhdx + options: + level: 9 + filename: + mpp-format-string: '{artifact_name_prefix}-hyperv.{arch}.vhdx.zip' diff --git a/src/vmdeps.txt b/src/vmdeps.txt index 2115988e0e..97dd719fd5 100644 --- a/src/vmdeps.txt +++ b/src/vmdeps.txt @@ -37,7 +37,7 @@ tar podman # For running osbuild -osbuild osbuild-ostree osbuild-selinux osbuild-tools python3-pyrsistent +osbuild osbuild-ostree osbuild-selinux osbuild-tools python3-pyrsistent zip # For resetting the terminal inside supermin shell /usr/bin/reset