mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2025-02-25 18:55:26 -06:00
feat: add support for regenerating initramfs on fedora
This commit is contained in:
parent
059b66b96d
commit
4797ea54f7
@ -88,6 +88,7 @@ fn regenerate_initramfs() -> anyhow::Result<InitramfsType> {
|
||||
let result = match initramfs_type {
|
||||
InitramfsType::Debian => run_command("update-initramfs", &["-u"]),
|
||||
InitramfsType::Mkinitcpio => run_command("mkinitcpio", &["-P"]),
|
||||
InitramfsType::Dracut => run_command("dracut", &["--regenerate-all", "--force"]),
|
||||
};
|
||||
result.map(|()| initramfs_type)
|
||||
}
|
||||
@ -111,6 +112,13 @@ fn detect_initramfs_type(os_release: &OsRelease) -> Option<InitramfsType> {
|
||||
);
|
||||
None
|
||||
}
|
||||
} else if os_release.id == "fedora" {
|
||||
if Command::new("dracut").arg("--version").output().is_ok() {
|
||||
Some(InitramfsType::Dracut)
|
||||
} else {
|
||||
warn!("Fedora without dracut detected, refusing to regenerate initramfs");
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
@ -261,6 +261,7 @@ pub struct PowerState<T> {
|
||||
pub enum InitramfsType {
|
||||
Debian,
|
||||
Mkinitcpio,
|
||||
Dracut,
|
||||
}
|
||||
|
||||
#[skip_serializing_none]
|
||||
|
Loading…
Reference in New Issue
Block a user