mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-23 21:49:28 +02:00
[src] update initcpio
- count in plymouth
This commit is contained in:
parent
af66a89067
commit
979d30162f
@ -2,11 +2,15 @@ use std::fmt::Write;
|
||||
|
||||
pub struct Initcpio {
|
||||
encrypted: bool,
|
||||
plymouth: bool,
|
||||
}
|
||||
|
||||
impl Initcpio {
|
||||
pub fn new(encrypted: bool) -> Self {
|
||||
Self { encrypted }
|
||||
pub fn new(encrypted: bool, plymouth: bool) -> Self {
|
||||
Self {
|
||||
encrypted,
|
||||
plymouth,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_config(&self) -> anyhow::Result<String> {
|
||||
@ -14,14 +18,18 @@ impl Initcpio {
|
||||
"MODULES=()
|
||||
BINARIES=()
|
||||
FILES=()
|
||||
HOOKS=(base udev keyboard consolefont block ",
|
||||
HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block ",
|
||||
);
|
||||
|
||||
if self.encrypted {
|
||||
output.write_str("encrypt ")?;
|
||||
}
|
||||
|
||||
output.write_str("filesystems keyboard fsck)\n")?;
|
||||
if self.plymouth {
|
||||
output.write_str("filesystems plymouth)\n")?;
|
||||
} else {
|
||||
output.write_str("filesystems fsck)\n")?;
|
||||
}
|
||||
|
||||
Ok(output)
|
||||
}
|
||||
|
@ -425,9 +425,10 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
|
||||
.context("Failed to write to journald.conf")?;
|
||||
|
||||
info!("Generating initramfs");
|
||||
let plymouth_exists = Path::new(&mount_point.path().join("usr/bin/plymouth")).exists();
|
||||
fs::write(
|
||||
mount_point.path().join("etc/mkinitcpio.conf"),
|
||||
initcpio::Initcpio::new(encrypted_root.is_some()).to_config()?,
|
||||
initcpio::Initcpio::new(encrypted_root.is_some(), plymouth_exists).to_config()?,
|
||||
)
|
||||
.context("Failed to write to mkinitcpio.conf")?;
|
||||
arch_chroot
|
||||
|
Loading…
x
Reference in New Issue
Block a user