mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-24 05:59: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 {
|
pub struct Initcpio {
|
||||||
encrypted: bool,
|
encrypted: bool,
|
||||||
|
plymouth: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Initcpio {
|
impl Initcpio {
|
||||||
pub fn new(encrypted: bool) -> Self {
|
pub fn new(encrypted: bool, plymouth: bool) -> Self {
|
||||||
Self { encrypted }
|
Self {
|
||||||
|
encrypted,
|
||||||
|
plymouth,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_config(&self) -> anyhow::Result<String> {
|
pub fn to_config(&self) -> anyhow::Result<String> {
|
||||||
@ -14,14 +18,18 @@ impl Initcpio {
|
|||||||
"MODULES=()
|
"MODULES=()
|
||||||
BINARIES=()
|
BINARIES=()
|
||||||
FILES=()
|
FILES=()
|
||||||
HOOKS=(base udev keyboard consolefont block ",
|
HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block ",
|
||||||
);
|
);
|
||||||
|
|
||||||
if self.encrypted {
|
if self.encrypted {
|
||||||
output.write_str("encrypt ")?;
|
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)
|
Ok(output)
|
||||||
}
|
}
|
||||||
|
@ -425,9 +425,10 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
|
|||||||
.context("Failed to write to journald.conf")?;
|
.context("Failed to write to journald.conf")?;
|
||||||
|
|
||||||
info!("Generating initramfs");
|
info!("Generating initramfs");
|
||||||
|
let plymouth_exists = Path::new(&mount_point.path().join("usr/bin/plymouth")).exists();
|
||||||
fs::write(
|
fs::write(
|
||||||
mount_point.path().join("etc/mkinitcpio.conf"),
|
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")?;
|
.context("Failed to write to mkinitcpio.conf")?;
|
||||||
arch_chroot
|
arch_chroot
|
||||||
|
Loading…
x
Reference in New Issue
Block a user