Skip to content

Commit 7daf9d3

Browse files
committed
composefs-boot: Retain SHA512 type
Motivated by increased type safety. Signed-off-by: Colin Walters <[email protected]>
1 parent 3181bb5 commit 7daf9d3

File tree

1 file changed

+5
-5
lines changed
  • crates/lib/src/bootc_composefs

1 file changed

+5
-5
lines changed

crates/lib/src/bootc_composefs/boot.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ fn write_pe_to_esp(
588588
file: &RegularFile<Sha512HashValue>,
589589
file_path: &Utf8Path,
590590
pe_type: PEType,
591-
uki_id: &String,
591+
uki_id: &Sha512HashValue,
592592
is_insecure_from_opts: bool,
593593
mounted_efi: impl AsRef<Path>,
594594
bootloader: &Bootloader,
@@ -619,7 +619,7 @@ fn write_pe_to_esp(
619619
_ => { /* no-op */ }
620620
}
621621

622-
if composefs_cmdline.to_hex() != *uki_id {
622+
if composefs_cmdline != *uki_id {
623623
anyhow::bail!(
624624
"The UKI has the wrong composefs= parameter (is '{composefs_cmdline:?}', should be {uki_id:?})"
625625
);
@@ -648,7 +648,7 @@ fn write_pe_to_esp(
648648
Some(parent) => {
649649
let renamed_path = match parent.as_str().ends_with(EFI_ADDON_DIR_EXT) {
650650
true => {
651-
let dir_name = format!("{}{}", uki_id, EFI_ADDON_DIR_EXT);
651+
let dir_name = format!("{}{}", uki_id.to_hex(), EFI_ADDON_DIR_EXT);
652652

653653
parent
654654
.parent()
@@ -672,7 +672,7 @@ fn write_pe_to_esp(
672672
.with_context(|| format!("Opening {final_pe_path:?}"))?;
673673

674674
let pe_name = match pe_type {
675-
PEType::Uki => &format!("{}{}", uki_id, EFI_EXT),
675+
PEType::Uki => &format!("{}{}", uki_id.to_hex(), EFI_EXT),
676676
PEType::UkiAddon => file_path
677677
.components()
678678
.last()
@@ -932,7 +932,7 @@ pub(crate) fn setup_composefs_uki_boot(
932932
&entry.file,
933933
utf8_file_path,
934934
entry.pe_type,
935-
&id.to_hex(),
935+
&id,
936936
is_insecure_from_opts,
937937
esp_mount.dir.path(),
938938
&bootloader,

0 commit comments

Comments
 (0)