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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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