Documentation ¶
Index ¶
- Variables
- func SerializeEfivars(f io.Writer, b []byte) error
- func WriteEfivars(name string, attrs Attributes, b []byte) error
- func WriteEfivarsFile(filename, b []byte, fixImmutable bool) error
- func WriteEfivarsWithGuid(name string, attrs Attributes, b []byte, guid util.EFIGUID) error
- type Attributes
- func ParseEfivars(f io.Reader, size int) (Attributes, *bytes.Buffer, error)
- func ReadEfivars(filename string) (Attributes, *bytes.Buffer, error)
- func ReadEfivarsFile(filename string) (Attributes, *bytes.Buffer, error)
- func ReadEfivarsWithGuid(filename string, guid util.EFIGUID) (Attributes, *bytes.Buffer, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EFI_IMAGE_SECURITY_DATABASE_GUID = util.EFIGUID{0xd719b2cb, 0x3d3a, 0x4596, [8]uint8{0xa3, 0xbc, 0xda, 0xd0, 0x0e, 0x67, 0x65, 0x6f}} IMAGE_SECURITY_DATABASE = "db" IMAGE_SECURITY_DATABASE1 = "dbx" IMAGE_SECURITY_DATABASE2 = "dbt" IMAGE_SECURITY_DATABASE3 = "dbr" ImageSecurityDatabases = map[string]bool{ IMAGE_SECURITY_DATABASE: true, IMAGE_SECURITY_DATABASE1: true, IMAGE_SECURITY_DATABASE2: true, IMAGE_SECURITY_DATABASE3: true, } )
Valid Databases db - authorized signature database dbx - forbidden signature database dbt - authorized timestamp signature database dbr - authorized recovery signature database
View Source
var EFI_GLOBAL_VARIABLE = util.EFIGUID{0x8BE4DF61, 0x93CA, 0x11d2, [8]uint8{0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C}}
View Source
var (
Efivars = "/sys/firmware/efi/efivars"
)
View Source
var SizeofAttributes = 4
Functions ¶
func WriteEfivarsFile ¶
func WriteEfivarsWithGuid ¶
Write an EFI variable to sysfs TODO: Fix retryable writes
Types ¶
type Attributes ¶
type Attributes uint32
Section 8.2 Variable Services
const ( EFI_VARIABLE_NON_VOLATILE Attributes = 0x00000001 EFI_VARIABLE_BOOTSERVICE_ACCESS Attributes = 0x00000002 EFI_VARIABLE_RUNTIME_ACCESS Attributes = 0x00000004 EFI_VARIABLE_HARDWARE_ERROR_RECORD Attributes = 0x00000008 EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS Attributes = 0x00000010 // Deprecated, we only reserve it EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS Attributes = 0x00000020 EFI_VARIABLE_APPEND_WRITE Attributes = 0x00000040 EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS Attributes = 0x00000080 // Uses the EFI_VARIABLE_AUTHENTICATION_3 struct )
func ParseEfivars ¶
func ReadEfivars ¶
func ReadEfivars(filename string) (Attributes, *bytes.Buffer, error)
Reads a known EFI variable from efivarfs.
func ReadEfivarsFile ¶
func ReadEfivarsFile(filename string) (Attributes, *bytes.Buffer, error)
For a full path instead of the inferred efivars path
func ReadEfivarsWithGuid ¶
func (Attributes) Bytes ¶
func (a Attributes) Bytes() []byte
func (Attributes) Equal ¶
func (a Attributes) Equal(b Attributes) bool
func (Attributes) Unmarshal ¶
func (a Attributes) Unmarshal(b *bytes.Buffer)
Click to show internal directories.
Click to hide internal directories.