2 Commits
Author SHA256 Message Date
kira e833f92502 Anopther regexp fix for get_efi_part_info. 2026-10-24 18:03:27 +02:00
kira 18ff508fe5 Fix for get_efi_part_info (regexp fix) 2026-10-24 17:51:10 +02:00
3 changed files with 5 additions and 4 deletions

No files matched your search

Generated
+1 -1
View File
@@ -152,7 +152,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]] [[package]]
name = "hive-up" name = "hive-up"
version = "0.2.8" version = "0.2.10"
dependencies = [ dependencies = [
"clap", "clap",
"nix", "nix",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "hive-up" name = "hive-up"
version = "0.2.8" version = "0.2.10"
edition = "2024" edition = "2024"
[dependencies] [dependencies]
+3 -2
View File
@@ -114,7 +114,7 @@ impl std::fmt::Display for ExecCommandError {
write!(f, "IO streem to String parse Error: {}", e) write!(f, "IO streem to String parse Error: {}", e)
} }
ExecCommandError::CommandFailed(ex) => { ExecCommandError::CommandFailed(ex) => {
write!(f, "{}", ex) write!(f, "{}", ex.to_string())
} }
ExecCommandError::Other(msg) => write!(f, "Error: {}", msg), ExecCommandError::Other(msg) => write!(f, "Error: {}", msg),
} }
@@ -498,7 +498,7 @@ pub fn check_if_run_as_root() -> bool {
/// ///
fn get_efi_part_info() -> Result<(String, String), ExecCommandError> { fn get_efi_part_info() -> Result<(String, String), ExecCommandError> {
use regex_lite::Regex; use regex_lite::Regex;
let re = Regex::new(r#"^PARTN="([0-9]+)" PKNAME="([a-zA-Z0-9]+)"$"#).unwrap(); let re = Regex::new(r#"^PARTN="([0-9]+)" PKNAME="([a-zA-Z0-9/]+)""#).unwrap();
let lsblk_query = format!("PARTLABEL==\"{}\"", EFI_PARTLABEL); let lsblk_query = format!("PARTLABEL==\"{}\"", EFI_PARTLABEL);
let lsblk_args: Vec<&str> = vec!["-P", "-p", "-Q", &lsblk_query, "-o", "PARTN,PKNAME"]; let lsblk_args: Vec<&str> = vec!["-P", "-p", "-Q", &lsblk_query, "-o", "PARTN,PKNAME"];
@@ -604,6 +604,7 @@ pub fn init_efi_boot_record(maybe_kernel_cmd: &Option<String>) -> Result<(), Exe
// 1 delete all bootnums // 1 delete all bootnums
delete_all_efi_bootnums()?; delete_all_efi_bootnums()?;
// 2 create defaul // 2 create defaul
println!("Creating EFI boot records...");
efi_boot_record_create(0, BOOT_MENU_LABEL, BOOT_UKI_IMAGE_NAME, maybe_kernel_cmd)?; efi_boot_record_create(0, BOOT_MENU_LABEL, BOOT_UKI_IMAGE_NAME, maybe_kernel_cmd)?;
efi_boot_record_create( efi_boot_record_create(
1, 1,