Documentation ¶
Index ¶
- Constants
- Variables
- type Attributes
- type Context
- type FsContext
- func (c FsContext) Close() error
- func (c FsContext) Delete(name string, guid efiguid.GUID) (err error)
- func (c FsContext) Get(name string, guid efiguid.GUID, out []byte) (a Attributes, n int, err error)
- func (c FsContext) GetSizeHint(name string, guid efiguid.GUID) (int64, error)
- func (c FsContext) Set(name string, guid efiguid.GUID, attributes Attributes, value []byte) (err error)
- func (c FsContext) VariableNames() (VariableNameIterator, error)
- type VariableNameItem
- type VariableNameIterator
Constants ¶
View Source
const (
DefaultEfiPath = "/sys/firmware/efi/efivars"
)
View Source
const (
FS_IMMUTABLE_FL = 0x00000010
)
Variables ¶
View Source
var ( ErrInsufficientSpace = errors.New("buffer too small") ErrNotFound = errors.New("variable not found") )
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type Attributes uint32
Attributes indicates how the data variable should be stored and maintained by the system.
The attributes affect when the variable may be accessed and volatility of the data.
<https://uefi.org/sites/default/files/resources/UEFI_Spec_2_9_2021_03_18.pdf#I12.1.1356525>
const ( // NonVolatile indicates the firmware environment variable is // stored in non-volatile memory (e.g. NVRAM). NonVolatile Attributes = 0x0001 // BootServiceAccess indicates whenever the variable is visible // for boot services. BootServiceAccess Attributes = 0x0002 // RuntimeAccess indicates whenever the variable is visible // after ExitBootServices() in UEFI is called. RuntimeAccess Attributes = 0x0004 // HardwareErrorRecord marks the variable to be stored in an // area for hardware errors. HardwareErrorRecord Attributes = 0x0008 // AuthenticatedWriteAccess is deprecated and should no longer // be used. AuthenticatedWriteAccess Attributes = 0x0010 TimeBasedAuthenticatedWriteAccess Attributes = 0x0020 AppendWrite Attributes = 0x0040 // EnhancedAuthenticatedAccess attribute indicates that the // variable payload begins with an // EFI_VARIABLE_AUTHENTICATION_3 structure, and potentially // more structures as indicated by fields of this structure. EnhancedAuthenticatedAccess Attributes = 0x0080 )
func (Attributes) String ¶
func (i Attributes) String() string
type Context ¶
type Context interface { io.Closer // GetSizeHint hints the value size of the variable. GetSizeHint(name string, guid efiguid.GUID) (int64, error) // Get reads a specific EFI variable and returns the content // in the slice passed through out. Get(name string, guid efiguid.GUID, out []byte) (Attributes, int, error) // Set writes a specific EFI variable. Set(name string, guid efiguid.GUID, attrs Attributes, value []byte) error // Delete causes the entire variable to be removed from // existence completely. Delete(name string, guid efiguid.GUID) error // VariableNames returns an Iterator which enumerates all // EFI variables that are currently set on the current system. VariableNames() (VariableNameIterator, error) }
func NewContext ¶
func NewDefaultContext ¶
func NewDefaultContext() Context
type FsContext ¶
type FsContext struct {
// contains filtered or unexported fields
}
FsContext provides an implementation of the Context API for platforms using a directory/file-based representation of the EFI variable service.
func NewFileSystemContext ¶
func (FsContext) GetSizeHint ¶
func (FsContext) VariableNames ¶
func (c FsContext) VariableNames() (VariableNameIterator, error)
type VariableNameItem ¶
type VariableNameIterator ¶
type VariableNameIterator interface { io.Closer itkit.Iterator[VariableNameItem] Iter() itkit.Iterator[VariableNameItem] Err() error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.