Documentation ¶
Index ¶
- Variables
- func ClearRwVpd() error
- func FlashromRWVpdSet(key string, value []byte, delete bool) error
- func FlashromVpdDump() error
- func Get(key string, readOnly bool) ([]byte, error)
- func GetAll(readOnly bool) (map[string][]byte, error)
- func Set(key string, value []byte, readOnly bool) error
- type Reader
Constants ¶
This section is empty.
Variables ¶
var ( MaxBootEntry = 9999 DefaultVpdDir = "/sys/firmware/vpd" )
default variables
Functions ¶
func ClearRwVpd ¶
func ClearRwVpd() error
ClearRwVpd re-format RW_VPD via flashrom and vpd executables
func FlashromRWVpdSet ¶
Set RW_VPD key-value via flashrom and vpd executables, delete set to false would set or add the key, delete set to true would delete an existing key.
func FlashromVpdDump ¶
func FlashromVpdDump() error
FlashromVpdDump read and dump all VPD values from RO and RW VPD flash regions directly
Types ¶
type Reader ¶
type Reader struct {
VpdDir string
}
Reader is a VPD reader object.
func (*Reader) Get ¶
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 (*Reader) GetAll ¶
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 (*Reader) Set ¶
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.