Documentation ¶
Overview ¶
Package ocp implements OCP/Facebook-specific IPMI client functions.
Package ocp implements OCP/Facebook-specific IPMI client functions.
Index ¶
- Constants
- Variables
- func CheckBMCBootOrder(i *ipmi.IPMI, bmcBootOverride bool, l ulog.Logger) error
- func ClearCMOSClearValidBits(i *ipmi.IPMI, data []byte) error
- func IsCMOSClearSet(i *ipmi.IPMI) (bool, []byte, error)
- func SendOemIpmiBootDriveInfo(i *ipmi.IPMI, info *BootDriveInfo) error
- func SendOemIpmiDimmInfo(i *ipmi.IPMI, info []DimmInfo) error
- func SendOemIpmiProcessorInfo(i *ipmi.IPMI, info []ProcessorInfo) error
- func SetOemIpmiPostEnd(i *ipmi.IPMI) error
- type BootDriveInfo
- type BootOrder
- type DimmInfo
- type ProcessorInfo
Constants ¶
const ( // Boot order bit[2:0] defined as // 000b: USB device // 001b: Network // 010b: SATA HDD // 011b: SATA-CDROM // 100b: Other removable Device // If bit[2:0] is 001b (Network), bit3 determines IPv4/IPv6 order, // when bit3 is 0: IPv4 first, bit3 is 1: IPv6 first NETWORK_BOOT = 0x1 NETWORK_BOOT_IPV6 = 0x1 | 0x8 LOCAL_BOOT = 0x2 INVALID_BOOT = 0xff // Default boot order systembooter configurations NETBOOTER_CONFIG = "{\"type\":\"pxeboot\"}" // IPV4 and IPV6 default to true NETBOOTER_IPV6_CONFIG = "{\"type\":\"pxeboot\",\"ipv6\":\"true\",\"ipv4\":\"false\"}" LOCALBOOTER_CONFIG = "{\"type\":\"boot\"}" )
Variables ¶
var ( // BmcUpdatedBootorder is true when IPMI set boot order has been issued BmcUpdatedBootorder = false // BootEntries is created with the new boot order and will be used to boot this time BootEntries []systembooter.BootEntry )
var OENMap = map[string][3]uint8{
"Wiwynn": {0x0, 0x9c, 0x9c},
}
OENMap maps OEM names to a 3 byte OEM number.
OENs are typically serialized as the first 3 bytes of a request body.
Functions ¶
func CheckBMCBootOrder ¶
CheckBMCBootOrder synchronize BIOS's boot order with BMC's boot order. When BMC IPMI sets boot order (valid bit 1), BIOS will update VPD boot order and create new BootEntries accordingly. If BMC didn't set boot order, BIOS would set its current boot order to BMC.
func ClearCMOSClearValidBits ¶
Set BIOS boot order with both CMOS clear and valid bits cleared
func IsCMOSClearSet ¶
Get BIOS boot order data and check if CMOS clear bit and valid bit are both set
func SendOemIpmiBootDriveInfo ¶ added in v0.9.0
func SendOemIpmiBootDriveInfo(i *ipmi.IPMI, info *BootDriveInfo) error
func SendOemIpmiProcessorInfo ¶
func SendOemIpmiProcessorInfo(i *ipmi.IPMI, info []ProcessorInfo) error
func SetOemIpmiPostEnd ¶
Types ¶
type BootDriveInfo ¶ added in v0.9.0
type BootDriveInfo struct { ManufacturerID [3]uint8 ControlType uint8 DriveNumber uint8 ParameterSelector uint8 VendorID uint16 DeviceID uint16 }
func GetOemIpmiBootDriveInfo ¶ added in v0.9.0
func GetOemIpmiBootDriveInfo(si *smbios.Info) (*BootDriveInfo, error)
Read type 9 from SMBIOS tables and look for SlotDesignation which contains string 'Boot_Drive', and get bus and device number from the matched table to read the Device ID and Vendor ID of the boot drive for sending the IPMI OEM command. This requires the BDF number is correctly set in the type 9 table.
type DimmInfo ¶
type DimmInfo struct { ManufacturerID [3]uint8 Index uint8 ParameterSelector uint8 DIMMPresent uint8 NodeNumber uint8 ChannelNumber uint8 DIMMNumber uint8 DIMMType uint8 DIMMSpeed uint16 DIMMSize uint32 ModulePartNumber [20]byte ModuleSerialNumber uint32 ModuleManufacturerIDLSB uint8 ModuleManufacturerIDMSB uint8 }
type ProcessorInfo ¶
type ProcessorInfo struct { ManufacturerID [3]uint8 Index uint8 ParameterSelector uint8 ProductName [48]byte CoreNumber uint8 ThreadNumberLSB uint8 ThreadNumberMSB uint8 ProcessorFrequencyLSB uint8 ProcessorFrequencyMSB uint8 Revision1 uint8 Revision2 uint8 }
func GetOemIpmiProcessorInfo ¶
func GetOemIpmiProcessorInfo(si *smbios.Info) ([]ProcessorInfo, error)