diff --git a/rust/agama-lib/share/examples/storage.json b/rust/agama-lib/share/examples/storage.json index eba286eb4a..66fb372648 100644 --- a/rust/agama-lib/share/examples/storage.json +++ b/rust/agama-lib/share/examples/storage.json @@ -13,46 +13,36 @@ "partitions": [ { "search": { "name": "/dev/vda2" }, - "format": { - "filesystem": { - "btrfs": { - "snapshots": true - } - } - }, - "mount": { + "filesystem": { + "reuse": false, + "type": "btrfs", + "btrfsOptions": { + "snapshots": true + }, "path": "/", - "options": ["ro"] + "mountOptions": ["ro"] } }, { - "create": { - "id": "linux", - "size": "10 GiB" - }, - "encrypt": { - "password": "notsecret", + "id": "linux", + "size": "10 GiB", + "encryption": { + "key": "notsecret", "method": "luks2" }, - "format": { - "filesystem": "xfs" - }, - "mount": { + "filesystem": { + "type": "xfs", "path": "/home" } }, { - "create": { - "size": "2 GiB" - }, - "encrypt": { - "password": "notsecret", + "size": "2 GiB", + "encryption": { + "key": "notsecret", "method": "luks2" }, - "format": { - "filesystem": "swap" - }, - "mount": { + "filesystem": { + "type": "swap", "path": "swap" } } @@ -62,14 +52,12 @@ "search": { "name": "/dev/vdb" }, - "encrypt": { - "password": "notsecret", + "encryption": { + "key": "notsecret", "method": "luks2" }, - "format": { - "filesystem": "ext4" - }, - "mount": { + "filesystem": { + "type": "ext4", "path": "/var/log" } } diff --git a/rust/agama-lib/share/profile.schema.json b/rust/agama-lib/share/profile.schema.json index e92fed3fab..f2a1d9b4d6 100644 --- a/rust/agama-lib/share/profile.schema.json +++ b/rust/agama-lib/share/profile.schema.json @@ -252,7 +252,7 @@ } }, "storage": { - "title": "Storage settings", + "title": "Storage settings.", "type": "object", "additionalProperties": false, "properties": { @@ -260,75 +260,89 @@ "$ref": "#/$defs/boot" }, "drives": { - "title": "Section describing drives (disks, BIOS RAIDs and multipath devices)", + "title": "Section describing drives (disks, BIOS RAIDs and multipath devices).", "type": "array", "items": { - "title": "Drive description", - "type": "object", - "additionalProperties": false, - "properties": { - "search": { - "description": "The search is applied only to drive devices", - "$ref": "#/$defs/search" - }, - "encrypt": { - "description": "The device is encrypted only if the current partitions are deleted and no new partitions are created", - "$ref": "#/$defs/encrypt" - }, - "format": { - "description": "The device is formatted only if the current partitions are deleted and no new partitions are created", - "$ref": "#/$defs/format" - }, - "mount": { - "description": "The device is mounted only if it is formatted", - "$ref": "#/$defs/mount" - }, - "ptableType": { - "title": "Partition table type", - "description": "The partition table is created only if all the current partitions are deleted", - "enum": ["gpt", "msdos", "dasd"] + "title": "Drive description.", + "anyOf": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "search": { + "description": "The search is limited to drives scope.", + "$ref": "#/$defs/search" + }, + "encryption": { + "$ref": "#/$defs/encryption" + }, + "filesystem": { + "description": "The partition table (if any) is deleted.", + "$ref": "#/$defs/filesystem" + } + } }, - "partitions": { - "$ref": "#/$defs/partitions" + { + "type": "object", + "additionalProperties": false, + "properties": { + "search": { + "description": "The search is limited to drives scope.", + "$ref": "#/$defs/search" + }, + "encryption": { + "$ref": "#/$defs/encryption" + }, + "ptableType": { + "title": "Partition table type.", + "description": "The partition table is created only if all the current partitions are deleted.", + "enum": ["gpt", "msdos", "dasd"] + }, + "partitions": { + "$ref": "#/$defs/partitions" + } + } } - } + ] } }, "guided": { - "title": "Settings to execute a Guided Proposal", + "title": "Settings to execute a Guided Proposal.", "type": "object", "additionalProperties": false, "properties": { "target": { - "title": "Target device", + "title": "Target device.", "anyOf": [ { "enum": ["disk", "newLvmVg"] }, { - "title": "Disk device for installing", + "title": "Disk device for installing.", "type": "object", "additionalProperties": false, "required": ["disk"], "properties": { "disk": { - "title": "Disk device name (e.g., '/dev/vda')", - "type": "string" + "title": "Disk device name.", + "type": "string", + "examples": ["/dev/vda"] } } }, { - "title": "New LVM for installing", + "title": "New LVM for installing.", "type": "object", "additionalProperties": false, "required": ["newLvmVg"], "properties": { "newLvmVg": { - "title": "Devices in which to create the physical volumes", + "title": "Devices in which to create the physical volumes.", "type": "array", "items": { - "title": "Disk device name (e.g., '/dev/vda')", - "type": "string" + "title": "Disk device name.", + "type": "string", + "examples": ["/dev/vda"] } } } @@ -339,10 +353,25 @@ "$ref": "#/$defs/boot" }, "encryption": { - "$ref": "#/$defs/encrypt" + "title": "Encryption options.", + "type": "object", + "additionalProperties": false, + "required": ["password"], + "properties": { + "password": { + "title": "Passphrase to use when creating a new encryption device.", + "type": "string" + }, + "method": { + "$ref": "#/$defs/encryptionMethod" + }, + "pbkdFunction": { + "$ref": "#/$defs/encryptionPbkdFunction" + } + } }, "space": { - "title": "Policy to find space for the new partitions", + "title": "Policy to find space for the new partitions.", "type": "object", "additionalProperties": false, "properties": { @@ -362,33 +391,35 @@ "required": ["policy", "actions"], "properties": { "actions": { - "title": "Actions to find space if policy is 'custom'", + "title": "Actions to find space if policy is 'custom'.", "type": "array", "items": { "anyOf": [ { - "title": "Delete device", - "description": "Force device deletion", + "title": "Delete device.", + "description": "Force device deletion.", "type": "object", "required": ["forceDelete"], "additionalProperties": false, "properties": { "forceDelete": { - "title": "Device to delete (e.g., '/dev/vda')", - "type": "string" + "title": "Device to delete.", + "type": "string", + "examples": ["/dev/vda"] } } }, { - "title": "Allow shinking", - "description": "Indicate the device can be shrunk in needed", + "title": "Allow shinking.", + "description": "Indicate the device can be shrunk in needed.", "type": "object", "required": ["resize"], "additionalProperties": false, "properties": { "resize": { - "title": "Device to allow resizing (e.g., '/dev/vda')", - "type": "string" + "title": "Device to allow resizing", + "type": "string", + "examples": ["/dev/vda"] } } } @@ -408,7 +439,7 @@ } }, "volumes": { - "title": "Set of volumes (file systems) to create", + "title": "Set of volumes (file systems) to create.", "type": "array", "items": { "type": "object", @@ -416,109 +447,105 @@ "required": ["mount"], "properties": { "mount": { - "$ref": "#/$defs/mount" + "title": "Mount options.", + "type": "object", + "additionalProperties": false, + "required": ["path"], + "properties": { + "path": { + "title": "Mount path.", + "type": "string", + "examples": ["/dev/vda"] + }, + "options": { + "title": "Options to add to the fourth field of fstab.", + "type": "array", + "items": { "type": "string" } + } + } }, "filesystem": { - "title": "File system of the volume", - "$ref": "#/$defs/filesystemValue" - }, - "size": { - "title": "Size limits", - "description": "Options to indicate the size of a device", + "title": "File system of the volume.", "anyOf": [ { - "title": "Automatic size", - "description": "The size is auto calculated according to the product", - "const": "auto" - }, - { - "title": "Size unit", - "$ref": "#/$defs/sizeValue" - }, - { - "title": "Size range (e.g., [1024, '2 GiB'])", - "description": "Lower size limit and optionally upper size limit", - "type": "array", - "items": { - "$ref": "#/$defs/sizeValue" - }, - "minItems": 1, - "maxItems": 2 + "$ref": "#/$defs/filesystemType" }, { - "title": "Size range", + "title": "Btrfs file system.", "type": "object", "additionalProperties": false, + "required": ["btrfs"], "properties": { - "min": { - "title": "Mandatory lower size limit", - "$ref": "#/$defs/sizeValue" - }, - "max": { - "title": "Optional upper size limit", - "$ref": "#/$defs/sizeValue" + "btrfs": { + "$ref": "#/$defs/btrfsOptions" } - }, - "required": ["min"] + } } ] }, + "size": { + "$ref": "#/$defs/size" + }, "target": { - "title": "Location of the file system", - "description": "Options to indicate the location of a file system", + "title": "Location of the file system.", + "description": "Options to indicate the location of a file system.", "anyOf": [ { "const": "default" }, { - "title": "New partition", - "description": "The file system is created over a new partition", + "title": "New partition.", + "description": "The file system is created over a new partition.", "type": "object", "required": ["newPartition"], "additionalProperties": false, "properties": { "newPartition": { - "title": "Name of a disk device (e.g., '/dev/vda')", - "type": "string" + "title": "Name of a disk device.", + "type": "string", + "examples": ["/dev/vda"] } } }, { - "title": "Dedicated LVM volume group", - "description": "The file system is created over a dedicated LVM", + "title": "Dedicated LVM volume group.", + "description": "The file system is created over a dedicated LVM.", "type": "object", "additionalProperties": false, "required": ["newVg"], "properties": { "newVg": { - "title": "Name of a disk device (e.g., '/dev/vda')", - "type": "string" + "title": "Name of a disk device.", + "type": "string", + "examples": ["/dev/vda"] } } }, { - "title": "Re-used existing device", - "description": "The file system is created over an existing device", + "title": "Re-used existing device.", + "description": "The file system is created over an existing device.", "type": "object", "additionalProperties": false, "required": ["device"], "properties": { "device": { - "title": "Name of a device (e.g., '/dev/vda1')", - "type": "string" + "title": "Name of a device.", + "type": "string", + "examples": ["/dev/vda1"] } } }, { - "title": "Re-used existing file system", - "description": "An existing file system is reused (without formatting)", + "title": "Re-used existing file system.", + "description": "An existing file system is reused (without formatting).", "type": "object", "additionalProperties": false, "required": ["filesystem"], "properties": { "filesystem": { - "title": "Name of a device containing the file system (e.g., '/dev/vda1')", - "type": "string" + "title": "Name of a device containing the file system.", + "type": "string", + "examples": ["/dev/vda1"] } } } @@ -559,165 +586,198 @@ { "$ref": "#/$defs/sizeInteger" } ] }, - "filesystemValue": { + "size": { + "title": "Size options.", "anyOf": [ { - "title": "File system type", - "enum": [ - "bcachefs", "btrfs", "exfat", "ext2", "ext3", "ext4", "f2fs", "jfs", - "nfs", "nilfs2", "ntfs", "reiserfs", "swap", "tmpfs", "vfat", "xfs" - ] + "title": "Automatic size.", + "description": "The size is auto calculated according to the product.", + "const": "auto" }, { - "title": "Btrfs file system", - "description": "Indicates properties of the Btrfs file system", + "title": "Size unit.", + "$ref": "#/$defs/sizeValue" + }, + { + "title": "Size range.", + "description": "Lower size limit and optionally upper size limit.", + "type": "array", + "items": { + "$ref": "#/$defs/sizeValue" + }, + "minItems": 1, + "maxItems": 2, + "examples": [[1024, 2048], ["1 GiB", "5 GiB"], [1024, "2 GiB"], ["2 GiB"]] + }, + { + "title": "Size range.", "type": "object", "additionalProperties": false, - "required": ["btrfs"], + "required": ["min"], "properties": { - "btrfs": { - "title": "Specification of a Btrfs file system", - "type": "object", - "additionalProperties": false, - "properties": { - "snapshots": { - "title": "Whether Btrfs snapshots should be configured", - "type": "boolean" - } - } + "min": { + "title": "Mandatory lower size limit.", + "$ref": "#/$defs/sizeValue" + }, + "max": { + "title": "Optional upper size limit.", + "$ref": "#/$defs/sizeValue" } } } ] }, - "boot": { - "title": "Boot options", + "search": { + "title": "Search options", "type": "object", "additionalProperties": false, - "required": ["configure"], + "required": ["name"], "properties": { - "configure": { - "title": "Whether to configure partitions for booting", - "type": "boolean" - }, - "device": { - "title": "Device to use for booting", - "description": "The installation device is used by default for booting", + "name": { + "title": "Device name", "type": "string", "examples": ["/dev/vda"] } } }, - "search": { - "title": "Search options", + "boot": { + "title": "Boot options.", "type": "object", "additionalProperties": false, - "required": ["name"], + "required": ["configure"], "properties": { - "name": { - "title": "Device name", + "configure": { + "title": "Whether to configure partitions for booting.", + "type": "boolean" + }, + "device": { + "title": "Device to use for booting.", + "description": "The installation device is used by default for booting.", "type": "string", "examples": ["/dev/vda"] } } }, - "encrypt": { - "title": "Encryption options", + "encryptionMethod": { + "title": "Method used to create the encryption device.", + "enum": ["luks2", "tpm_fde"] + }, + "encryptionPbkdFunction": { + "title": "Password-based key derivation function to use for LUKS2.", + "enum": ["pbkdf2", "argon2i", "argon2id"] + }, + "encryption": { + "title": "Encryption options.", "type": "object", "additionalProperties": false, - "required": ["password"], + "required": ["key"], "properties": { - "password": { - "title": "Passphrase to use when creating a new encryption device", + "key": { + "title": "Passphrase to use when creating a new encryption device.", "type": "string" }, "method": { - "title": "Method used to create the encryption device", - "enum": ["luks2", "tpm_fde"] + "$ref": "#/$defs/encryptionMethod" }, "pbkdFunction": { - "title": "Password-based key derivation function to use for LUKS2", - "enum": ["pbkdf2", "argon2i", "argon2id"] + "$ref": "#/$defs/encryptionPbkdFunction" + }, + "label": { + "title": "LUKS label for the encrypted device.", + "type": "string" + }, + "cipher": { + "title": "Cipher used for LUKS encryption.", + "description": "The value must be compatible with the --cipher argument of the command cryptsetup.", + "type": "string" + }, + "key_size": { + "title": "Key size, in bits, used for LUKS encryption.", + "description": "The value has to be a multiple of 8. The possible key sizes are limited by the used cipher.", + "type": "integer" } } }, - "format": { - "title": "Format options", + "filesystemType": { + "title": "File system type.", + "enum": [ + "bcachefs", "btrfs", "exfat", "ext2", "ext3", "ext4", "f2fs", "jfs", + "nfs", "nilfs2", "ntfs", "reiserfs", "swap", "tmpfs", "vfat", "xfs" + ] + }, + "btrfsOptions": { + "title": "Btrfs file system 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" } + "snapshots": { + "title": "Whether Btrfs snapshots should be configured.", + "type": "boolean" } } }, - "mount": { - "title": "Mount options", + "filesystem": { + "title": "File system options.", "type": "object", "additionalProperties": false, - "required": ["path"], "properties": { + "reuse": { + "title": "Whether to reuse the existing file system (if any).", + "type": "boolean", + "default": false + }, + "type": { + "$ref": "#/$defs/filesystemType" + }, + "label": { + "title": "File system label.", + "type": "string" + }, "path": { - "title": "Mount path", + "title": "Mount path.", "type": "string", "examples": ["/dev/vda"] }, - "options": { - "title": "Options to add to the fourth field of fstab", + "btrfsOptions": { + "$ref": "#/$defs/btrfsOptions" + }, + "mkfsOptions": { + "title": "Options for creating the file system.", + "type": "array", + "items": { "type": "string" } + }, + "mountOptions": { + "title": "Options to add to the fourth field of fstab.", "type": "array", "items": { "type": "string" } } } }, "partitions": { - "title": "Partitions to create, reuse or delete", + "title": "Partitions to create, reuse or delete.", "type": "array", "items": { - "title": "Partition options", + "title": "Partition options.", "type": "object", "additionalProperties": false, "properties": { "search": { - "description": "The search is applied only to the partitions of the selected device", + "description": "The search is limited to the partitions of the selected device scope.", "$ref": "#/$defs/search" }, - "create": { - "title": "Options to create the partition", - "description": "These options are ignored if the partition already exists", - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "title": "Partition ID", - "enum": ["linux", "swap", "lvm", "raid", "esp", "prep", "biosBoot"] - }, - "size": { - "title": "Partition size", - "$ref": "#/$defs/sizeValue" - } - } + "id": { + "title": "Partition ID.", + "enum": ["linux", "swap", "lvm", "raid", "esp", "prep", "bios_boot"] }, - "encrypt": { - "description": "The partition is encrypted only if it is going to be created", - "$ref": "#/$defs/encrypt" + "size": { + "$ref": "#/$defs/sizeValue", + "title": "Partition size." }, - "format": { - "$ref": "#/$defs/format" + "encryption": { + "$ref": "#/$defs/encryption" }, - "mount": { - "description": "The partition is mounted only if it is formatted", - "$ref": "#/$defs/mount" + "filesystem": { + "$ref": "#/$defs/filesystem" } } }