pub enum PartitionReference {
Boot,
Guid(Guid),
Iso(String),
}Expand description
A reference to a specific partition.
Variants§
Boot
The partition where the bootloader EFI executable was loaded from
For UEFI systems: This is determined by examining the LoadedImage protocol’s DeviceHandle, which tells us which partition the firmware loaded us from.
Syntax: boot():
Example: boot():/vmlinuz-linux
Guid(Guid)
Partition identified by GPT Partition GUID (PARTUUID)
This is the unique identifier from the GPT partition table entry, NOT the filesystem UUID. Each partition in a GPT table has a unique GUID assigned when the partition is created.
To find the PARTUUID on Linux:
blkid /dev/nvme0n1p2
# Shows: PARTUUID="550e8400-e29b-41d4-a716-446655440000"Or inspect GPT directly:
sgdisk -i 2 /dev/nvme0n1
# Shows partition unique GUIDSyntax: guid(XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)/path
Iso(String)
Drive is an ISO existing in the partition that the EFI image was loaded from. Kernel/executable is a path within this ISO filesystem that is provided to the kernel through the BLOCK_IO and SimpleFileSystem UEFI Protocols.
Syntax: iso(/uwuntu.iso)/vmlinuz
Implementations§
Source§impl PartitionReference
impl PartitionReference
Sourcepub fn parse(s: &str) -> Result<Self, PathRefParseError>
pub fn parse(s: &str) -> Result<Self, PathRefParseError>
Parse just the partition reference portion (before the final :)
§Examples
PartitionReference::parse("boot")?;
PartitionReference::parse("guid:550e8400-e29b-41d4-a716-446655440000")?;Sourcepub fn to_uri_prefix(&self) -> String
pub fn to_uri_prefix(&self) -> String
Convert to URI prefix (everything before the path)
§Example
assert_eq!(PartitionReference::Boot.to_uri_prefix(), "boot():");Trait Implementations§
Source§impl Clone for PartitionReference
impl Clone for PartitionReference
Source§fn clone(&self) -> PartitionReference
fn clone(&self) -> PartitionReference
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more