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 7, 2024
1 parent 6e12f08 commit 94c8d51
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
23 changes: 21 additions & 2 deletions stages/org.osbuild.qemu
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ SCHEMA_2 = r"""
"type": "string",
"enum": ["qcow2"]
},
"compression": {
"description": "Enable/disable compression of the qcow2 image",
"type": "boolean",
"default": true
},
"compat": {
"description": "The qcow2-compatibility-version to use",
"type": "string"
Expand Down Expand Up @@ -61,6 +66,11 @@ SCHEMA_2 = r"""
"type": "string",
"enum": ["vmdk"]
},
"compression": {
"description": "Enable/disable compression of the vmdk image",
"type": "boolean",
"default": true
},
"subformat": {
"description": "VMDK flat extent format",
"type": "string",
Expand Down Expand Up @@ -140,17 +150,26 @@ 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


def vmdk_arguments(options):
argv = ["-c"]
argv = []
compression = options.get("compression", True)
subformat = options.get("subformat")

if compression:
argv += ["-c"]

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

0 comments on commit 94c8d51

Please sign in to comment.