Skip to content

Commit

Permalink
stages/org.osbuild.qemu: make qcow2 compression optional
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
lukewarmtemp committed Feb 6, 2024
1 parent 151b6e4 commit 2f3c142
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion stages/org.osbuild.qemu
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ SCHEMA_2 = r"""
"description": "Create a qcow2 image",
"type": "object",
"required": ["type"],
"not": {"required": ["disable-compression", "compat"]},
"additionalProperties": false,
"properties": {
"type": {
"description": "The type of the format, here 'qcow2'",
"type": "string",
"enum": ["qcow2"]
},
"disable-compression": {
"description": "Disable compression of the qcow2 image",
"type": "boolean",
"enum": [true]
},
"compat": {
"description": "The qcow2-compatibility-version to use",
"type": "string"
Expand Down Expand Up @@ -140,9 +146,13 @@ SCHEMA_2 = r"""


def qcow2_arguments(options):
argv = ["-c"]
argv = []
disable_compression = options.get("disable-compression", False)
compat = options.get("compat")

if not disable_compression:
argv += ["-c"]

if compat:
argv += ["-o", f"compat={compat}"]
return argv
Expand Down
2 changes: 1 addition & 1 deletion test/data/manifests/fedora-coreos-container.mpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -611,4 +611,4 @@ pipelines:
filename: qemu.qcow2
format:
type: qcow2
compat: '1.1'
disable-compression: true

0 comments on commit 2f3c142

Please sign in to comment.