From 78794c567e7b33984963cc768b97c5e1003e5d9f Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sun, 5 Jan 2025 08:48:33 +0100 Subject: [PATCH] fix --- src/install/security.rs | 31 +++++++++++++++++++++++++++---- src/pkg.rs | 2 +- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/install/security.rs b/src/install/security.rs index 2f4d140..41d6f15 100644 --- a/src/install/security.rs +++ b/src/install/security.rs @@ -16,21 +16,44 @@ pub fn setup_tpm_unlock(conf: &DriveConfig) { // Recovery Key let recovery_key = arch_chroot( - &["systemd-cryptenroll", "--recovery-key", &conf.root], - Some(&format!("{}\n", conf.encryption.as_ref().unwrap())), + &vec![ + "systemd-run", + "--pipe", + "--collect", + "-p", + format!( + "SetCredential=cryptenroll.passphrase:{}", + conf.encryption.as_ref().unwrap() + ) + .as_str(), + "systemd-cryptenroll", + "--recovery-key", + &conf.root, + ], + None, false, ) .0; + install_file("/mnt/root/recovery.key", &recovery_key, 0o400); arch_chroot( - &[ + &vec![ + "systemd-run", + "--pipe", + "--collect", + "-p", + format!( + "SetCredential=cryptenroll.passphrase:{}", + conf.encryption.as_ref().unwrap() + ) + .as_str(), "systemd-cryptenroll", "--tpm2-device=auto", &conf.root, "--tpm2-pcrs=7", ], - Some(&format!("{}\n", conf.encryption.as_ref().unwrap())), + None, false, ); } diff --git a/src/pkg.rs b/src/pkg.rs index 6ee5e8e..1fb60a3 100644 --- a/src/pkg.rs +++ b/src/pkg.rs @@ -3,7 +3,7 @@ use crate::{ linux::{arch_chroot, run_command}, }; -pub const DESKTOP_PKG: [&str; 3] = ["plasma", "sddm", "navos/navos"]; +pub const DESKTOP_PKG: [&str; 5] = ["plasma", "sddm", "konsole", "dolphin", "navos/navos"]; pub const SERVER_PKG: [&str; 2] = ["tmux", "navos/navos"];