Merge pull request #287 from nix-community/small-fixes

Small fixes & updates
This commit is contained in:
nikstur 2024-01-21 16:40:10 +00:00 committed by GitHub
commit 7b91a7a352
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 3 additions and 5 deletions

View File

@ -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.

View File

@ -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(),
);
}

View File

@ -1,4 +1,4 @@
[toolchain]
channel = "1.70.0"
channel = "1.75.0"
components = [ "rust-src" ]
targets = [ "x86_64-unknown-uefi", "aarch64-unknown-uefi" ]

View File

@ -9,8 +9,7 @@ use linux_bootloader::uefi_helpers::booted_image_file;
pub fn extract_bytes(pe_data: &[u8], section: &str) -> Result<Vec<u8>> {
let bytes: Vec<u8> = pe_section(pe_data, section)
.ok_or(Status::INVALID_PARAMETER)?
.try_into()
.map_err(|_| Status::INVALID_PARAMETER)?;
.into();
Ok(bytes)
}