mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-27 07:29:29 +02:00
29 lines
524 B
Rust
29 lines
524 B
Rust
use std::fmt::Write;
|
|
|
|
pub struct Initcpio {
|
|
encrypted: bool,
|
|
}
|
|
|
|
impl Initcpio {
|
|
pub fn new(encrypted: bool) -> Self {
|
|
Self { encrypted }
|
|
}
|
|
|
|
pub fn to_config(&self) -> String {
|
|
let mut output = String::from(
|
|
"MODULES=()
|
|
BINARIES=()
|
|
FILES=()
|
|
HOOKS=(base udev keyboard consolefont block ",
|
|
);
|
|
|
|
if self.encrypted {
|
|
output.write_str("encrypt ").unwrap();
|
|
}
|
|
|
|
output.write_str("filesystems keyboard fsck)\n").unwrap();
|
|
|
|
output
|
|
}
|
|
}
|