org.osbuild.mkfs.btrfs: add support for -m argument

Osbuild doesn't support creating btrfs over multiple devices, thus it should
be fine to have only single and dup in the schema (other options are for raid)
This commit is contained in:
Ondřej Budai 2023-05-18 12:38:36 +02:00 committed by Ondřej Budai
parent dae3f884bc
commit 3bbded4607
3 changed files with 12 additions and 1 deletions

View file

@ -37,6 +37,11 @@ SCHEMA_2 = r"""
"description": "Label for the file system",
"type": "string",
"maxLength": 256
},
"metadata": {
"description": "Profile for the metadata block groups",
"type": "string",
"enum": ["single", "dup"]
}
}
}
@ -48,11 +53,15 @@ def main(devices, options):
uuid = options["uuid"]
label = options.get("label")
metadata = options.get("metadata")
opts = []
if label:
opts = ["-L", label]
if metadata:
opts += ["-m", metadata]
subprocess.run(["mkfs.btrfs", "-U", uuid] + opts + [device],
encoding='utf8', check=True)

View file

@ -1105,7 +1105,8 @@
"type": "org.osbuild.mkfs.btrfs",
"options": {
"uuid": "6e4ff95f-f662-45ee-a82a-bdf44a2d0b75",
"label": "root"
"label": "root",
"metadata": "dup"
},
"devices": {
"device": {

View file

@ -166,6 +166,7 @@ pipelines:
options:
uuid: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75
label: root
metadata: dup
devices:
device:
type: org.osbuild.loopback