-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into cancel-link
- Loading branch information
Showing
56 changed files
with
4,434 additions
and
2,024 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"storage": { | ||
"drives": [ | ||
{ | ||
"alias": "first-disk" | ||
}, | ||
{ | ||
"partitions": [ | ||
{ | ||
"alias": "pv1", | ||
"id": "lvm", | ||
"size": { "min": "10 GiB" } | ||
} | ||
] | ||
} | ||
], | ||
"volumeGroups": [ | ||
{ | ||
"name": "system", | ||
"physicalVolumes": ["pv1"], | ||
"logicalVolumes": [ | ||
{ | ||
"filesystem": { "path": "/" } | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "logs", | ||
"physicalVolumes": [ | ||
{ "generate": ["first-disk"] } | ||
] | ||
}, | ||
{ | ||
"name": "data", | ||
"physicalVolumes": [ | ||
{ | ||
"generate": { | ||
"targetDevices": ["first-disk"], | ||
"encryption": { | ||
"luks2": { "password": "12345" } | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! File transfer API for Agama. | ||
//! | ||
//! Implement a file transfer API which, in the future, will support Agama specific URLs. Check the | ||
//! YaST document about [URL handling in the | ||
//! installer](https://github.com/yast/yast-installation/blob/master/doc/url.md) for further | ||
//! information. | ||
//! | ||
//! At this point, it only supports those schemes supported by CURL. | ||
|
||
use std::io::Write; | ||
|
||
use curl::easy::Easy; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug)] | ||
#[error(transparent)] | ||
pub struct TransferError(#[from] curl::Error); | ||
pub type TransferResult<T> = Result<T, TransferError>; | ||
|
||
/// File transfer API | ||
pub struct Transfer {} | ||
|
||
impl Transfer { | ||
/// Retrieves and writes the data from an URL | ||
/// | ||
/// * `url`: URL to get the data from. | ||
/// * `out_fd`: where to write the data. | ||
pub fn get(url: &str, mut out_fd: impl Write) -> TransferResult<()> { | ||
let mut handle = Easy::new(); | ||
handle.url(url)?; | ||
|
||
let mut transfer = handle.transfer(); | ||
transfer.write_function(|buf| Ok(out_fd.write(buf).unwrap()))?; | ||
transfer.perform()?; | ||
Ok(()) | ||
} | ||
} |
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
Oops, something went wrong.