Skip to content

Commit

Permalink
feat(efiboot): Do not automatically choose 0000 as boot id
Browse files Browse the repository at this point in the history
Some implementations seem to not choose it, so let's also not do it
  • Loading branch information
iTrooz committed Dec 23, 2023
1 parent 83b7c31 commit 3319c15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion efiboot/src/cli/boot/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub fn run(
}
id
} else {
let id = (0x0000..0xFFFF)
let id = (0x0001..0xFFFF)
.find(|&i| !used_boot_ids.contains(&i))
.unwrap();
println!("Chose id {id:04X} for boot entry");
Expand Down
4 changes: 2 additions & 2 deletions efiboot/src/cli/boot/tests/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn add() {
);

// verify inserted entry is right
let (data, _) = manager.read(&Variable::new("Boot0000")).unwrap();
let (data, _) = manager.read(&Variable::new("Boot0002")).unwrap();
let entry = BootEntry::parse(data).unwrap();
assert_eq!(
entry,
Expand All @@ -58,7 +58,7 @@ fn add() {

// verify new boot order is right
let (data, _) = manager.read(&Variable::new("BootOrder")).unwrap();
assert_eq!(data, utils::u16_to_u8(&[0x0000, 0x0001]));
assert_eq!(data, utils::u16_to_u8(&[0x0002, 0x0001]));
}

#[test]
Expand Down

0 comments on commit 3319c15

Please sign in to comment.