From 7ee8a579c808c72cf955178b19da5f4bf0f7eb19 Mon Sep 17 00:00:00 2001 From: Luke Yang Date: Tue, 6 Feb 2024 13:54:15 -0500 Subject: [PATCH] stages/org.osbuild.qemu: make qcow2 compression optional Modify the stages/org.osbuild.qemu stage such that compression is optional. This resolves the image size differences between an image built with coreos assember vs osbuild, as discussed in: coreos/fedora-coreos-tracker#1653 (comment) --- stages/org.osbuild.qemu | 11 ++++++++++- test/data/manifests/fedora-coreos-container.mpp.yaml | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/stages/org.osbuild.qemu b/stages/org.osbuild.qemu index 98a04f007c..4934fa1255 100755 --- a/stages/org.osbuild.qemu +++ b/stages/org.osbuild.qemu @@ -31,6 +31,11 @@ SCHEMA_2 = r""" "type": "string", "enum": ["qcow2"] }, + "compression": { + "description": "Disable compression of the qcow2 image", + "type": "boolean", + "default": true + }, "compat": { "description": "The qcow2-compatibility-version to use", "type": "string" @@ -140,9 +145,13 @@ SCHEMA_2 = r""" def qcow2_arguments(options): - argv = ["-c"] + argv = [] + compression = options.get("compression", True) compat = options.get("compat") + if compression: + argv += ["-c"] + if compat: argv += ["-o", f"compat={compat}"] return argv diff --git a/test/data/manifests/fedora-coreos-container.mpp.yaml b/test/data/manifests/fedora-coreos-container.mpp.yaml index d6f220d3e6..74da08d6d0 100644 --- a/test/data/manifests/fedora-coreos-container.mpp.yaml +++ b/test/data/manifests/fedora-coreos-container.mpp.yaml @@ -611,4 +611,5 @@ pipelines: filename: qemu.qcow2 format: type: qcow2 + compression: false compat: '1.1'