firmware

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package firmware collects firmware version information from sysfs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NICFirmware

type NICFirmware struct {
	Interface string `json:"interface"`
	Driver    string `json:"driver"`
	Version   string `json:"version"`
	PCIAddr   string `json:"pciAddr,omitempty"`
}

NICFirmware holds firmware info for a network interface.

type Policy

type Policy struct {
	MinBIOSVersion string            `json:"minBiosVersion,omitempty"`
	MinBMCVersion  string            `json:"minBmcVersion,omitempty"`
	MinNICVersions map[string]string `json:"minNicVersions,omitempty"` // driver → min version
}

Policy defines minimum firmware version requirements for validation.

type Report

type Report struct {
	BIOS        Version           `json:"bios"`
	BMC         Version           `json:"bmc,omitempty"`
	NICs        []NICFirmware     `json:"nics,omitempty"`
	Storage     []StorageFirmware `json:"storage,omitempty"`
	CollectedAt time.Time         `json:"collectedAt"`
}

Report holds firmware versions collected during provisioning.

func Collect

func Collect() (*Report, error)

Collect gathers firmware version data from sysfs.

type StorageFirmware

type StorageFirmware struct {
	Controller string `json:"controller"`
	Model      string `json:"model,omitempty"`
	Version    string `json:"version"`
}

StorageFirmware holds firmware info for a storage controller.

type ValidationResult

type ValidationResult struct {
	Name    string `json:"name"`
	Status  string `json:"status"` // "pass" or "fail"
	Message string `json:"message"`
}

ValidationResult holds the outcome of a single firmware version check.

func Validate

func Validate(report *Report, policy Policy) []ValidationResult

Validate checks firmware versions against a policy and returns results.

type Version

type Version struct {
	Component string `json:"component"`
	Version   string `json:"version"`
	Date      string `json:"date,omitempty"`
	Vendor    string `json:"vendor,omitempty"`
}

Version describes a firmware component's version information.

Directories

Path Synopsis
nic

Jump to

Keyboard shortcuts

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