Documentation ¶
Index ¶
- Variables
- type EFIFS
- func (f *EFIFS) CheckImmutable() *EFIFS
- func (t *EFIFS) GetVar(v efivar.Efivar, e efivar.Unmarshallable) error
- func (t *EFIFS) GetVarWithAttributes(v efivar.Efivar, e efivar.Unmarshallable) (attributes.Attributes, error)
- func (f *EFIFS) Open() *Efivarfs
- func (f *EFIFS) UnsetImmutable() *EFIFS
- func (t *EFIFS) WriteVar(v efivar.Efivar, e efivar.Marshallable) error
- type EFIVars
- type Efivarfs
- func (e *Efivarfs) GetKEK() (*signature.SignatureDatabase, error)
- func (e *Efivarfs) GetPK() (*signature.SignatureDatabase, error)
- func (e *Efivarfs) GetSecureBoot() (bool, error)
- func (e *Efivarfs) GetSetupMode() (bool, error)
- func (e *Efivarfs) Getdb() (*signature.SignatureDatabase, error)
- func (e *Efivarfs) Getdbx() (*signature.SignatureDatabase, error)
- func (e *Efivarfs) WriteSignedUpdate(v efivar.Efivar, m efivar.Marshallable, key crypto.Signer, ...) error
- type FSWrapper
- func (e *FSWrapper) CheckImmutable()
- func (t *FSWrapper) Open(name string) (fs.File, error)
- func (t *FSWrapper) OpenFile(name string, flag int, perm os.FileMode) (io.ReadWriteCloser, error)
- func (t *FSWrapper) ParseEfivars(f io.Reader, size int) (attributes.Attributes, *bytes.Buffer, error)
- func (t *FSWrapper) ReadEfivarsFile(filename string) (attributes.Attributes, *bytes.Buffer, error)
- func (t *FSWrapper) ReadEfivarsWithGuid(filename string, guid util.EFIGUID) (attributes.Attributes, *bytes.Buffer, error)
- func (t *FSWrapper) ReadFile(name string) ([]byte, error)
- func (e *FSWrapper) UnsetImmutable()
- func (t *FSWrapper) WriteEfivarsWithGuid(name string, attrs attributes.Attributes, b []byte, guid util.EFIGUID) error
- func (t *FSWrapper) WriteFile(name string, data []byte, perm os.FileMode) error
- type TestFS
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrImmutable = attr.ErrIsImmutable ErrIncorrectAttributes = errors.New("efivar has the wrong attributes") )
Functions ¶
This section is empty.
Types ¶
type EFIFS ¶
type EFIFS struct {
*FSWrapper
}
EFIFS is a struct that combines reading variables from the file system while also ensuring we are
func (*EFIFS) CheckImmutable ¶
Check if file is immutable before writing to the file. Returns ErrImmutable if the file is immutable.
func (*EFIFS) GetVarWithAttributes ¶
func (t *EFIFS) GetVarWithAttributes(v efivar.Efivar, e efivar.Unmarshallable) (attributes.Attributes, error)
GetVarWithAttributes parses and unmarshalls a EFI variable, while also returning the parsed attributes.
func (*EFIFS) UnsetImmutable ¶
UnsetImmutable implicitly when writing towards a file.
type EFIVars ¶
type EFIVars interface { GetVar(efivar.Efivar, efivar.Unmarshallable) error GetVarWithAttributes(efivar.Efivar, efivar.Unmarshallable) (attributes.Attributes, error) WriteVar(efivar.Efivar, efivar.Marshallable) error }
EFIVars is the interface for interacting with writing and getting EFI variables.
type Efivarfs ¶
type Efivarfs struct {
EFIVars
}
func (*Efivarfs) GetSecureBoot ¶
func (*Efivarfs) GetSetupMode ¶
func (*Efivarfs) WriteSignedUpdate ¶
func (e *Efivarfs) WriteSignedUpdate(v efivar.Efivar, m efivar.Marshallable, key crypto.Signer, cert *x509.Certificate) error
Writes a signed variable update
type FSWrapper ¶
type FSWrapper struct {
// contains filtered or unexported fields
}
func NewFSWrapper ¶
func NewFSWrapper() *FSWrapper
func NewMemoryWrapper ¶
func NewMemoryWrapper() *FSWrapper
func (*FSWrapper) CheckImmutable ¶
func (e *FSWrapper) CheckImmutable()
func (*FSWrapper) ParseEfivars ¶
func (t *FSWrapper) ParseEfivars(f io.Reader, size int) (attributes.Attributes, *bytes.Buffer, error)
func (*FSWrapper) ReadEfivarsFile ¶
func (t *FSWrapper) ReadEfivarsFile(filename string) (attributes.Attributes, *bytes.Buffer, error)
For a full path instead of the inferred efivars path
func (*FSWrapper) ReadEfivarsWithGuid ¶
func (t *FSWrapper) ReadEfivarsWithGuid(filename string, guid util.EFIGUID) (attributes.Attributes, *bytes.Buffer, error)
func (*FSWrapper) UnsetImmutable ¶
func (e *FSWrapper) UnsetImmutable()
func (*FSWrapper) WriteEfivarsWithGuid ¶
func (t *FSWrapper) WriteEfivarsWithGuid(name string, attrs attributes.Attributes, b []byte, guid util.EFIGUID) error
Write an EFI variable to sysfs TODO: Fix retryable writes
Click to show internal directories.
Click to hide internal directories.