diff --git a/src/generators/bls.rs b/src/generators/bls.rs index da84149..d18a99a 100644 --- a/src/generators/bls.rs +++ b/src/generators/bls.rs @@ -6,10 +6,10 @@ use anyhow::{Context, Result}; use serde::{Deserialize, Serialize}; use std::rc::Rc; use std::str::FromStr; -use uefi::fs::{FileSystem, Path, PathBuf}; +use uefi::cstr16; +use uefi::fs::{FileSystem, PathBuf}; use uefi::proto::device_path::text::{AllowShortcuts, DisplayOnly}; use uefi::proto::media::fs::SimpleFileSystem; -use uefi::{CString16, cstr16}; /// BLS entry parser. mod entry; @@ -48,40 +48,28 @@ pub fn generate(context: Rc, bls: &BlsConfiguration) -> Result(entries_resolved.filesystem_handle) + uefi::boot::open_protocol_exclusive::(bls_resolved.filesystem_handle) .context("unable to open bls filesystem")?; let mut fs = FileSystem::new(fs); - // Convert the subpath to the BLS entries directory to a string. - let sub_text_path = entries_resolved - .sub_path - .to_string(DisplayOnly(false), AllowShortcuts(false)) - .context("unable to convert subpath to string")?; - - // Produce a path to the BLS entries directory. - let entries_path = Path::new(&sub_text_path); - // Read the BLS entries directory. let entries_iter = fs - .read_dir(entries_path) + .read_dir(&entries_path) .context("unable to read bls entries")?; // For each entry in the BLS entries directory, parse the entry and add it to the list.