989 lines
30 KiB
JSON
989 lines
30 KiB
JSON
{
|
|
"$comment": "Based on doc/auto_storage.md",
|
|
"$schema": "https://json-schema.org/draft/2019-09/schema",
|
|
"$id": "https://github.com/agama-project/agama/blob/master/rust/agama-lib/share/storage.schema.json",
|
|
"title": "Config",
|
|
"description": "Storage config.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"boot": { "$ref": "#/$defs/boot" },
|
|
"drives": {
|
|
"description": "Drives (disks, BIOS RAIDs and multipath devices).",
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/driveElement" }
|
|
},
|
|
"volumeGroups": {
|
|
"description": "LVM volume groups.",
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/volumeGroup" }
|
|
},
|
|
"mdRaids": {
|
|
"description": "MD RAIDs.",
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/mdRaidElement" }
|
|
}
|
|
},
|
|
"$defs": {
|
|
"boot": {
|
|
"description": "Allows configuring boot partitions automatically.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["configure"],
|
|
"properties": {
|
|
"configure": {
|
|
"description": "Whether to configure partitions for booting.",
|
|
"type": "boolean"
|
|
},
|
|
"device": { "$ref": "#/$defs/alias" }
|
|
}
|
|
},
|
|
"driveElement": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/nonPartitionedDrive" },
|
|
{ "$ref": "#/$defs/partitionedDrive" }
|
|
]
|
|
},
|
|
"nonPartitionedDrive": {
|
|
"description": "Drive without a partition table (e.g., directly formatted).",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"search": { "$ref": "#/$defs/driveSearch" },
|
|
"alias": { "$ref": "#/$defs/alias" },
|
|
"encryption": { "$ref": "#/$defs/encryption" },
|
|
"filesystem": { "$ref": "#/$defs/filesystem" }
|
|
}
|
|
},
|
|
"partitionedDrive": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["partitions"],
|
|
"properties": {
|
|
"search": { "$ref": "#/$defs/driveSearch" },
|
|
"alias": { "$ref": "#/$defs/alias" },
|
|
"ptableType": { "$ref": "#/$defs/ptableType" },
|
|
"partitions": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/partitionElement" }
|
|
}
|
|
}
|
|
},
|
|
"mdRaidElement": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/nonPartitionedMdRaid" },
|
|
{ "$ref": "#/$defs/partitionedMdRaid" }
|
|
]
|
|
},
|
|
"nonPartitionedMdRaid": {
|
|
"description": "MD RAID without a partition table (e.g., directly formatted).",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"search": { "$ref": "#/$defs/mdRaidSearch" },
|
|
"alias": { "$ref": "#/$defs/alias" },
|
|
"name": { "$ref": "#/$defs/baseName" },
|
|
"level": { "$ref": "#/$defs/mdRaidLevel" },
|
|
"parity": { "$ref": "#/$defs/mdRaidParity" },
|
|
"chunkSize": { "$ref": "#/$defs/sizeValue" },
|
|
"devices": { "$ref": "#/$defs/mdRaidDevices" },
|
|
"encryption": { "$ref": "#/$defs/encryption" },
|
|
"filesystem": { "$ref": "#/$defs/filesystem" }
|
|
}
|
|
},
|
|
"partitionedMdRaid": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["partitions"],
|
|
"properties": {
|
|
"search": { "$ref": "#/$defs/mdRaidSearch" },
|
|
"alias": { "$ref": "#/$defs/alias" },
|
|
"name": { "$ref": "#/$defs/baseName" },
|
|
"level": { "$ref": "#/$defs/mdRaidLevel" },
|
|
"parity": { "$ref": "#/$defs/mdRaidParity" },
|
|
"chunkSize": { "$ref": "#/$defs/sizeValue" },
|
|
"devices": { "$ref": "#/$defs/mdRaidDevices" },
|
|
"ptableType": { "$ref": "#/$defs/ptableType" },
|
|
"partitions": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/partitionElement" }
|
|
}
|
|
}
|
|
},
|
|
"mdRaidLevel": {
|
|
"title": "MD level",
|
|
"enum": [
|
|
"raid0",
|
|
"raid1",
|
|
"raid5",
|
|
"raid6",
|
|
"raid10"
|
|
]
|
|
},
|
|
"mdRaidParity": {
|
|
"title": "MD parity",
|
|
"description": "Only applies to raid5, raid6 and raid10",
|
|
"enum": [
|
|
"left_asymmetric",
|
|
"left_symmetric",
|
|
"right_asymmetric",
|
|
"right_symmetric",
|
|
"first",
|
|
"last",
|
|
"near_2",
|
|
"offset_2",
|
|
"far_2",
|
|
"near_3",
|
|
"offset_3",
|
|
"far_3"
|
|
]
|
|
},
|
|
"mdRaidDevices": {
|
|
"description": "Devices used by the MD RAID.",
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/alias" }
|
|
},
|
|
"ptableType": {
|
|
"description": "Partition table type.",
|
|
"$comment": "The partition table is created only if all the current partitions are deleted.",
|
|
"enum": ["gpt", "msdos", "dasd"]
|
|
},
|
|
"partitionElement": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/simpleVolumesGenerator" },
|
|
{ "$ref": "#/$defs/advancedPartitionsGenerator" },
|
|
{ "$ref": "#/$defs/regularPartition" },
|
|
{ "$ref": "#/$defs/partitionToDelete" },
|
|
{ "$ref": "#/$defs/partitionToDeleteIfNeeded" }
|
|
]
|
|
},
|
|
"simpleVolumesGenerator": {
|
|
"description": "Automatically creates the default or mandatory volumes configured by the selected product.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["generate"],
|
|
"properties": {
|
|
"generate": {
|
|
"enum": ["default", "mandatory"]
|
|
}
|
|
}
|
|
},
|
|
"advancedPartitionsGenerator": {
|
|
"description": "Creates the default or mandatory partitions configured by the selected product.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["generate"],
|
|
"properties": {
|
|
"generate": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["partitions"],
|
|
"properties": {
|
|
"partitions": {
|
|
"enum": ["default", "mandatory"]
|
|
},
|
|
"encryption": { "$ref": "#/$defs/encryption" }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"regularPartition": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"search": { "$ref": "#/$defs/partitionSearch" },
|
|
"alias": { "$ref": "#/$defs/alias" },
|
|
"id": {
|
|
"title": "Partition id",
|
|
"enum": [
|
|
"linux",
|
|
"swap",
|
|
"lvm",
|
|
"raid",
|
|
"esp",
|
|
"prep",
|
|
"bios_boot"
|
|
]
|
|
},
|
|
"size": { "$ref": "#/$defs/size" },
|
|
"encryption": { "$ref": "#/$defs/encryption" },
|
|
"filesystem": { "$ref": "#/$defs/filesystem" }
|
|
}
|
|
},
|
|
"partitionToDelete": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["delete", "search"],
|
|
"properties": {
|
|
"search": { "$ref": "#/$defs/deletePartitionSearch" },
|
|
"delete": {
|
|
"description": "Delete the partition.",
|
|
"const": true
|
|
}
|
|
}
|
|
},
|
|
"partitionToDeleteIfNeeded": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["deleteIfNeeded", "search"],
|
|
"properties": {
|
|
"search": { "$ref": "#/$defs/deletePartitionSearch" },
|
|
"deleteIfNeeded": {
|
|
"description": "Delete the partition if needed to make space.",
|
|
"const": true
|
|
},
|
|
"size": { "$ref": "#/$defs/size" }
|
|
}
|
|
},
|
|
"volumeGroup": {
|
|
"description": "LVM volume group.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["name"],
|
|
"properties": {
|
|
"name": { "$ref": "#/$defs/baseName" },
|
|
"search": { "$ref": "#/$defs/volumeGroupSearch" },
|
|
"extentSize": { "$ref": "#/$defs/sizeValue" },
|
|
"physicalVolumes": {
|
|
"description": "Devices to use as physical volumes.",
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/physicalVolumeElement" }
|
|
},
|
|
"logicalVolumes": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/logicalVolumeElement" }
|
|
}
|
|
}
|
|
},
|
|
"physicalVolumeElement": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/alias" },
|
|
{ "$ref": "#/$defs/simplePhysicalVolumesGenerator" },
|
|
{ "$ref": "#/$defs/advancedPhysicalVolumesGenerator" }
|
|
]
|
|
},
|
|
"simplePhysicalVolumesGenerator": {
|
|
"description": "Automatically creates the needed physical volumes in the indicated devices.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["generate"],
|
|
"properties": {
|
|
"generate": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/alias" }
|
|
}
|
|
}
|
|
},
|
|
"advancedPhysicalVolumesGenerator": {
|
|
"description": "Automatically creates the needed physical volumes in the indicated devices.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["generate"],
|
|
"properties": {
|
|
"generate": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["targetDevices"],
|
|
"properties": {
|
|
"targetDevices": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/alias" }
|
|
},
|
|
"encryption": { "$ref": "#/$defs/encryption" }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"logicalVolumeElement": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/simpleVolumesGenerator" },
|
|
{ "$ref": "#/$defs/advancedLogicalVolumesGenerator" },
|
|
{ "$ref": "#/$defs/logicalVolume" },
|
|
{ "$ref": "#/$defs/thinPoolLogicalVolume" },
|
|
{ "$ref": "#/$defs/thinLogicalVolume" }
|
|
]
|
|
},
|
|
"advancedLogicalVolumesGenerator": {
|
|
"description": "Automatically creates the default or mandatory logical volumes configured by the selected product.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["generate"],
|
|
"properties": {
|
|
"generate": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["logicalVolumes"],
|
|
"properties": {
|
|
"logicalVolumes": {
|
|
"enum": ["default", "mandatory"]
|
|
},
|
|
"encryption": { "$ref": "#/$defs/encryption" },
|
|
"stripes": { "$ref": "#/$defs/logicalVolumeStripes" },
|
|
"stripeSize": { "$ref": "#/$defs/sizeValue" }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"logicalVolume": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"name": { "$ref": "#/$defs/baseName" },
|
|
"search": { "$ref": "#/$defs/logicalVolumeSearch" },
|
|
"size": { "$ref": "#/$defs/size" },
|
|
"stripes": { "$ref": "#/$defs/logicalVolumeStripes" },
|
|
"stripeSize": { "$ref": "#/$defs/sizeValue" },
|
|
"encryption": { "$ref": "#/$defs/encryption" },
|
|
"filesystem": { "$ref": "#/$defs/filesystem" }
|
|
}
|
|
},
|
|
"thinPoolLogicalVolume": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["pool"],
|
|
"properties": {
|
|
"pool": {
|
|
"description": "LVM thin pool.",
|
|
"const": true
|
|
},
|
|
"alias": { "$ref": "#/$defs/alias" },
|
|
"name": { "$ref": "#/$defs/baseName" },
|
|
"size": { "$ref": "#/$defs/size" },
|
|
"stripes": { "$ref": "#/$defs/logicalVolumeStripes" },
|
|
"stripeSize": { "$ref": "#/$defs/sizeValue" },
|
|
"encryption": { "$ref": "#/$defs/encryption" }
|
|
}
|
|
},
|
|
"thinLogicalVolume": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["usedPool"],
|
|
"properties": {
|
|
"name": { "$ref": "#/$defs/baseName" },
|
|
"size": { "$ref": "#/$defs/size" },
|
|
"usedPool": { "$ref": "#/$defs/alias" },
|
|
"encryption": { "$ref": "#/$defs/encryption" },
|
|
"filesystem": { "$ref": "#/$defs/filesystem" }
|
|
}
|
|
},
|
|
"logicalVolumeStripes": {
|
|
"description": "Number of stripes.",
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 128
|
|
},
|
|
"searchSortCriterionOrder": {
|
|
"description": "Direction of sorting at the search results",
|
|
"enum": ["asc", "desc"]
|
|
},
|
|
"driveSearch": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/searchAll" },
|
|
{ "$ref": "#/$defs/searchName" },
|
|
{ "$ref": "#/$defs/driveAdvancedSearch" }
|
|
]
|
|
},
|
|
"driveAdvancedSearch": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"condition": { "$ref": "#/$defs/driveSearchCondition" },
|
|
"sort": { "$ref": "#/$defs/driveSearchSort" },
|
|
"max": { "$ref": "#/$defs/searchMax" },
|
|
"ifNotFound": { "$ref": "#/$defs/searchActions" }
|
|
}
|
|
},
|
|
"driveSearchCondition": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/searchConditionName" },
|
|
{ "$ref": "#/$defs/searchConditionSize" }
|
|
]
|
|
},
|
|
"driveSearchSort": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/driveSearchSortCriterion" },
|
|
{
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/driveSearchSortCriterion" }
|
|
}
|
|
]
|
|
},
|
|
"driveSearchSortCriterion": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/driveSearchSortCriterionShort" },
|
|
{ "$ref": "#/$defs/driveSearchSortCriterionFull" }
|
|
]
|
|
},
|
|
"driveSearchSortCriterionShort": {
|
|
"enum": ["name", "size"]
|
|
},
|
|
"driveSearchSortCriterionFull": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"name": { "$ref": "#/$defs/searchSortCriterionOrder" },
|
|
"size": { "$ref": "#/$defs/searchSortCriterionOrder" }
|
|
},
|
|
"minProperties": 1,
|
|
"maxProperties": 1
|
|
},
|
|
"mdRaidSearch": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/searchAll" },
|
|
{ "$ref": "#/$defs/searchName" },
|
|
{ "$ref": "#/$defs/mdRaidAdvancedSearch" }
|
|
]
|
|
},
|
|
"mdRaidAdvancedSearch": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"condition": { "$ref": "#/$defs/mdRaidSearchCondition" },
|
|
"sort": { "$ref": "#/$defs/mdRaidSearchSort" },
|
|
"max": { "$ref": "#/$defs/searchMax" },
|
|
"ifNotFound": { "$ref": "#/$defs/searchCreatableActions" }
|
|
}
|
|
},
|
|
"mdRaidSearchCondition": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/searchConditionName" },
|
|
{ "$ref": "#/$defs/searchConditionSize" }
|
|
]
|
|
},
|
|
"mdRaidSearchSort": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/mdRaidSearchSortCriterion" },
|
|
{
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/mdRaidSearchSortCriterion" }
|
|
}
|
|
]
|
|
},
|
|
"mdRaidSearchSortCriterion": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/mdRaidSearchSortCriterionShort" },
|
|
{ "$ref": "#/$defs/mdRaidSearchSortCriterionFull" }
|
|
]
|
|
},
|
|
"mdRaidSearchSortCriterionShort": {
|
|
"enum": ["name", "size"]
|
|
},
|
|
"mdRaidSearchSortCriterionFull": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"name": { "$ref": "#/$defs/searchSortCriterionOrder" },
|
|
"size": { "$ref": "#/$defs/searchSortCriterionOrder" }
|
|
},
|
|
"minProperties": 1,
|
|
"maxProperties": 1
|
|
},
|
|
"volumeGroupSearch": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/searchAll" },
|
|
{ "$ref": "#/$defs/searchName" },
|
|
{ "$ref": "#/$defs/volumeGroupAdvancedSearch" }
|
|
]
|
|
},
|
|
"volumeGroupAdvancedSearch": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"condition": { "$ref": "#/$defs/volumeGroupSearchCondition" },
|
|
"sort": { "$ref": "#/$defs/volumeGroupSearchSort" },
|
|
"max": { "$ref": "#/$defs/searchMax" },
|
|
"ifNotFound": { "$ref": "#/$defs/searchCreatableActions" }
|
|
}
|
|
},
|
|
"volumeGroupSearchCondition": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/searchConditionName" },
|
|
{ "$ref": "#/$defs/searchConditionSize" }
|
|
]
|
|
},
|
|
"volumeGroupSearchSort": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/volumeGroupSearchSortCriterion" },
|
|
{
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/volumeGroupSearchSortCriterion" }
|
|
}
|
|
]
|
|
},
|
|
"volumeGroupSearchSortCriterion": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/volumeGroupSearchSortCriterionShort" },
|
|
{ "$ref": "#/$defs/volumeGroupSearchSortCriterionFull" }
|
|
]
|
|
},
|
|
"volumeGroupSearchSortCriterionShort": {
|
|
"enum": ["name", "size"]
|
|
},
|
|
"volumeGroupSearchSortCriterionFull": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"name": { "$ref": "#/$defs/searchSortCriterionOrder" },
|
|
"size": { "$ref": "#/$defs/searchSortCriterionOrder" }
|
|
},
|
|
"minProperties": 1,
|
|
"maxProperties": 1
|
|
},
|
|
"partitionSearch": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/searchAll" },
|
|
{ "$ref": "#/$defs/searchName" },
|
|
{ "$ref": "#/$defs/partitionAdvancedSearch" }
|
|
]
|
|
},
|
|
"partitionAdvancedSearch": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"condition": { "$ref": "#/$defs/partitionSearchCondition" },
|
|
"sort": { "$ref": "#/$defs/partitionSearchSort" },
|
|
"max": { "$ref": "#/$defs/searchMax" },
|
|
"ifNotFound": { "$ref": "#/$defs/searchCreatableActions" }
|
|
}
|
|
},
|
|
"deletePartitionSearch": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/searchAll" },
|
|
{ "$ref": "#/$defs/searchName" },
|
|
{ "$ref": "#/$defs/deletePartitionAdvancedSearch" }
|
|
]
|
|
},
|
|
"deletePartitionAdvancedSearch": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"condition": { "$ref": "#/$defs/partitionSearchCondition" },
|
|
"sort": { "$ref": "#/$defs/partitionSearchSort" },
|
|
"max": { "$ref": "#/$defs/searchMax" },
|
|
"ifNotFound": { "$ref": "#/$defs/searchActions" }
|
|
}
|
|
},
|
|
"partitionSearchCondition": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/searchConditionName" },
|
|
{ "$ref": "#/$defs/searchConditionSize" },
|
|
{ "$ref": "#/$defs/searchConditionPartitionNumber" }
|
|
]
|
|
},
|
|
"logicalVolumeSearch": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/searchAll" },
|
|
{ "$ref": "#/$defs/searchName" },
|
|
{ "$ref": "#/$defs/logicalVolumeAdvancedSearch" }
|
|
]
|
|
},
|
|
"logicalVolumeAdvancedSearch": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"condition": { "$ref": "#/$defs/logicalVolumeSearchCondition" },
|
|
"sort": { "$ref": "#/$defs/logicalVolumeSearchSort" },
|
|
"max": { "$ref": "#/$defs/searchMax" },
|
|
"ifNotFound": { "$ref": "#/$defs/searchCreatableActions" }
|
|
}
|
|
},
|
|
"logicalVolumeSearchCondition": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/searchConditionName" },
|
|
{ "$ref": "#/$defs/searchConditionSize" }
|
|
]
|
|
},
|
|
"searchConditionName": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["name"],
|
|
"properties": {
|
|
"name": { "$ref": "#/$defs/searchName" }
|
|
}
|
|
},
|
|
"searchConditionSize": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["size"],
|
|
"properties": {
|
|
"size": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/sizeValue" },
|
|
{ "$ref": "#/$defs/searchConditionSizeEqual" },
|
|
{ "$ref": "#/$defs/searchConditionSizeGreater" },
|
|
{ "$ref": "#/$defs/searchConditionSizeLess" }
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"searchConditionSizeEqual": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["equal"],
|
|
"properties": {
|
|
"equal": { "$ref": "#/$defs/sizeValue" }
|
|
}
|
|
},
|
|
"searchConditionSizeGreater": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["greater"],
|
|
"properties": {
|
|
"greater": { "$ref": "#/$defs/sizeValue" }
|
|
}
|
|
},
|
|
"searchConditionSizeLess": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["less"],
|
|
"properties": {
|
|
"less": { "$ref": "#/$defs/sizeValue" }
|
|
}
|
|
},
|
|
"searchConditionPartitionNumber": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["number"],
|
|
"properties": {
|
|
"number": {
|
|
"description": "Partition number (e.g., 1 for vda1).",
|
|
"type": "integer",
|
|
"minimum": 1
|
|
}
|
|
}
|
|
},
|
|
"partitionSearchSort": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/partitionSearchSortCriterion" },
|
|
{
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/partitionSearchSortCriterion" }
|
|
}
|
|
]
|
|
},
|
|
"partitionSearchSortCriterion": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/partitionSearchSortCriterionShort" },
|
|
{ "$ref": "#/$defs/partitionSearchSortCriterionFull" }
|
|
]
|
|
},
|
|
"partitionSearchSortCriterionShort": {
|
|
"enum": ["name", "size", "number"]
|
|
},
|
|
"partitionSearchSortCriterionFull": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"name": { "$ref": "#/$defs/searchSortCriterionOrder" },
|
|
"size": { "$ref": "#/$defs/searchSortCriterionOrder" },
|
|
"number": { "$ref": "#/$defs/searchSortCriterionOrder" }
|
|
},
|
|
"minProperties": 1,
|
|
"maxProperties": 1
|
|
},
|
|
"logicalVolumeSearchSort": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/logicalVolumeSearchSortCriterion" },
|
|
{
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/logicalVolumeSearchSortCriterion" }
|
|
}
|
|
]
|
|
},
|
|
"logicalVolumeSearchSortCriterion": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/logicalVolumeSearchSortCriterionShort" },
|
|
{ "$ref": "#/$defs/logicalVolumeSearchSortCriterionFull" }
|
|
]
|
|
},
|
|
"logicalVolumeSearchSortCriterionShort": {
|
|
"enum": ["name", "size", "number"]
|
|
},
|
|
"logicalVolumeSearchSortCriterionFull": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"name": { "$ref": "#/$defs/searchSortCriterionOrder" },
|
|
"size": { "$ref": "#/$defs/searchSortCriterionOrder" }
|
|
},
|
|
"minProperties": 1,
|
|
"maxProperties": 1
|
|
},
|
|
"searchMax": {
|
|
"description": "Maximum devices to match.",
|
|
"type": "integer",
|
|
"minimum": 1
|
|
},
|
|
"searchActions": {
|
|
"description": "How to handle the section if the device is not found.",
|
|
"enum": ["skip", "error"],
|
|
"default": "error"
|
|
},
|
|
"searchCreatableActions": {
|
|
"description": "How to handle the section if the device is not found.",
|
|
"enum": ["skip", "error", "create"],
|
|
"default": "error"
|
|
},
|
|
"searchAll": {
|
|
"description": "Shortcut to match all devices if there is any (equivalent to specify no conditions and to skip the entry if no device is found).",
|
|
"const": "*"
|
|
},
|
|
"searchName": {
|
|
"description": "Search by device name",
|
|
"type": "string",
|
|
"examples": ["/dev/vda", "/dev/disk/by-id/ata-WDC_WD3200AAKS-75L9"]
|
|
},
|
|
"alias": {
|
|
"description": "Alias used to reference a device.",
|
|
"type": "string"
|
|
},
|
|
"baseName": {
|
|
"description": "Device base name.",
|
|
"type": "string",
|
|
"pattern": "^[^/]+$",
|
|
"examples": ["system"]
|
|
},
|
|
"size": {
|
|
"title": "Size",
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/sizeValue" },
|
|
{
|
|
"title": "Size tuple",
|
|
"description": "Lower size limit and optionally upper size limit.",
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/sizeValueWithCurrent" },
|
|
"minItems": 1,
|
|
"maxItems": 2,
|
|
"examples": [
|
|
[1024, "current"],
|
|
["1 GiB", "5 GiB"],
|
|
[1024, "2 GiB"],
|
|
["2 GiB"]
|
|
]
|
|
},
|
|
{
|
|
"title": "Size range",
|
|
"description": "Size range.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["min"],
|
|
"properties": {
|
|
"min": { "$ref": "#/$defs/sizeValueWithCurrent" },
|
|
"max": { "$ref": "#/$defs/sizeValueWithCurrent" }
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"sizeValue": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/sizeString" },
|
|
{ "$ref": "#/$defs/sizeBytes" }
|
|
]
|
|
},
|
|
"sizeValueWithCurrent": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/sizeValue" },
|
|
{
|
|
"title": "Size current",
|
|
"description": "The current size of the device.",
|
|
"const": "current"
|
|
}
|
|
]
|
|
},
|
|
"sizeString": {
|
|
"description": "Human readable size.",
|
|
"type": "string",
|
|
"pattern": "^[0-9]+(\\.[0-9]+)?(\\s*([KkMmGgTtPpEeZzYy][iI]?)?[Bb])?$",
|
|
"examples": ["2 GiB", "1.5 TB", "1TIB", "1073741824 b", "1073741824"]
|
|
},
|
|
"sizeBytes": {
|
|
"description": "Size in bytes.",
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"examples": [1024, 2048]
|
|
},
|
|
"encryption": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/encryptionLuks1" },
|
|
{ "$ref": "#/$defs/encryptionLuks2" },
|
|
{ "$ref": "#/$defs/encryptionPervasiveLuks2" },
|
|
{ "$ref": "#/$defs/encryptionTPM" },
|
|
{ "$ref": "#/$defs/encryptionSwap" }
|
|
]
|
|
},
|
|
"encryptionLuks1": {
|
|
"description": "LUKS1 encryption.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["luks1"],
|
|
"properties": {
|
|
"luks1": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["password"],
|
|
"properties": {
|
|
"password": { "$ref": "#/$defs/encryptionPassword" },
|
|
"cipher": { "$ref": "#/$defs/encryptionCipher" },
|
|
"keySize": { "$ref": "#/$defs/encryptionKeySize" }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"encryptionLuks2": {
|
|
"description": "LUKS2 encryption.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["luks2"],
|
|
"properties": {
|
|
"luks2": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["password"],
|
|
"properties": {
|
|
"password": { "$ref": "#/$defs/encryptionPassword" },
|
|
"cipher": { "$ref": "#/$defs/encryptionCipher" },
|
|
"keySize": { "$ref": "#/$defs/encryptionKeySize" },
|
|
"pbkdFunction": { "$ref": "#/$defs/encryptionPbkdFunction" },
|
|
"label": {
|
|
"description": "LUKS2 label.",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"encryptionPervasiveLuks2": {
|
|
"description": "LUKS2 pervasive encryption.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["pervasiveLuks2"],
|
|
"properties": {
|
|
"pervasiveLuks2": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["password"],
|
|
"properties": {
|
|
"password": { "$ref": "#/$defs/encryptionPassword" }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"encryptionTPM": {
|
|
"description": "TPM-Based Full Disk Encryption.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["tpmFde"],
|
|
"properties": {
|
|
"tpmFde": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["password"],
|
|
"properties": {
|
|
"password": { "$ref": "#/$defs/encryptionPassword" }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"encryptionSwap": {
|
|
"description": "Swap encryptions.",
|
|
"enum": ["protected_swap", "secure_swap", "random_swap"]
|
|
},
|
|
"encryptionPassword": {
|
|
"description": "Password to use when creating a new encryption device.",
|
|
"type": "string"
|
|
},
|
|
"encryptionCipher": {
|
|
"description": "The value must be compatible with the --cipher argument of the command cryptsetup.",
|
|
"type": "string"
|
|
},
|
|
"encryptionKeySize": {
|
|
"description": "The value (in bits) has to be a multiple of 8. The possible key sizes are limited by the used cipher.",
|
|
"type": "integer"
|
|
},
|
|
"encryptionPbkdFunction": {
|
|
"enum": ["pbkdf2", "argon2i", "argon2id"]
|
|
},
|
|
"filesystem": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"reuseIfPossible": {
|
|
"description": "Try to reuse the existing file system. In some cases the file system could not be reused, for example, if the device is re-encrypted.",
|
|
"type": "boolean",
|
|
"default": false
|
|
},
|
|
"type": { "$ref": "#/$defs/filesystemType" },
|
|
"label": {
|
|
"description": "File system label.",
|
|
"type": "string"
|
|
},
|
|
"path": {
|
|
"description": "Mount path.",
|
|
"type": "string",
|
|
"examples": ["/var/log"]
|
|
},
|
|
"mountBy": {
|
|
"title": "Mount by",
|
|
"description": "How to mount the device.",
|
|
"enum": ["device", "id", "label", "path", "uuid"]
|
|
},
|
|
"mkfsOptions": {
|
|
"description": "Options for creating the file system.",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"mountOptions": {
|
|
"description": "Options to add to the fourth field of fstab.",
|
|
"type": "array",
|
|
"items": { "type": "string" }
|
|
}
|
|
}
|
|
},
|
|
"filesystemType": {
|
|
"anyOf": [
|
|
{ "$ref": "#/$defs/filesystemTypeAny" },
|
|
{ "$ref": "#/$defs/filesystemTypeBtrfs" }
|
|
]
|
|
},
|
|
"filesystemTypeAny": {
|
|
"enum": [
|
|
"bcachefs",
|
|
"btrfs",
|
|
"exfat",
|
|
"ext2",
|
|
"ext3",
|
|
"ext4",
|
|
"f2fs",
|
|
"jfs",
|
|
"nfs",
|
|
"nilfs2",
|
|
"ntfs",
|
|
"reiserfs",
|
|
"swap",
|
|
"tmpfs",
|
|
"vfat",
|
|
"xfs"
|
|
]
|
|
},
|
|
"filesystemTypeBtrfs": {
|
|
"description": "Btrfs file system.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["btrfs"],
|
|
"properties": {
|
|
"btrfs": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"snapshots": {
|
|
"description": "Whether to configrue Btrfs snapshots.",
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|