uefi

package
v7.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EdkiiVarErrorFlagGuid                    = "04b37fe8-f6ae-480b-bdd5-37d98c5e89aa"
	EfiAuthenticatedVariableGuid             = "aaf32c78-947b-439a-a180-2e144ec37792"
	EfiCertDbGuid                            = "d9bee56e-75dc-49d9-b4d7-b534210f637a"
	EfiCertPkcs7Guid                         = "4aafd29d-68df-49ee-8aa9-347d375665a7"
	EfiCertRsa2048Guid                       = "3c5766e8-269c-4e34-aa14-ed776e85b3b6"
	EfiCertRsa2048Sha1Guid                   = "67f8444f-8743-48f1-a328-1eaab8736080"
	EfiCertRsa2048Sha256Guid                 = "e2b36190-879b-4a3d-ad8d-f2e7bba32784"
	EfiCertSha1Guid                          = "826ca512-cf10-4ac9-b187-be01496631bd"
	EfiCertSha224Guid                        = "0b6e5233-a65c-44c9-9407-d9ab83bfc8bd"
	EfiCertSha256Guid                        = "c1c41626-504c-4092-aca9-41f936934328"
	EfiCertSha384Guid                        = "ff3e5307-9fd0-48c9-85f1-8ad56c701e01"
	EfiCertSha512Guid                        = "093e0fae-a6c4-4f50-9f1b-d41e2b89c19a"
	EfiCertSm3Guid                           = "57347f87-7a9b-403a-b93c-dc4afb7a0ebc"
	EfiCertX509Guid                          = "a5c059a1-94e4-4aa7-87b5-ab155c2bf072"
	EfiCertX509Sha256Guid                    = "3bd2a492-96c0-4079-b420-fcf98ef103ed"
	EfiCertX509Sha384Guid                    = "7076876e-80c2-4ee6-aad2-28b349a6865b"
	EfiCertX509Sha512Guid                    = "446dbf63-2502-4cda-bcfa-2465d2b0fe9d"
	EfiCertX509Sm3Guid                       = "60d807e5-10b4-49a9-9331-e40437888d37"
	EfiCustomModeEnableGuid                  = "c076ec0c-7028-4399-a072-71ee5c448b9f"
	EfiDebugPortProtocolGuid                 = "eba4e8d2-3858-41ec-a281-2647ba9660d0"
	EfiDhcp6ServiceBindingProtocolGuid       = "9fb9a8a1-2f4a-43a6-889c-d0f7b6c47ad5"
	EfiGlobalVariableGuid                    = "8be4df61-93ca-11d2-aa0d-00e098032b8c"
	EfiImageSecurityDatabaseGuid             = "d719b2cb-3d3a-4596-a3bc-dad00e67656f"
	EfiIp4Config2ProtocolGuid                = "5b446ed1-e30b-4faa-871a-3654eca36080"
	EfiIp6ConfigProtocolGuid                 = "937fe521-95ae-4d1a-8929-48bcd90ad31a"
	EfiMemoryOverwriteControlDataGuid        = "e20939be-32d4-41be-a150-897f85d49829"
	EfiMemoryOverwriteRequestControlLockGuid = "bb983ccf-151d-40e1-a07b-4a17be168292"
	EfiMemoryTypeInformationGuid             = "4c19049f-4137-4dd3-9c10-8b97a83ffdfa"
	EfiPcAnsiGuid                            = "e0c14753-f9be-11d2-9a0c-0090273fc14d"
	EfiPersistentVirtualCdGuid               = "08018188-42cd-bb48-100f-5387d53ded3d"
	EfiPersistentVirtualDiskGuid             = "5cea02c9-4d07-69d3-269f-4496fbe096f9"
	EfiSasDevicePathGuid                     = "d487ddb4-008b-11d9-afdc-001083ffca4d"
	EfiSecureBootEnableDisableGuid           = "f0a30bc7-af08-4556-99c4-001009c93a44"
	EfiSystemNvDataFvGuid                    = "fff12b8d-7696-4c8b-a985-2747075b4f50"
	EfiUartDevicePathGuid                    = "37499a9d-542f-4c89-a026-35da142094e4"
	EfiVT100Guid                             = "dfa66065-b419-11d3-9a2d-0090273fc14d"
	EfiVT100PlusGuid                         = "7baec70b-57e0-4c76-8e87-2f9e28088343"
	EfiVTUTF8Guid                            = "ad15a0d6-8bec-4acf-a073-d01de77e2d88"
	EfiVendorKeysNvGuid                      = "9073e4e0-60ec-4b6e-9903-4c223c260f3c"
	EfiVirtualCdGuid                         = "3d5abd30-4175-87ce-6d64-d2ade523c4bb"
	EfiVirtualDiskGuid                       = "77ab535a-45fc-624b-5560-f7b281d1f96e"
	IScsiConfigGuid                          = "4b47d616-a8d6-4552-9d44-ccad2e0f4cf9"
	OvmfPlatformConfigGuid                   = "7235c51c-0c80-4cab-87ac-3b084a6304b1"
	Tcg2ConfigFormSetGuid                    = "6339d487-26ba-424b-9a5d-687e25d740bc"

	BmHardDriveBootVariableGuid = "fab7e9e1-39dd-4f2b-8408-e20e906cb6de"

	IncusVendorGuid     = "7b3743d8-4c1f-420a-b4d7-3654fa4792cc"
	MicrosoftVendorGuid = "77fa9abd-0359-4d32-bd60-28f4e78f784b"
	MtcVendorGuid       = "eb704011-1402-11d3-8e77-00a0c969723b"
	OvmfVendorGuid      = "a0baa8a3-041d-48a8-bc87-c36d121b5e3d" // Non-standard.

	ShimLockGuid = "605dab50-e046-4300-abb6-3dd810dd8b23"
)

Variables

This section is empty.

Functions

func Dissect

func Dissect(v *api.InstanceNVRAMVariable, guid string, name string) error

Dissect dissects a UEFI variable.

func DumpAttributes

func DumpAttributes(attributes []string) uint32

DumpAttributes packs a list of UEFI variable attributes.

func ESLGUIDVar

func ESLGUIDVar(esl string) (string, string)

ESLGUIDVar gets the GUID and variable name associated to the given ESL.

func Format

func Format(v *api.InstanceNVRAMVariable, guid string, name string) error

Format formats a UEFI variable.

func GUIDName

func GUIDName(g string) string

GUIDName returns a familiar symbolic name for a known GUID, or the GUID itself.

func ParseAttributes

func ParseAttributes(rawAttributes uint32) []string

ParseAttributes parses UEFI variable attributes and formats them.

func ParseBootXXXX

func ParseBootXXXX(name string) (string, uint16, bool)

ParseBootXXXX tries to parse `Boot####` and related variable names.

func ParseGUID

func ParseGUID(s string) (string, error)

ParseGUID tries to parse the given string as a GUID.

func ParseGUIDOrName

func ParseGUIDOrName(s string) (string, error)

ParseGUIDOrName tries to parse the given string as a familiar GUID name, or as a raw GUID.

Types

type Boot

type Boot struct {
	Active         bool       `json:"active"`
	ForceReconnect bool       `json:"force_reconnect"`
	Hidden         bool       `json:"hidden"`
	Category       string     `json:"category"`
	Description    string     `json:"description"`
	DevicePaths    [][]string `json:"paths"`
	OptionalData   string     `json:"optional_data,omitempty"`
}

Boot represents a boot entry.

type ESL

type ESL []ESLNode

ESL represents an EFI Signature List.

type ESLEntry

type ESLEntry struct {
	Owner string `json:"owner"`
	Data  []byte `json:"data"`
}

ESLEntry represents an ESL entry.

type ESLNode

type ESLNode struct {
	Type    string     `json:"type"`
	Header  []byte     `json:"header,omitempty"`
	Entries []ESLEntry `json:"entries"`
}

ESLNode represents a collection of ESL entries sharing a type and a header.

type Store

type Store struct {
	Vars map[string]map[string]*api.InstanceNVRAMVariable
	// contains filtered or unexported fields
}

Store is a projection of the on-disk OVMF variable store format. The structure DOES NOT handle concurrent access.

func ParseNVRAM

func ParseNVRAM(data []byte) (*Store, error)

ParseNVRAM parses the contents of an OVMF NVRAM store.

func (*Store) Bytes

func (s *Store) Bytes() ([]byte, error)

Bytes writes a binary OVMF NVRAM store.

func (*Store) Get

func (s *Store) Get(guid string, varName string) (*api.InstanceNVRAMVariable, bool)

Get gets a variable from the store.

func (*Store) Has

func (s *Store) Has(guid string, varName string) bool

Has checks whether the store contains a variable.

func (*Store) Modified

func (s *Store) Modified() bool

Modified returns whether the store was modified.

func (*Store) Set

func (s *Store) Set(guid string, varName string, v api.InstanceNVRAMVariable) error

Set sets a variable in the store.

func (*Store) Unset

func (s *Store) Unset(guid string, varName string) bool

Unset removes a variable from the store.

Jump to

Keyboard shortcuts

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