efi

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package efi provides EFI variable access and boot entry construction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildLoadOption

func BuildLoadOption(entry BootEntry) ([]byte, error)

BuildLoadOption constructs a raw EFI_LOAD_OPTION from a BootEntry.

Types

type BootEntry

type BootEntry struct {
	Description  string
	Loader       string
	OptionalData []byte
}

BootEntry represents an EFI boot entry for NVRAM management.

type EFIVarReader

type EFIVarReader struct {
	// contains filtered or unexported fields
}

EFIVarReader reads and writes EFI variables from efivarfs.

func NewEFIVarReader

func NewEFIVarReader(basePath string) *EFIVarReader

NewEFIVarReader creates an EFI variable reader. Use "" for basePath to use the system default (/sys/firmware/efi/efivars).

func (*EFIVarReader) IsSecureBootEnabled

func (r *EFIVarReader) IsSecureBootEnabled() (bool, error)

IsSecureBootEnabled checks if SecureBoot is currently enabled.

func (*EFIVarReader) IsSetupMode

func (r *EFIVarReader) IsSetupMode() (bool, error)

IsSetupMode checks if the system is in UEFI Setup Mode.

func (*EFIVarReader) ListVars

func (r *EFIVarReader) ListVars() ([]string, error)

ListVars returns all EFI variable names.

func (*EFIVarReader) ReadVar

func (r *EFIVarReader) ReadVar(name string) ([]byte, error)

ReadVar reads the value of an EFI variable (skips the 4-byte attributes prefix).

func (*EFIVarReader) WriteVar

func (r *EFIVarReader) WriteVar(name string, attrs uint32, data []byte) error

WriteVar writes an EFI variable with the given attributes and data.

Jump to

Keyboard shortcuts

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