instead of a panic, fail with a specific error if there is no entry to boot

This commit is contained in:
2025-10-19 02:25:55 -07:00
parent 1bba345dc2
commit f5f431458c
2 changed files with 4 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ Sprout is licensed under Apache 2.0 and is open to modifications and contributio
## Features ## Features
NOTE: Currently, Sprout is experimental and is not intended for production use. For example, it doesn't currently NOTE: Currently, Sprout is experimental and is not intended for production use. For example, it doesn't currently
have secure boot support. In fact, as of writing, it doesn't even have a boot menu. Instead, it boots the first entry it sees, or panics. have secure boot support. In fact, as of writing, it doesn't even have a boot menu. Instead, it boots the first entry it sees, or fails.
### Current ### Current

View File

@@ -96,9 +96,9 @@ fn main() -> Result<()> {
phase(context.clone(), &config.phases.late).context("unable to execute late phase")?; phase(context.clone(), &config.phases.late).context("unable to execute late phase")?;
let index = 1; let Some((context, entry)) = final_entries.first() else {
bail!("no entries found");
let (context, entry) = &final_entries[index - 1]; };
for action in &entry.actions { for action in &entry.actions {
let action = context.stamp(action); let action = context.stamp(action);