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

Enums

  • Describes an error returned by EFI variable operations

Traits

  • Represents the capability of enumerating EFI variables
  • Represents an EFI variable manager that can read, write and list variables
  • Represents the capability of reading EFI variables
  • Represents the capability of writing EFI variables

Functions

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

Type Aliases

  • Result type for this crate’s API functions