From 8506f1d7c30cc68f9e566db2927a0da5379e5536 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Wed, 19 Nov 2025 14:51:53 -0700 Subject: [PATCH] Update deps - Update redox_uefi and fix compilation - Remove memoffset; replaced by `core::mem::offset_of!()` Signed-off-by: Tim Crawford --- Cargo.lock | 62 +++++++++++++++++++++----------------------------- Cargo.toml | 9 ++------ src/display.rs | 3 +-- src/fde.rs | 6 ++--- src/hii.rs | 3 +-- src/main.rs | 2 -- 6 files changed, 33 insertions(+), 52 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fd63615..230c01a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,66 +1,57 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "ab_glyph_rasterizer" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" +checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" dependencies = [ "libm", ] [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "downcast-rs" -version = "1.2.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" [[package]] name = "libc" -version = "0.2.167" +version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" [[package]] name = "libm" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ "bitflags", "libc", "redox_syscall", ] -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -72,9 +63,9 @@ dependencies = [ [[package]] name = "orbclient" -version = "0.3.48" +version = "0.3.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba0b26cec2e24f08ed8bb31519a9333140a6599b867dac464bb150bdb796fd43" +checksum = "247ad146e19b9437f8604c21f8652423595cf710ad108af40e77d3ae6e96b827" dependencies = [ "libredox", ] @@ -107,33 +98,33 @@ checksum = "8eb516ad341a84372b5b15a5a35cf136ba901a639c8536f521b108253d7fce74" [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ "bitflags", ] [[package]] name = "redox_uefi" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d69301333534a04b380995f5d9e604f46a7cbd8d8c62c996ee27447efdeba4" +checksum = "2e8148374036fd1a1f4d1184c4380dfdf1e7bbe2c43b3aa23a5358521c32c902" [[package]] name = "redox_uefi_alloc" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df364cdf289d9df9201f147aeeb5e7387f29f0824bee2e41e960eb98eaf03f1" +checksum = "389b000bcb58fb4c5fc27092ed94d1fcc96ae1f88a458c792d2c2a6c29aeb249" dependencies = [ "redox_uefi", ] [[package]] name = "redox_uefi_std" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b81203f45b2e08804d80274a2951f1615828d9aa5629d3a5d267878c70feb96d" +checksum = "d7adba90fc68496a02cadacccff2f147830e74daace826df5eacce2a5b8ffcd3" dependencies = [ "redox_uefi", "redox_uefi_alloc", @@ -153,7 +144,7 @@ dependencies = [ [[package]] name = "system76_ectool" version = "0.3.8" -source = "git+https://github.com/system76/ec.git#85da2d2d0c83a700a714bf9f1cf5319755c9192a" +source = "git+https://github.com/system76/ec.git#206165c51dec452ff8a53bd928b21f5ce309bcf2" dependencies = [ "downcast-rs", "redox_hwio", @@ -163,7 +154,6 @@ dependencies = [ name = "system76_firmware_setup" version = "1.0.0" dependencies = [ - "memoffset", "orbclient", "orbfont", "redox_uefi_std", diff --git a/Cargo.toml b/Cargo.toml index d0cd43e..eef724e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,15 +8,10 @@ license = "GPL-3.0-only" lto = true [dependencies] -memoffset = "0.9" orbclient = { version = "0.3.46", default-features = false } orbfont = { version = "0.1.12", default-features = false, features = ["no-std"] } -redox_uefi_std = "0.1.13" - -[dependencies.system76_ectool] -git = "https://github.com/system76/ec.git" -default-features = false -features = ["redox_hwio"] +redox_uefi_std = "0.1.14" +system76_ectool = { git = "https://github.com/system76/ec.git", default-features = false, features = ["redox_hwio"] } [features] default = [] diff --git a/src/display.rs b/src/display.rs index 3bd1933..7cd6e48 100644 --- a/src/display.rs +++ b/src/display.rs @@ -5,13 +5,12 @@ use orbclient::{Color, Mode, Renderer}; use std::prelude::*; use std::proto::Protocol; use std::uefi::graphics::{GraphicsBltOp, GraphicsBltPixel, GraphicsOutput}; -use std::uefi::guid::GRAPHICS_OUTPUT_PROTOCOL_GUID; pub struct Output(pub &'static mut GraphicsOutput); impl Protocol for Output { fn guid() -> Guid { - GRAPHICS_OUTPUT_PROTOCOL_GUID + GraphicsOutput::GUID } fn new(inner: &'static mut GraphicsOutput) -> Self { diff --git a/src/fde.rs b/src/fde.rs index ca41368..7027279 100644 --- a/src/fde.rs +++ b/src/fde.rs @@ -140,11 +140,11 @@ macro_rules! list_entry { ($t:ident, $l:tt) => { impl ListEntryObject<$t> for ListEntry<$t> { unsafe fn object(&self) -> &$t { - unsafe { self.object_at(offset_of!($t, $l)) } + unsafe { self.object_at(mem::offset_of!($t, $l)) } } unsafe fn object_mut(&mut self) -> &mut $t { - unsafe { self.object_at_mut(offset_of!($t, $l)) } + unsafe { self.object_at_mut(mem::offset_of!($t, $l)) } } } }; @@ -402,7 +402,7 @@ fn form_display_inner(form: &Form, user_input: &mut UserInput) -> Result<()> { 'render: loop { let mut hotkey_helps = Vec::new(); for hotkey in form.HotKeyListHead.iter() { - let hotkey_help = ffi::nstr(hotkey.HelpString); + let hotkey_help = unsafe { ffi::nstr(hotkey.HelpString) }; hotkey_helps.push(hotkey_help); } diff --git a/src/hii.rs b/src/hii.rs index cee2fad..076d1e1 100644 --- a/src/hii.rs +++ b/src/hii.rs @@ -2,7 +2,6 @@ use std::prelude::*; use std::proto::Protocol; -use std::uefi::guid::HII_DATABASE_GUID; use std::uefi::hii::database::HiiDatabase; #[allow(dead_code)] @@ -10,7 +9,7 @@ pub struct Database(pub &'static mut HiiDatabase); impl Protocol for Database { fn guid() -> Guid { - HII_DATABASE_GUID + HiiDatabase::GUID } fn new(inner: &'static mut HiiDatabase) -> Self { diff --git a/src/main.rs b/src/main.rs index d69baf1..14778c3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,8 +4,6 @@ #![no_main] #![allow(non_snake_case)] -#[macro_use] -extern crate memoffset; #[macro_use] extern crate uefi_std as std;