From 50247a6890a3e2f80f5474ba99b143c0dfb16083 Mon Sep 17 00:00:00 2001 From: nikstur Date: Sun, 21 Jan 2024 13:59:25 +0100 Subject: [PATCH 1/2] flake: remove custom sbctl from shell It takes very long to compile sbctl with a custom pki location and is rarely needed. If you need it for testing, it should be explicitly built. --- flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/flake.nix b/flake.nix index 9d7a06c..e4b2e6d 100644 --- a/flake.nix +++ b/flake.nix @@ -232,7 +232,6 @@ # Convenience for test fixtures in nix/tests. pkgs.openssl - (pkgs.sbctl.override { databasePath = "pki"; }) # Needed for `cargo test` in rust/tool. We also need # TEST_SYSTEMD below for that. From 234e4da1f35da45fcd91fe4c589edae88883da07 Mon Sep 17 00:00:00 2001 From: nikstur Date: Sun, 21 Jan 2024 15:29:38 +0100 Subject: [PATCH 2/2] rust-toolchain: 1.70 -> 1.75 --- rust/uefi/linux-bootloader/src/pe_loader.rs | 2 +- rust/uefi/rust-toolchain.toml | 2 +- rust/uefi/stub/src/fat.rs | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/rust/uefi/linux-bootloader/src/pe_loader.rs b/rust/uefi/linux-bootloader/src/pe_loader.rs index c500813..eb451bc 100644 --- a/rust/uefi/linux-bootloader/src/pe_loader.rs +++ b/rust/uefi/linux-bootloader/src/pe_loader.rs @@ -195,7 +195,7 @@ impl Image { self.image.len().try_into().unwrap(), ); loaded_image.set_load_options( - load_options.as_ptr() as *const u8, + load_options.as_ptr(), u32::try_from(load_options.len()).unwrap(), ); } diff --git a/rust/uefi/rust-toolchain.toml b/rust/uefi/rust-toolchain.toml index 362afcd..6db27e0 100644 --- a/rust/uefi/rust-toolchain.toml +++ b/rust/uefi/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.70.0" +channel = "1.75.0" components = [ "rust-src" ] targets = [ "x86_64-unknown-uefi", "aarch64-unknown-uefi" ] diff --git a/rust/uefi/stub/src/fat.rs b/rust/uefi/stub/src/fat.rs index cce30d3..db3b416 100644 --- a/rust/uefi/stub/src/fat.rs +++ b/rust/uefi/stub/src/fat.rs @@ -9,8 +9,7 @@ use linux_bootloader::uefi_helpers::booted_image_file; pub fn extract_bytes(pe_data: &[u8], section: &str) -> Result> { let bytes: Vec = pe_section(pe_data, section) .ok_or(Status::INVALID_PARAMETER)? - .try_into() - .map_err(|_| Status::INVALID_PARAMETER)?; + .into(); Ok(bytes) }