Documentation ¶
Overview ¶
Some simple EFI utilities. These are inspired and adapted from https://github.com/u-root/u-root/blob/master/pkg/uefivars https://github.com/Foxboron/go-uefi
Also useful references https://www.kernel.org/doc/html/latest/filesystems/efivarfs.html https://github.com/rhboot/efivar/ https://github.com/rhboot/efivar/blob/master/src/guids.txt https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-firmware-efi-vars
Index ¶
Constants ¶
View Source
const ( EFI_VARIABLE_NON_VOLATILE Attributes = 0x00000001 EFI_VARIABLE_BOOTSERVICE_ACCESS = 0x00000002 EFI_VARIABLE_RUNTIME_ACCESS = 0x00000004 EFI_VARIABLE_HARDWARE_ERROR_RECORD = 0x00000008 EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS = 0x00000010 EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS = 0x00000020 EFI_VARIABLE_APPEND_WRITE = 0x00000040 EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS = 0x00000080 )
From the UEFI spec
View Source
const ( BootUUID = "8be4df61-93ca-11d2-aa0d-00e098032b8c" BootLoaderUUID = "4a67b082-0a4c-41cf-b6c7-440b29bb8c4f" )
Variables ¶
This section is empty.
Functions ¶
func ReadLoaderEntrySelected ¶
func ReadSecureBoot ¶
func ReadSetupMode ¶
func ReadVarAsBool ¶
func ReadVarAsUTF16 ¶
Types ¶
type Attributes ¶
type Attributes uint32
Per Linux docs, and uefi specs, there is a 4 byte attribute bitfield
type EfiVar ¶
type EfiVar struct { Uuid string // consider a uuid type? Name string Attributes Attributes Raw []byte }
func ReadVar ¶
ReadVar reads a given uuid, name pair from the efivars filesystem and returns an EfiVar struct.
Click to show internal directories.
Click to hide internal directories.