vpd

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VpdDir       = "/sys/firmware/vpd"
	MaxBootEntry = 9999
)

VpdDir points to the base directory where the VPD sysfs interface is located. It is an exported variable to allow for testing

Functions

func Get

func Get(key string, readOnly bool) ([]byte, error)

Get reads a VPD variable by name and returns its value as a sequence of bytes. The `readOnly` flag specifies whether the variable is read-only or read-write.

func GetAll

func GetAll(readOnly bool) (map[string][]byte, error)

GetAll reads all the VPD variables and returns a map contaiing each name:value couple. The `readOnly` flag specifies whether the variable is read-only or read-write.

func Set

func Set(key string, value []byte, readOnly bool) error

Set sets a VPD variable with `key` as name and `value` as its byte-stream value. The `readOnly` flag specifies whether the variable is read-only or read-write. NOTE Unfortunately Set doesn't currently work, because the sysfs interface does not support writing. To write, this library needs a backend able to write to flash chips, like the command line tool flashrom or flashtools.

Types

This section is empty.

Jump to

Keyboard shortcuts

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