#efi #variables #interface #manipulating #uefi #boot #file

efivar

Rust crate for manipulating EFI variables using the OS interface

21 stable releases

2.0.0 Jan 16, 2024
1.4.0 Aug 11, 2023
1.1.3 Jul 31, 2023
1.0.3 Mar 20, 2023
0.1.0 May 8, 2019

#60 in Hardware support

Download history 137/week @ 2023-12-18 45/week @ 2023-12-25 24/week @ 2024-01-01 398/week @ 2024-01-08 411/week @ 2024-01-15 780/week @ 2024-01-22 657/week @ 2024-01-29 537/week @ 2024-02-05 759/week @ 2024-02-12 547/week @ 2024-02-19 640/week @ 2024-02-26 586/week @ 2024-03-04 521/week @ 2024-03-11 567/week @ 2024-03-18 316/week @ 2024-03-25 845/week @ 2024-04-01

2,262 downloads per month
Used in 8 crates (3 directly)

MIT license

84KB
2K SLoC

efivar

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

Author

Vincent Tavernier v.tavernier@pm.me


lib.rs:

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.

Dependencies

~1.5–2.5MB
~56K SLoC