efivarfs

package
v0.0.0-...-19dc140 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 13 Imported by: 3

Documentation

Index

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.FSWrapper
}

EFIFS is a struct that combines reading variables from the file system while also ensuring we are

func NewFS

func NewFS() *EFIFS

NewFS creates a new instance of *EFIFS

func (*EFIFS) CheckImmutable

func (f *EFIFS) CheckImmutable() *EFIFS

Check if file is immutable before writing to the file. Returns ErrImmutable if the file is immutable.

func (*EFIFS) GetVar

func (t *EFIFS) GetVar(v efivar.Efivar, e efivar.Unmarshallable) error

GetVar parses and unmarshalls a EFI variable.

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) Open

func (f *EFIFS) Open() *Efivarfs

Open returns a initialization Efivarfs for high-level abstractions.

func (*EFIFS) UnsetImmutable

func (f *EFIFS) UnsetImmutable() *EFIFS

UnsetImmutable implicitly when writing towards a file.

func (*EFIFS) WriteVar

func (t *EFIFS) WriteVar(v efivar.Efivar, e efivar.Marshallable) error

WriteVar writes an EFI variables to the EFIFS.

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 Open

func Open(e EFIVars) *Efivarfs

func (*Efivarfs) GetBootEntry

func (e *Efivarfs) GetBootEntry(option string) (*device.EFILoadOption, error)

func (*Efivarfs) GetBootOrder

func (e *Efivarfs) GetBootOrder() []string

func (*Efivarfs) GetKEK

func (e *Efivarfs) GetKEK() (*signature.SignatureDatabase, error)

func (*Efivarfs) GetLoaderEntrySelected

func (e *Efivarfs) GetLoaderEntrySelected() (string, error)

func (*Efivarfs) GetPK

func (e *Efivarfs) GetPK() (*signature.SignatureDatabase, error)

func (*Efivarfs) GetSecureBoot

func (e *Efivarfs) GetSecureBoot() (bool, error)

func (*Efivarfs) GetSetupMode

func (e *Efivarfs) GetSetupMode() (bool, error)

func (*Efivarfs) Getdb

func (e *Efivarfs) Getdb() (*signature.SignatureDatabase, error)

func (*Efivarfs) Getdbx

func (e *Efivarfs) Getdbx() (*signature.SignatureDatabase, error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL