mirror of
https://github.com/edera-dev/sprout.git
synced 2026-08-06 00:01:05 +00:00
chore(upgrade): upgrade to rust v1.97.1, bump deps and migrate, bump images (#95)
This commit is contained in:
@@ -49,7 +49,7 @@ fn reconnect() -> Result<()> {
|
||||
for handle in handles.iter() {
|
||||
// Ignore the result as there is nothing we can do if reconnecting a controller fails.
|
||||
// This is also likely to fail in some cases but should fail safely.
|
||||
let _ = uefi::boot::connect_controller(*handle, None, None, true);
|
||||
let _ = uefi::boot::connect_controller(*handle, &[], None, true);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -44,16 +44,8 @@ fn read(input: &mut Input, timeout: &Duration) -> Result<MenuOperation> {
|
||||
.context("unable to create timer event")?
|
||||
};
|
||||
|
||||
// The timeout is in increments of 100 nanoseconds.
|
||||
let timeout_hundred_nanos = timeout.as_nanos() / 100;
|
||||
|
||||
// Check if the timeout is too large to fit into an u64.
|
||||
if timeout_hundred_nanos > u64::MAX as u128 {
|
||||
bail!("timeout duration overflow");
|
||||
}
|
||||
|
||||
// Set a timer to trigger after the specified duration.
|
||||
let trigger = TimerTrigger::Relative(timeout_hundred_nanos as u64);
|
||||
let trigger = TimerTrigger::Relative(*timeout);
|
||||
uefi::boot::set_timer(&timer_event, trigger).context("unable to set timeout timer")?;
|
||||
|
||||
let mut events = vec![timer_event, key_event];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use alloc::string::{String, ToString};
|
||||
use anyhow::Result;
|
||||
use anyhow::{Context, Result, anyhow};
|
||||
use core::ptr::null_mut;
|
||||
use jaarg::{
|
||||
ErrorUsageWriter, ErrorUsageWriterContext, HelpWriter, HelpWriterContext, Opt, Opts,
|
||||
@@ -131,11 +131,15 @@ impl SproutOptions {
|
||||
) {
|
||||
ParseResult::ContinueSuccess => Ok(result),
|
||||
ParseResult::ExitSuccess => unsafe {
|
||||
uefi::boot::exit(uefi::boot::image_handle(), Status::SUCCESS, 0, null_mut());
|
||||
uefi::boot::exit(uefi::boot::image_handle(), Status::SUCCESS, 0, null_mut())
|
||||
.context("unable to exit")?;
|
||||
Err(anyhow!("unable to exit"))
|
||||
},
|
||||
|
||||
ParseResult::ExitError => unsafe {
|
||||
uefi::boot::exit(uefi::boot::image_handle(), Status::ABORTED, 0, null_mut());
|
||||
uefi::boot::exit(uefi::boot::image_handle(), Status::ABORTED, 0, null_mut())
|
||||
.context("unable to exit")?;
|
||||
Err(anyhow!("unable to exit"))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user