-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storage): load storage config for guided proposal (#1293)
Add CLI support for setting and getting the storage config. ### Load (set) storage settings from a config file: ~~~ $ agama config load < config.json ~~~ * The given settings must match the JSON schema defined by #1263 (not finished yet). * The storage service calculates either a guided proposal or an AutoYaST proposal, depending on the given config. Config for a guided proposal: ~~~json { "storage": { "guided": { "target": { "disk": "/dev/vdc" } } } } ~~~ Config for an AutoYaST proposal: ~~~json { "legacyAutoyastStorage": [ { "device": "/dev/vdc", "use": "all" } ] } ~~~ ### Recover (get) the storage config: ~~~ $ agama config show > config.json $ agama config edit ~~~ NOTES * The storage service should check whether the given settings fulfill the JSON schema. * Checking the schema is not done yet because the schema definition is not finished.
- Loading branch information
Showing
29 changed files
with
1,770 additions
and
282 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
//! Representation of the storage settings | ||
|
||
use crate::install_settings::InstallSettings; | ||
use serde::{Deserialize, Serialize}; | ||
use serde_json::value::RawValue; | ||
|
||
/// Storage settings for installation | ||
#[derive(Debug, Default, Serialize, Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct StorageSettings { | ||
/// Whether LVM should be enabled | ||
pub lvm: Option<bool>, | ||
/// Encryption password for the storage devices (in clear text) | ||
pub encryption_password: Option<String>, | ||
/// Boot device to use in the installation | ||
pub boot_device: Option<String>, | ||
#[serde(default)] | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub storage: Option<Box<RawValue>>, | ||
#[serde(default, rename = "legacyAutoyastStorage")] | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub storage_autoyast: Option<Box<RawValue>>, | ||
} | ||
|
||
impl From<&InstallSettings> for StorageSettings { | ||
fn from(install_settings: &InstallSettings) -> Self { | ||
StorageSettings { | ||
storage: install_settings.storage.clone(), | ||
storage_autoyast: install_settings.storage_autoyast.clone(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
------------------------------------------------------------------- | ||
Wed Jun 26 10:29:05 UTC 2024 - José Iván López González <[email protected]> | ||
|
||
- Set and get storage config (gh#openSUSE/agama#1293). | ||
|
||
------------------------------------------------------------------- | ||
Tue Jun 25 15:16:33 UTC 2024 - Imobach Gonzalez Sosa <[email protected]> | ||
|
||
|
Oops, something went wrong.