Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update rust crate uefi to 0.32.0 #385

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions rust/uefi/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/uefi/linux-bootloader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository = "/~https://github.com/nix-community/lanzaboote/"
rust-version = "1.68"

[dependencies]
uefi = { version = "0.31.0", default-features = false, features = [ "alloc", "global_allocator" ] }
uefi = { version = "0.32.0", default-features = false, features = [ "alloc", "global_allocator" ] }
# Update blocked by #237
goblin = { version = "=0.6.1", default-features = false, features = [ "pe64", "alloc" ]}
bitflags = "2.5.0"
Expand Down
8 changes: 2 additions & 6 deletions rust/uefi/linux-bootloader/src/companions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use uefi::{
text::{AllowShortcuts, DisplayOnly},
DevicePath,
},
table, CString16,
CString16,
};

/// Locate files with ASCII filenames and matching the suffix passed as a parameter.
Expand Down Expand Up @@ -47,11 +47,7 @@ pub fn get_default_dropin_directory(
// But this is as much tedious as performing a conversion to string
// then opening the root directory and finding the new directory.
let mut target_directory = loaded_image_file_path
.to_string(
table::system_table_boot().unwrap().boot_services(),
DisplayOnly(false),
AllowShortcuts(false),
)
.to_string(DisplayOnly(false), AllowShortcuts(false))
.map_err(|_dpp_error| {
log::warn!("Failed to obtain string representation of the loaded image file path");
uefi::Error::new(uefi::Status::NOT_FOUND, ())
Expand Down
3 changes: 1 addition & 2 deletions rust/uefi/linux-bootloader/src/efivars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use uefi::{
loaded_image::LoadedImage,
},
runtime::{self, VariableAttributes, VariableVendor},
system, table, CStr16, Guid, Handle, Result, Status,
system, CStr16, Guid, Handle, Result, Status,
};

use bitflags::bitflags;
Expand Down Expand Up @@ -196,7 +196,6 @@ pub fn export_efi_variables(stub_info_name: &str) -> Result<()> {
)?;
dp_protocol
.convert_device_path_to_text(
table::system_table_boot().unwrap().boot_services(),
dp,
uefi::proto::device_path::text::DisplayOnly(false),
uefi::proto::device_path::text::AllowShortcuts(false),
Expand Down
2 changes: 1 addition & 1 deletion rust/uefi/stub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
publish = false

[dependencies]
uefi = { version = "0.31.0", default-features = false, features = [ "alloc", "global_allocator", "panic_handler", "logger" ] }
uefi = { version = "0.32.0", default-features = false, features = [ "alloc", "global_allocator", "panic_handler", "logger" ] }
# Even in debug builds, we don't enable the debug logs, because they generate a lot of spam from goblin.
log = { version = "0.4.21", default-features = false, features = [ "max_level_info", "release_max_level_warn" ]}
# Use software implementation because the UEFI target seems to need it.
Expand Down
4 changes: 1 addition & 3 deletions rust/uefi/stub/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ fn main() -> Status {
// files, nothing can open the LoadedImage protocol here.
// Everything must use `filesystem`.
let mut companions = Vec::new();
let image_fs = system_table
.boot_services()
.get_image_file_system(boot::image_handle());
let image_fs = uefi::boot::get_image_file_system(boot::image_handle());

if let Ok(image_fs) = image_fs {
let mut filesystem = uefi::fs::FileSystem::new(image_fs);
Expand Down
9 changes: 3 additions & 6 deletions rust/uefi/stub/src/thin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloc::vec;
use alloc::vec::Vec;
use log::{error, warn};
use sha2::{Digest, Sha256};
use uefi::{fs::FileSystem, prelude::*, table, CString16, Result};
use uefi::{fs::FileSystem, prelude::*, CString16, Result};

use crate::common::{boot_linux_unchecked, extract_string, get_cmdline, get_secure_boot_status};
use linux_bootloader::pe_section::pe_section;
Expand Down Expand Up @@ -93,11 +93,8 @@ pub fn boot_linux(handle: Handle, dynamic_initrds: Vec<Vec<u8>>) -> uefi::Result
let mut initrd_data;

{
let system_table = table::system_table_boot().unwrap();
let file_system = system_table
.boot_services()
.get_image_file_system(handle)
.expect("Failed to get file system handle");
let file_system =
uefi::boot::get_image_file_system(handle).expect("Failed to get file system handle");
let mut file_system = FileSystem::new(file_system);

kernel_data = file_system
Expand Down