Enum uefi::table::boot::LoadImageSource
source · pub enum LoadImageSource<'a> {
FromBuffer {
buffer: &'a [u8],
file_path: Option<&'a DevicePath>,
},
FromDevicePath {
device_path: &'a DevicePath,
from_boot_manager: bool,
},
}
Expand description
Used as a parameter of BootServices::load_image
to provide the
image source.
Variants§
FromBuffer
Load an image from a buffer. The data will copied from the buffer, so the input reference doesn’t need to remain valid after the image is loaded.
Fields
file_path: Option<&'a DevicePath>
If set, this path will be added as the file path of the loaded image. This is not required to load the image, but may be used by the image itself to load other resources relative to the image’s path.
FromDevicePath
Load an image via the SimpleFileSystem
protocol. If there is
no instance of that protocol associated with the path then the
behavior depends on from_boot_manager
. If true
, attempt to
load via the LoadFile
protocol. If false
, attempt to load
via the LoadFile2
protocol, then fall back to LoadFile
.
Fields
device_path: &'a DevicePath
The full device path from which to load the image.
The provided path should be a full device path and not just the
file path portion of it. So for example, it must be (the binary
representation)
PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0xFFFF,0x0)/HD(1,MBR,0xBE1AFDFA,0x3F,0xFBFC1)/\\EFI\\BOOT\\BOOTX64.EFI
and not just \\EFI\\BOOT\\BOOTX64.EFI
.
from_boot_manager: bool
If there is no instance of SimpleFileSystem
protocol associated
with the given device path, then this function will attempt to use
LoadFileProtocol
(from_boot_manager
is true
) or
LoadFile2Protocol
, and then LoadFileProtocol
(from_boot_manager
is false
).