From 8382174219f5aed73fa02bccf6638db4fb84fc71 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Tue, 15 Apr 2025 00:16:53 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20custom=20kernel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- installs/full.toml | 3 +++ src/config.rs | 2 ++ src/pkg.rs | 7 +++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/installs/full.toml b/installs/full.toml index d48ea9b..baf7407 100644 --- a/installs/full.toml +++ b/installs/full.toml @@ -57,6 +57,9 @@ pkg = [ "micro" ] +# Custom kernel +kernel = "linux-lts" + # Enable virtualization virtualization = true diff --git a/src/config.rs b/src/config.rs index baf8d33..94b31fe 100644 --- a/src/config.rs +++ b/src/config.rs @@ -59,6 +59,8 @@ pub struct PackageConfig { pub virtualization: Option, /// Enable docker pub docker: Option, + /// Custom kernel package + pub kernel: Option, } #[derive(Debug, Clone, Deserialize)] diff --git a/src/pkg.rs b/src/pkg.rs index d1c023c..4015421 100644 --- a/src/pkg.rs +++ b/src/pkg.rs @@ -48,9 +48,7 @@ pub fn pacstrap(conf: &PackageConfig) { "-K", "/mnt", "base", - "linux", "linux-firmware", - "linux-headers", "git", "networkmanager", "nano", @@ -61,6 +59,11 @@ pub fn pacstrap(conf: &PackageConfig) { "plymouth", ]; + let linux_kernel = "linux".to_string(); + let kernel = conf.kernel.as_ref().unwrap_or(&linux_kernel); + let headers = format!("{kernel}-headers"); + cmd.extend(&[kernel.as_str(), headers.as_str()]); + #[cfg(target_arch = "aarch64")] { cmd.extend(&["archlinuxarm-keyring"]);