diff --git a/stages/org.osbuild.experimental.ostree.config b/stages/org.osbuild.experimental.ostree.config new file mode 100755 index 00000000..5b8bec63 --- /dev/null +++ b/stages/org.osbuild.experimental.ostree.config @@ -0,0 +1,64 @@ +#!/usr/bin/python3 +""" +Change OSTree configuration experimental options + +NOTE: This stage is experimental and subject to changes + +Change the configuration for an OSTree repository. +Currently only the following values are supported: + - `integrity.composefs` + +See `ostree.repo-config(5)` for more information. +""" + +import os +import sys + +import osbuild.api +from osbuild.util import ostree + +SCHEMA = """ +"additionalProperties": false, +"required": ["repo"], +"properties": { + "repo": { + "description": "Location of the OSTree repo.", + "type": "string" + }, + "config": { + "type": "object", + "additionalProperties": false, + "description": "OSTree configuration groups", + "properties": { + "integrity": { + "type": "object", + "additionalProperties": false, + "description": "Options concerning the sysroot", + "properties": { + "composefs": { + "description": "Enable composefs image generation on deploy.", + "type": "string", + "enum": ["true", "false", "maybe"] + } + } + } + } + } +} +""" + + +def main(tree, options): + repo = os.path.join(tree, options["repo"].lstrip("/")) + integrity_options = options["config"].get("integrity", {}) + + composefs = integrity_options.get("composefs") + if composefs is not None: + ostree.cli("config", "set", "ex-integrity.composefs", composefs, repo=repo) + + +if __name__ == '__main__': + stage_args = osbuild.api.arguments() + r = main(stage_args["tree"], + stage_args["options"]) + sys.exit(r)