Documentation ¶
Overview ¶
Package efi supports reading EFI variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoEFISystem = errors.New("not a supported EFI system")
Functions ¶
Types ¶
type VariableAttr ¶
type VariableAttr uint32
const ( VariableNonVolatile VariableAttr = 0x00000001 VariableBootServiceAccess VariableAttr = 0x00000002 VariableRuntimeAccess VariableAttr = 0x00000004 )
see https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/linux/efi.h?h=v5.4.32
func ReadVarBytes ¶
func ReadVarBytes(name string) ([]byte, VariableAttr, error)
ReadVarBytes will attempt to read the bytes of the value of the specified EFI variable, specified by its full name composed of the variable name and vendor ID. It also returns the attribute value attached to it. It expects to use the efivars filesystem at /sys/firmware/efi/efivars. https://www.kernel.org/doc/Documentation/filesystems/efivarfs.txt for more details.
func ReadVarString ¶
func ReadVarString(name string) (string, VariableAttr, error)
ReadVarString will attempt to read the string value of the specified EFI variable, specified by its full name composed of the variable name and vendor ID. The string value is expected to be encoded as UTF16. It also returns the attribute value attached to it. It expects to use the efivars filesystem at /sys/firmware/efi/efivars. https://www.kernel.org/doc/Documentation/filesystems/efivarfs.txt for more details.