This commit is contained in:
Mikaël Cluseau
2026-06-11 12:08:42 +02:00
parent ee0ff1373f
commit 19193a9560
14 changed files with 95 additions and 94 deletions
+8 -6
View File
@@ -1,4 +1,4 @@
use eyre::{format_err, Result};
use eyre::{Result, format_err};
use log::{debug, info, warn};
use std::path::{Path, PathBuf};
use tokio::{
@@ -49,7 +49,7 @@ pub async fn bootstrap(cfg: Config) {
.await;
let sys_cfg: dkl::Config = retry(async || {
let sys_cfg_bytes = seed_config(base_dir, &bs, &verifier).await?;
let sys_cfg_bytes = seed_config(base_dir, bs, &verifier).await?;
Ok(serde_yaml::from_slice(&sys_cfg_bytes)?)
})
.await;
@@ -117,7 +117,7 @@ impl Verifier {
let pubkey = base64_decode(pubkey)?;
let pubkey = Some(pubkey);
return Ok(Self { pubkey });
Ok(Self { pubkey })
}
async fn verify_path(&self, path: impl AsRef<Path>) -> Result<Vec<u8>> {
@@ -311,7 +311,7 @@ impl LayerMounter<'_> {
.await
.map_err(|e| format_err!("write {}: {e}", tgt.display()))?;
let dm_name = &format!("system");
let dm_name = "system";
let mut cmd = tokio::process::Command::new("veritysetup");
cmd.arg("open")
@@ -504,8 +504,10 @@ async fn mount_filesystems(mounts: &[dkl::Mount], root: &str) {
}
async fn setup_root_user(user: &dkl::RootUser, root: &str) -> Result<()> {
if let Some(pw_hash) = user.password_hash.as_ref().filter(|v| !v.is_empty()) {
set_user_password("root", &pw_hash, root).await?;
if let Some(pw_hash) = user.password_hash.as_ref()
&& !pw_hash.is_empty()
{
set_user_password("root", pw_hash, root).await?;
}
let mut authorized_keys = Vec::new();