🎨 removed kernel from pacstrap
All checks were successful
ci/woodpecker/push/build/1 Pipeline was successful
ci/woodpecker/push/build/2 Pipeline was successful

This commit is contained in:
JMARyA 2025-04-23 19:52:51 +02:00
parent 1cfa972e9f
commit 891eefd09a
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
3 changed files with 12 additions and 9 deletions

View file

@ -51,7 +51,7 @@ pub mod zram;
use crate::{ use crate::{
config::InstallConfig, config::InstallConfig,
pkg::{self, install_pkgs, pacstrap_at}, pkg::{self, install_pkgs, pacstrap_at, setup_kernel},
print_status, print_status,
}; };
@ -129,7 +129,8 @@ pub fn install(mut conf: InstallConfig, bare: bool) {
pub fn install_mnt(conf: InstallConfig, bare: bool) { pub fn install_mnt(conf: InstallConfig, bare: bool) {
// Base Install // Base Install
pacstrap_at("/mnt", conf.pkg.kernel.as_ref(), &conf.pkg.pkg); pacstrap_at("/mnt", &conf.pkg.pkg);
setup_kernel(conf.pkg.kernel.clone());
genfstab(); genfstab();
// Configuration // Configuration

View file

@ -67,7 +67,7 @@ fn main() {
ensure_root(); ensure_root();
let dir: &String = tar_options.get_one("dir").unwrap(); let dir: &String = tar_options.get_one("dir").unwrap();
print_status("Pacstrapping root fs"); print_status("Pacstrapping root fs");
pacstrap_at(&dir, None, &[]); pacstrap_at(&dir, &[]);
setup_navos(dir.as_str()); setup_navos(dir.as_str());
} }
Some(("create-img", install_args)) => { Some(("create-img", install_args)) => {

View file

@ -36,18 +36,20 @@ pub fn install_pkgs(pkg: &[&str]) {
arch_chroot(&cmd, None, true); arch_chroot(&cmd, None, true);
} }
pub fn setup_kernel(kernel: Option<String>) {
let linux_kernel = "linux".to_string();
let kernel = kernel.unwrap_or(linux_kernel);
let headers = format!("{kernel}-headers");
install_pkgs(&[kernel.as_str(), headers.as_str()]);
}
// PACSTRAP // PACSTRAP
/// Initial system pacstrap /// Initial system pacstrap
pub fn pacstrap_at(dir: &str, kernel: Option<&String>, pkg: &[String]) { pub fn pacstrap_at(dir: &str, pkg: &[String]) {
// TODO : rearrange pkgs + minify // TODO : rearrange pkgs + minify
let mut cmd: Vec<&str> = vec!["pacstrap", "-K", dir, "base"]; let mut cmd: Vec<&str> = vec!["pacstrap", "-K", dir, "base"];
let linux_kernel = "linux".to_string();
let kernel = kernel.unwrap_or(&linux_kernel);
let headers = format!("{kernel}-headers");
cmd.extend(&[kernel.as_str(), headers.as_str()]);
#[cfg(target_arch = "aarch64")] #[cfg(target_arch = "aarch64")]
{ {
cmd.extend(&["archlinuxarm-keyring"]); cmd.extend(&["archlinuxarm-keyring"]);