use correct serverconfig type

This commit is contained in:
Aiden McClelland
2024-03-25 15:47:22 -06:00
parent c782bab296
commit 2b3fddfe89

View File

@@ -7,6 +7,7 @@ use rpc_toolkit::{command, from_fn_async, AnyContext, HandlerExt, ParentHandler}
use serde::{Deserialize, Serialize};
use tokio::process::Command;
use crate::context::config::ServerConfig;
use crate::context::{CliContext, InstallContext};
use crate::disk::mount::filesystem::bind::Bind;
use crate::disk::mount::filesystem::block_dev::BlockDev;
@@ -23,14 +24,6 @@ use crate::ARCH;
mod gpt;
mod mbr;
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PostInstallConfig {
os_partitions: OsPartitionInfo,
ethernet_interface: String,
wifi_interface: Option<String>,
}
pub fn install() -> ParentHandler {
ParentHandler::new()
.subcommand("disk", disk())
@@ -263,10 +256,11 @@ pub async fn execute(
tokio::fs::write(
rootfs.path().join("config/config.yaml"),
IoFormat::Yaml.to_vec(&PostInstallConfig {
os_partitions: part_info.clone(),
ethernet_interface: eth_iface,
IoFormat::Yaml.to_vec(&ServerConfig {
os_partitions: Some(part_info.clone()),
ethernet_interface: Some(eth_iface),
wifi_interface: wifi_iface,
..Default::default()
})?,
)
.await?;