uefivars

package
v7.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: BSD-3-Clause Imports: 10 Imported by: 7

Documentation

Overview

Package uefivars manipulates UEFI variables, and can encode and decode the mixed-endianness GUIDs used by UEFI (and MS).

Subpackage boot deals specifically with UEFI boot variables.

Index

Constants

This section is empty.

Variables

View Source
var EfiVarDir = "/sys/firmware/efi/vars"

overridden for testing

Functions

func BytesToU16

func BytesToU16(b []byte) uint16

BytesToU16 converts a []byte of length 2 to a uint16.

func DecodeUTF16

func DecodeUTF16(b []byte) (string, error)

DecodeUTF16 decodes the input as a utf16 string. https://gist.github.com/bradleypeabody/185b1d7ed6c0c2ab6cec

Types

type EfiVar

type EfiVar struct {
	Uuid, Name string
	Data       []byte
}

EfiVar is a generic efi var

func ReadVar

func ReadVar(uuid, name string) (e EfiVar, err error)

type EfiVars

type EfiVars []EfiVar

func AllVars

func AllVars() (vars EfiVars)

AllVars returns all efi variables

func ReadVars

func ReadVars(filt VarFilter) (vars EfiVars)

ReadVars returns efi variables matching filter

func (EfiVars) Filter

func (vars EfiVars) Filter(filt VarFilter) EfiVars

Filter returns the elements of the list for which the filter function returns true.

type MixedGUID

type MixedGUID [16]byte

MixedGUID is a mixed-endianness guid, as used by MS and UEFI.

func (MixedGUID) String

func (m MixedGUID) String() string

String converts a MixedGUID to string.

func (MixedGUID) ToStdEnc

func (m MixedGUID) ToStdEnc() (u UUID)

ToStdEnc converts MixedGuid to a UUID.

type UUID

type UUID [16]byte

UUID uses the normal ordering, compatible with github.com/google/uuid. Use a package such as that if you need to generate UUIDs, check types, etc.

func (UUID) String

func (u UUID) String() string

String converts a UUID to string.

func (UUID) ToMixedGUID

func (u UUID) ToMixedGUID() (m MixedGUID)

ToMixedGuid converts UUID to MixedGuid.

type VarFilter

type VarFilter func(uuid, name string) bool

VarFilter is a type of function used to filter efi vars

func AndFilter

func AndFilter(filters ...VarFilter) VarFilter

AndFilter returns true only if all given filters return true.

func NotFilter

func NotFilter(f VarFilter) VarFilter

NotFilter returns a filter negating the given filter.

Directories

Path Synopsis
Package boot manipulates UEFI boot variables, and can identify and mount the volume referenced by a boot var.
Package boot manipulates UEFI boot variables, and can identify and mount the volume referenced by a boot var.
Package vartest contains utility functions for testing uefivars and subpackages.
Package vartest contains utility functions for testing uefivars and subpackages.

Jump to

Keyboard shortcuts

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