Struct uefi::proto::loaded_image::LoadedImage [−][src]
#[repr(C)]pub struct LoadedImage { /* fields omitted */ }
Expand description
The LoadedImage protocol. This can be opened on any image handle using the HandleProtocol
boot service.
Implementations
Returns a handle to the storage device on which the image is located.
Get the load options of the given image. If the image was executed from the EFI shell, or from a boot
option, this is the command line that was used to execute it as a string. If no options were given, this
returns Ok("")
.
Set the image data address and size.
This is useful in the following scenario:
- Secure boot is enabled, so images loaded with
LoadImage
must be signed with an appropriate key known to the firmware. - The bootloader has its own key embedded, and uses that key to
verify the next stage. This key is not known to the firmware, so
the next stage’s image can’t be loaded with
LoadImage
. - Since image handles are created by
LoadImage
, which we can’t call, we have to make use of an existing image handle – the one passed into the bootloader’s entry function. By modifying that image handle (after appropriately verifying the signature of the new data), we can repurpose the image handle for the next stage.
See shim for an example of this scenario.
Safety
This function takes data
as a raw pointer because the data is not
owned by LoadedImage
. The caller must ensure that the memory lives
long enough.
Set the load options for the image. This can be used prior to
calling BootServices.start_image
to control the command line
passed to the image.
Safety
This function takes options
as a raw pointer because the
load options data is not owned by LoadedImage
. The caller
must ensure that the memory lives long enough.