From 4f0e6097a6cfa662b55968d3558948269466c20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Iv=C3=A1n=20L=C3=B3pez=20Gonz=C3=A1lez?= Date: Mon, 15 Jul 2024 16:53:36 +0100 Subject: [PATCH] WIP --- rust/agama-lib/share/profile.schema.json | 134 +++++++++++++++++------ 1 file changed, 98 insertions(+), 36 deletions(-) diff --git a/rust/agama-lib/share/profile.schema.json b/rust/agama-lib/share/profile.schema.json index 04831d0a08..b549eaaa16 100644 --- a/rust/agama-lib/share/profile.schema.json +++ b/rust/agama-lib/share/profile.schema.json @@ -264,27 +264,33 @@ "type": "object", "additionalProperties": false, "properties": { + "search": { + "title": "Search a device by its name", + "$ref": "#/$defs/search" + }, "encrypt": { - "title": "", + "title": "Encryption options", + "description": "The device is encrypted only if the current partitions are deleted and no new partitions are created", "$ref": "#/$defs/encrypt" }, "format": { - "title": "", + "title": "Format options", + "description": "The device is formatted only if the current partitions are deleted and no new partitions are created", "$ref": "#/$defs/format" }, "mount": { - "title": "", + "title": "Mount options", + "description": "The device is mounted only if it is formatted", "$ref": "#/$defs/mount" }, "ptableType": { - "title": "", - "type": "enum" + "title": "The partition table is created only if all the current partitions are deleted", + "enum": ["gpt", "msdos", "dasd"] }, "partitions": { - "title": "", + "title": "Manage partitions", "type": "array", "items": { - "title": "", "$ref": "#/$defs/partition" } } @@ -462,35 +468,7 @@ }, "filesystem": { "title": "File system of the volume", - "anyOf": [ - { - "title": "File system type", - "enum": [ - "bcachefs", "btrfs", "exfat", "ext2", "ext3", "ext4", "f2fs", "jfs", - "nfs", "nilfs2", "ntfs", "reiserfs", "swap", "tmpfs", "vfat", "xfs" - ] - }, - { - "title": "Btrfs file system", - "description": "Indicates properties of the Btrfs file system", - "type": "object", - "additionalProperties": false, - "required": ["btrfs"], - "properties": { - "btrfs": { - "title": "Specification of a Btrfs file system", - "type": "object", - "additionalProperties": false, - "properties": { - "snapshots": { - "title": "Whether Btrfs snapshots should be configured", - "type": "boolean" - } - } - } - } - } - ] + "$ref": "#/$defs/filesystemValue" }, "size": { "title": "Size limits", @@ -623,6 +601,90 @@ { "$ref": "#/$defs/sizeString" }, { "$ref": "#/$defs/sizeInteger" } ] + }, + "filesystemValue": { + "anyOf": [ + { + "title": "File system type", + "enum": [ + "bcachefs", "btrfs", "exfat", "ext2", "ext3", "ext4", "f2fs", "jfs", + "nfs", "nilfs2", "ntfs", "reiserfs", "swap", "tmpfs", "vfat", "xfs" + ] + }, + { + "title": "Btrfs file system", + "description": "Indicates properties of the Btrfs file system", + "type": "object", + "additionalProperties": false, + "required": ["btrfs"], + "properties": { + "btrfs": { + "title": "Specification of a Btrfs file system", + "type": "object", + "additionalProperties": false, + "properties": { + "snapshots": { + "title": "Whether Btrfs snapshots should be configured", + "type": "boolean" + } + } + } + } + } + ] + }, + "search": { + "title": "Searching options", + "type": "object", + "additionalProperties": false, + "required": ["name"], + "properties": { + "name": { + "title": "Device name", + "type": "string" + } + } + }, + "encrypt": { + "title": "Encryption options", + "type": "object", + "additionalProperties": false, + "required": ["key"], + "properties": { + "key": { + "title": "Passphrase to use when creating new encryption devices", + "type": "string" + }, + "method": { + "title": "Method used to create the encryption devices", + "enum": ["luks2", "tpm_fde"] + }, + "pbkdFunction": { + "title": "Password-based key derivation function to use for LUKS2", + "enum": ["pbkdf2", "argon2i", "argon2id"] + } + } + }, + "format": { + "title": "Format options", + "type": "object", + "additionalProperties": false, + "required": ["filesystem"], + "properties": { + "filesystem": { + "title": "File system to use for formatting the device", + "$ref": "#/$defs/filesystemValue" + }, + "label": { + "title": "File system label", + "type": "string" + }, + "mkfsOptions": { + "title": "Options for creating the file system", + "type": "array", + "items": { "type": "string" } + } + } } } }