MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / boot_order_bytes

Function boot_order_bytes

dstack-mr/src/uefi_var.rs:17–23  ·  view source on GitHub ↗

Build the raw bytes of a `BootOrder` UEFI variable from a sequence of boot option numbers — each entry is a little-endian `u16` referring to a `Boot####` variable.

(entries: &[u16])

Source from the content-addressed store, hash-verified

15/// option numbers — each entry is a little-endian `u16` referring to a
16/// `Boot####` variable.
17pub fn boot_order_bytes(entries: &[u16]) -> Vec<u8> {
18 let mut out = Vec::with_capacity(entries.len() * 2);
19 for &entry in entries {
20 out.extend_from_slice(&entry.to_le_bytes());
21 }
22 out
23}
24
25/// An `EFI_DEVICE_PATH_PROTOCOL` node.
26#[derive(Clone, Copy)]

Callers 1

rtmr0_logMethod · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected