Crate efivar

Source
Expand description

efivar is a crate for manipulating EFI variables using the OS interface. This crate is mainly used by efivarcli to implement its functionality.

On Linux, it is assumed that efivarfs is mounted and available at /sys/firmware/efi/efivars, which should be the default nowadays on all major distros.

On Windows, it uses the Get/SetFirmwareEnvironmentVariable family of functions, which require administrative rights. This also requires adjusting the security token for the current thread to include SeSystemEnvironmentPrivilege. This is done during the initialization of SystemManager (see SystemManager::new() ).

In-memory and filesystem storage are also provided for testing purposes, or as a way to dump system variables to an external file.

Modules§

boot
This module handles everything related to boot entries
efi
EFI constants based on the UEFI specification
push
test_utils
utils

Enums§

Error
Describes an error returned by EFI variable operations

Traits§

VarEnumerator
Represents the capability of enumerating EFI variables
VarManager
Represents an EFI variable manager that can read, write and list variables
VarReader
Represents the capability of reading EFI variables
VarWriter
Represents the capability of writing EFI variables

Functions§

system
Returns a VarManager that represents the firmware variables of the running system

Type Aliases§

Result
Result type for this crate’s API functions