Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Sep 27, 2024
1 parent a80273d commit 7efe886
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
{
"name": "system",
"physicalVolumes": ["pv1"],
"extentSize": "8 MiB",
"logicalVolumes": ["default"]
"logicalVolumes": [
{ "generate": "default" }
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"drives": [
{
"partitions": [
"mandatory",
{
"alias": "pv1",
"id": "lvm",
Expand All @@ -14,16 +13,26 @@
],
"volumeGroups": [
{
"name": "data",
"name": "system",
"physicalVolumes": ["pv1"],
"extentSize": "8 MiB",
"logicalVolumes": [
{
"name": "photos",
"size": {
"min": "10 GiB"
},
"generate": {
"logicalVolumes": "mandatory",
"encryption": {
"luks2": {
"password": "12345"
}
},
"stripes": 10,
"stripeSize": "4 KiB"
}
},
{
"name": "data",
"size": "5 GiB",
"filesystem": {
"path": "/data",
"type": "xfs"
}
}
Expand Down
13 changes: 13 additions & 0 deletions rust/agama-lib/share/examples/storage/generate_partitions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"storage": {
"drives": [
{
"partitions": [
{
"generate": "mandatory"
}
]
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"storage": {
"drives": [
{
"partitions": [
{
"size": "10 GiB",
"filesystem": {
"type": "vfat"
}
},
{
"generate": {
"partitions": "default",
"encryption": {
"luks2": {
"password": "12345"
}
}
}
}
]
}
]
}
}
93 changes: 68 additions & 25 deletions rust/agama-lib/share/profile.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,33 @@
"items": {
"anyOf": [
{
"$ref": "#/$defs/defaultVolumes"
"$ref": "#/$defs/generateVolumes"
},
{
"$ref": "#/$defs/mandatoryVolumes"
"title": "Generate logical volumes",
"description": "Creates the default or mandatory logical volumes configured by the selected product, allowing to customize some properties.",
"type": "object",
"additionalProperties": false,
"properties": {
"generate": {
"type": "object",
"additionalProperties": false,
"properties": {
"logicalVolumes": {
"enum": ["default", "mandatory"]
},
"encryption": {
"$ref": "#/$defs/encryption"
},
"stripes": {
"$ref": "#/$defs/lvStripes"
},
"stripeSize": {
"$ref": "#/$defs/lvStripeSize"
}
}
}
}
},
{
"title": "Logical volume",
Expand All @@ -561,14 +584,10 @@
"$ref": "#/$defs/size"
},
"stripes": {
"title": "Number of stripes",
"type": "integer",
"minimum": 1,
"maximum": 128
"$ref": "#/$defs/lvStripes"
},
"stripeSize": {
"title": "Stripe size",
"$ref": "#/$defs/sizeValue"
"$ref": "#/$defs/lvStripeSize"
},
"encryption": {
"$ref": "#/$defs/encryption"
Expand Down Expand Up @@ -600,14 +619,10 @@
"$ref": "#/$defs/size"
},
"stripes": {
"title": "Number of stripes",
"type": "integer",
"minimum": 1,
"maximum": 128
"$ref": "#/$defs/lvStripes"
},
"stripeSize": {
"title": "Stripe size",
"$ref": "#/$defs/sizeValue"
"$ref": "#/$defs/lvStripeSize"
},
"encryption": {
"$ref": "#/$defs/encryption"
Expand Down Expand Up @@ -1212,26 +1227,44 @@
}
}
},
"defaultVolumes": {
"title": "Default volumes",
"description": "Creates the default volumes configured by the selected product.",
"const": "default"
},
"mandatoryVolumes": {
"title": "Mandatory volumes",
"description": "Creates the mandatory volumes configured by the selected product.",
"const": "mandatory"
"generateVolumes": {
"title": "Generate volumes automatically",
"description": "Creates the default or mandatory volumes configured by the selected product.",
"type": "object",
"additionalProperties": false,
"properties": {
"generate": {
"enum": ["default", "mandatory"]
}
}
},
"partitions": {
"title": "Partitions",
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/$defs/defaultVolumes"
"$ref": "#/$defs/generateVolumes"
},
{
"$ref": "#/$defs/mandatoryVolumes"
"title": "Generate partitions",
"description": "Creates the default or mandatory partitions configured by the selected product, allowing to customize some properties.",
"type": "object",
"additionalProperties": false,
"properties": {
"generate": {
"type": "object",
"additionalProperties": false,
"properties": {
"partitions": {
"enum": ["default", "mandatory"]
},
"encryption": {
"$ref": "#/$defs/encryption"
}
}
}
}
},
{
"title": "Partition to create or reuse",
Expand Down Expand Up @@ -1301,6 +1334,16 @@
}
]
}
},
"lvStripes": {
"title": "Number of stripes",
"type": "integer",
"minimum": 1,
"maximum": 128
},
"lvStripeSize": {
"title": "Stripe size",
"$ref": "#/$defs/sizeValue"
}
}
}

0 comments on commit 7efe886

Please sign in to comment.