From b9f186df0cca72d4791fe36a961ddc021f9f123f Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Tue, 4 Mar 2025 16:15:19 -0500 Subject: [PATCH 1/2] cmd-osbuild: support new platforms when symlinked At some point we'll symlink all of the original cmd-buildextend* files to cmd-osbuild and we need this glue to make them work when they are symlinked. --- src/cmd-osbuild | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/cmd-osbuild b/src/cmd-osbuild index 2a1dbd33e8..8abd1c11de 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -255,6 +255,20 @@ main() { "cmd-buildextend-qemu-secex") platforms=(qemu-secex);; "cmd-buildextend-secex") platforms=(qemu-secex);; "cmd-buildextend-live") platforms=(live);; + "cmd-buildextend-aliyun") platforms=(aliyun);; + "cmd-buildextend-applehv") platforms=(applehv);; + "cmd-buildextend-aws") platforms=(aws);; + "cmd-buildextend-azure") platforms=(azure);; + "cmd-buildextend-azurestack") platforms=(azurestack);; + "cmd-buildextend-digitalocean") platforms=(digitalocean);; + "cmd-buildextend-exoscale") platforms=(exoscale);; + "cmd-buildextend-gcp") platforms=(gcp);; + "cmd-buildextend-hetzner") platforms=(hetzner);; + "cmd-buildextend-hyperv") platforms=(hyperv);; + "cmd-buildextend-ibmcloud") platforms=(ibmcloud);; + "cmd-buildextend-nutanix") platforms=(nutanix);; + "cmd-buildextend-openstack") platforms=(openstack);; + "cmd-buildextend-vultr") platforms=(vultr);; *) fatal "called as unexpected name $0";; esac From cea3d565fc29e0ac3ac8b8595c383a4694756b25 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Tue, 4 Mar 2025 16:16:54 -0500 Subject: [PATCH 2/2] osbuild: support building kubevirt disks --- src/cmd-osbuild | 5 +- .../coreos.osbuild.x86_64.mpp.yaml | 2 + .../platform.kubevirt.ipp.yaml | 107 ++++++++++++++++++ src/runvm-osbuild | 2 + 4 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 src/osbuild-manifests/platform.kubevirt.ipp.yaml diff --git a/src/cmd-osbuild b/src/cmd-osbuild index 8abd1c11de..956dee935e 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -19,6 +19,7 @@ declare -A SUPPORTED_PLATFORMS=( ['hetzner']='raw' ['hyperv']='vhdx' ['ibmcloud']='qcow2' + ['kubevirt']='ociarchive' ['metal4k']='raw' ['metal']='raw' ['nutanix']='qcow2' @@ -222,6 +223,7 @@ generate_runvm_osbuild_config() { # Generate the JSON describing the disk we want to build yaml2json /dev/stdin "${runvm_osbuild_config_json}" <amd64 and aarch64->arm64 for the image build. + architecture: + mpp-if: arch == 'x86_64' + then: amd64 + else: + mpp-if: arch == 'aarch64' + then: arm64 + else: + mpp-format-string: '{arch}' + filename: + mpp-format-string: '{artifact_name_prefix}-kubevirt.{arch}.ociarchive' + config: + Labels: + version: + mpp-format-string: '{build_version}' diff --git a/src/runvm-osbuild b/src/runvm-osbuild index a881f24e09..c68116af5f 100755 --- a/src/runvm-osbuild +++ b/src/runvm-osbuild @@ -60,6 +60,7 @@ do done artifact_name_prefix=$(getconfig_def "artifact-name-prefix" "custom-coreos") +build_version=$(getconfig_def "build-version" "0") ostree_container=$(getconfig "ostree-container") osname=$(getconfig "osname") deploy_via_container=$(getconfig_def "deploy-via-container" "") @@ -109,6 +110,7 @@ podman images > /dev/null set -x; osbuild-mpp \ -D arch=\""$(arch)"\" \ -D artifact_name_prefix=\""${artifact_name_prefix}"\" \ + -D build_version=\""${build_version}"\" \ -D ostree_ref=\""${ostree_ref}"\" \ -D ostree_repo=\""${ostree_repo}"\" \ -D ociarchive=\""${ostree_container}"\" \