LIBEFIVAR(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

✨ NAME ✨

hii bestie!! welcome to libefivar(3) from the Library Functions Manual β€” this one is literally all about EFI Non Volatile Variable Support. πŸŽ€


🌸 SYNOPSIS 🌸

#include <efivar.h>

int
efi_append_variable(efi_guid_t guid, const char *name, void *data,
    size_t data_size, uint32_t attributes);

int
efi_del_variable(efi_guid_t guid, const char *name);

int
efi_get_variable(efi_guid_t guid, const char *name, void **data,
    ssize_t *data_size, uint32_t *attributes);

int
efi_get_variable_attributes(efi_guid_t guid, const char *name,
    uint32_t *attributes);

int
efi_get_variable_size(efi_guid_t guid, const char *name, size_t *size);

int
efi_get_next_variable_name(efi_guid_t **guid, char **name);

int
efi_guid_to_name(efi_guid_t *guid, char **name);

int
efi_guid_to_symbol(efi_guid_t *guid, char **symbol);

int
efi_guid_to_str(const efi_guid_t *guid, char **sp);

int
efi_name_to_guid(const char *name, efi_guid_t *guid);

int
efi_set_variable(efi_guid_t guid, const char *name, void *data,
    size_t data_size, uint32_t attributes);

int
efi_str_to_guid(const char *s, efi_guid_t *guid);

int
efi_variables_supported(void);

πŸ’… DESCRIPTION πŸ’…

okay so the libefivar library implements access to EFI Variables via the EFI Runtime Services. All char * strings are converted to 16-bit UTF strings before passing them to EFI. that part is important, bestie β€” don’t forget it. πŸ’–

efi_variables_supported() returns non-zero if the current machine supports setting of EFI firmware variables and the kernel support for doing so is present. otherwise, zero is returned. that’s the vibe check for β€œcan we even do this?” ✨

efi_del_variable() deletes the EFI variable selected by guid and name. bye-bye, variable. 🫢

the following functions have not been implemented yet:

  • efi_append_variable()
  • efi_get_next_variable_name()
  • efi_get_variable()
  • efi_get_variable_attributes()
  • efi_get_variable_size()
  • efi_guid_to_name()
  • efi_guid_to_str()
  • efi_guid_to_symbol()
  • efi_name_to_guid()
  • efi_set_variable()
  • efi_str_to_guid()
🚨 plot twist: that list is real. they are not implemented yet. no cap. 😭

πŸ¦‹ SEE ALSO πŸ¦‹

efidev(4) β€” go look at that one too, bestie. πŸ‘‘


🌈 HISTORY 🌈

the libefivar library first appeared in FreeBSD 12.0. iconic debut behavior, honestly. ✨


πŸ’œ AUTHORS πŸ’œ

this software was originally written by Warner Losh. shoutout to the main character who wrote it. 🫢


πŸ“ BUGS πŸ“

no facilities exist to process the strings as native UTF. this is a limitation in the Linux libefivar library interface. πŸ’€


xoxo, this cutie came from Debian, dated October 25, 2018 β€” periodt. πŸ’…πŸŽ€

πŸ“¦ where this page comes from