♻️ optional secure boot
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
JMARyA 2025-04-10 13:45:02 +02:00
parent c680a11d9e
commit 8c9db904df
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 16 additions and 5 deletions

View file

@ -47,6 +47,9 @@ gpu_driver = "NVIDIA"
# Enable firewall # Enable firewall
firewall = true firewall = true
# Secure Boot
secure_boot = true
[pkg] [pkg]
# Additional packages # Additional packages
pkg = [ pkg = [

View file

@ -105,8 +105,10 @@ pub struct GeneralConfig {
pub bluetooth: Option<bool>, pub bluetooth: Option<bool>,
/// Install Video Driver /// Install Video Driver
pub gpu_driver: Option<GPUVendor>, pub gpu_driver: Option<GPUVendor>,
// Eanble firewall // Enable firewall
pub firewall: Option<bool>, pub firewall: Option<bool>,
// Want Secure Boot
pub secure_boot: Option<bool>,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]

View file

@ -52,6 +52,7 @@ pub mod zram;
use crate::{ use crate::{
config::InstallConfig, config::InstallConfig,
pkg::{self, install_pkgs, pacstrap}, pkg::{self, install_pkgs, pacstrap},
print_status,
}; };
/// Uncomment the first occurrence of a specified value in a file. /// Uncomment the first occurrence of a specified value in a file.
@ -198,7 +199,11 @@ pub fn install_mnt(conf: InstallConfig, bare: bool) {
setup_mkinitcpio(&conf.drive); setup_mkinitcpio(&conf.drive);
if bare && has_secure_boot() { if bare && has_secure_boot() {
setup_secure_boot(); if conf.general.secure_boot.unwrap_or(true) {
setup_secure_boot();
} else {
print_status("Skipping Secure Boot");
}
} }
if conf.drive.encryption.is_some() { if conf.drive.encryption.is_some() {

View file

@ -53,9 +53,6 @@ fn main() {
std::process::exit(1); std::process::exit(1);
} }
// TODO : make secure boot configurable
//ensure_secure_boot();
let config_file: &String = install_args.get_one("config").unwrap(); let config_file: &String = install_args.get_one("config").unwrap();
let force = install_args.get_flag("force"); let force = install_args.get_flag("force");
let conf = read_conf(config_file); let conf = read_conf(config_file);
@ -66,6 +63,10 @@ fn main() {
expect_yes(); expect_yes();
} }
if conf.general.secure_boot.unwrap_or(false) {
ensure_secure_boot();
}
// Run the // Run the
install(conf, true); install(conf, true);
} }