mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
persist hostname in config overlay (#2769)
* persist hostname * add migration * fix version mismatch * remove dmesg logging from build
This commit is contained in:
@@ -10,6 +10,7 @@ use rpc_toolkit::yajrc::RpcError;
|
||||
use rpc_toolkit::{from_fn_async, Context, HandlerExt, ParentHandler};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::io::AsyncWriteExt;
|
||||
use tokio::process::Command;
|
||||
use tokio::try_join;
|
||||
use tracing::instrument;
|
||||
use ts_rs::TS;
|
||||
@@ -36,6 +37,7 @@ use crate::progress::{FullProgress, PhaseProgressTrackerHandle};
|
||||
use crate::rpc_continuations::Guid;
|
||||
use crate::util::crypto::EncryptedWire;
|
||||
use crate::util::io::{create_file, dir_copy, dir_size, Counter};
|
||||
use crate::util::Invoke;
|
||||
use crate::{Error, ErrorKind, ResultExt};
|
||||
|
||||
pub fn setup<C: Context>() -> ParentHandler<C> {
|
||||
@@ -336,6 +338,11 @@ pub async fn complete(ctx: SetupContext) -> Result<SetupResult, Error> {
|
||||
let mut guid_file = create_file("/media/startos/config/disk.guid").await?;
|
||||
guid_file.write_all(ctx.disk_guid.as_bytes()).await?;
|
||||
guid_file.sync_all().await?;
|
||||
Command::new("systemd-firstboot")
|
||||
.arg("--root=/media/startos/config/overlay/")
|
||||
.arg(format!("--hostname={}", res.hostname.0))
|
||||
.invoke(ErrorKind::ParseSysInfo)
|
||||
.await?;
|
||||
Ok(res.clone())
|
||||
}
|
||||
Some(Err(e)) => Err(e.clone_output()),
|
||||
|
||||
Reference in New Issue
Block a user