pcd

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: BSD-3-Clause Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrAmiTcgPlatformPeiAfterMemPEFileNotFound

type ErrAmiTcgPlatformPeiAfterMemPEFileNotFound struct{}

ErrAmiTcgPlatformPeiAfterMemPEFileNotFound means it was unable to find the beginning of the PE file (which contains the PCD firmware vendor value).

func (*ErrAmiTcgPlatformPeiAfterMemPEFileNotFound) Error

type ErrAmiTcgPlatformPeiAfterMemUnableToFindPcdFirmwareVendorStart

type ErrAmiTcgPlatformPeiAfterMemUnableToFindPcdFirmwareVendorStart struct{}

ErrAmiTcgPlatformPeiAfterMemUnableToFindPcdFirmwareVendorStart means it was unable to find the beginning of the PCD firmware vendor value.

func (*ErrAmiTcgPlatformPeiAfterMemUnableToFindPcdFirmwareVendorStart) Error

type ErrDoesNotMatch

type ErrDoesNotMatch struct {
	A []byte
	B []byte
}

ErrDoesNotMatch means a value was received with multiple ways, but the value does not match (while it should've).

func (*ErrDoesNotMatch) Error

func (err *ErrDoesNotMatch) Error() string

type ErrDummyFirmwareVersionFileWrongType

type ErrDummyFirmwareVersionFileWrongType struct{}

ErrDummyFirmwareVersionFileWrongType means the version file of a dummy firmware is not a file.

func (*ErrDummyFirmwareVersionFileWrongType) Error

type ErrHPPcdFirmwareVendorEndNotFound

type ErrHPPcdFirmwareVendorEndNotFound struct{}

ErrHPPcdFirmwareVendorEndNotFound means it was unable to find the end of the PCD firmware vendor value.

func (*ErrHPPcdFirmwareVendorEndNotFound) Error

type ErrInvalidAmiTcgPlatformPeiAfterMem

type ErrInvalidAmiTcgPlatformPeiAfterMem struct{}

ErrInvalidAmiTcgPlatformPeiAfterMem means it was unable to parse the AmiTcgPlatformPeiAfterMem volume (it appears to be of unexpected/unknown type).

func (*ErrInvalidAmiTcgPlatformPeiAfterMem) Error

type ErrInvalidTCGPEIModule

type ErrInvalidTCGPEIModule struct{}

ErrInvalidTCGPEIModule means it was unable to parse the TCG PEI module volume (it appears to be of unexpected/unknown type).

func (*ErrInvalidTCGPEIModule) Error

func (err *ErrInvalidTCGPEIModule) Error() string

type ErrTcgPiePEFileNotFound

type ErrTcgPiePEFileNotFound struct{}

ErrTcgPiePEFileNotFound means it was unable to find the beginning of the PE file (which contains the PCD firmware vendor value).

func (*ErrTcgPiePEFileNotFound) Error

func (err *ErrTcgPiePEFileNotFound) Error() string

type ErrTcgPieUnableToFindPcdFirmwareVendorStart

type ErrTcgPieUnableToFindPcdFirmwareVendorStart struct{}

ErrTcgPieUnableToFindPcdFirmwareVendorStart means it was unable to find the beginning of the PCD firmware vendor value within the TCG PIE module.

func (*ErrTcgPieUnableToFindPcdFirmwareVendorStart) Error

type ErrTooDummyFirmwareVersionFiles

type ErrTooDummyFirmwareVersionFiles struct{}

ErrTooDummyFirmwareVersionFiles means there were found too many files with the GUID used exclusively in dummy firmwares we invented. There should be only one such file in a dummy firmware.

func (*ErrTooDummyFirmwareVersionFiles) Error

type ErrTooManyAmiTcgPlatformPeiAfterMems

type ErrTooManyAmiTcgPlatformPeiAfterMems struct{}

ErrTooManyAmiTcgPlatformPeiAfterMems means multiple AmiTcgPlatformPeiAfterMem volume, which is not supported (an unknown case)

func (*ErrTooManyAmiTcgPlatformPeiAfterMems) Error

type ErrTooManyTCGPEIModules

type ErrTooManyTCGPEIModules struct{}

ErrTooManyTCGPEIModules means there's more than one TCG PEI module, which is not supported (an unknown case).

func (*ErrTooManyTCGPEIModules) Error

func (err *ErrTooManyTCGPEIModules) Error() string

type ErrUnknownVendorType

type ErrUnknownVendorType struct{}

ErrUnknownVendorType means the vendor type is not supported

func (*ErrUnknownVendorType) Error

func (err *ErrUnknownVendorType) Error() string

type FirmwareImage

type FirmwareImage = *uefi.UEFI

FirmwareImage is an UEFI firmware image.

type Interface

type Interface interface {
	// GetFirmwareVendorVersion returns the firmware vendor version value.
	GetFirmwareVendorVersion() []byte
}

Interface is the abstraction over any PCD-values source

type ParsedFirmware

type ParsedFirmware interface {
	Interface

	// GetFirmwareVendorVersionRanges returns ranges which contains the
	// firmware vendor version value.
	GetFirmwareVendorVersionRanges() pkgbytes.Ranges

	// GetFirmwareVendorVersionCodeRanges returns ranges which defines
	// the code which is responsible for the firmware vendor version value.
	GetFirmwareVendorVersionCodeRanges() pkgbytes.Ranges

	// GetFirmwareVendorVersionFFSGUID returns the GUID of the FFS node which
	// was used as the source of the firmware vendor version value.
	GetFirmwareVendorVersionFFSGUID() guid.GUID
}

ParsedFirmware is abstraction over PCD-values extracted from a firmware image.

func ParseFirmware

func ParseFirmware(firmwareImage FirmwareImage) (pcd ParsedFirmware, err error)

ParseFirmware extracts PCD values from an UEFI firmware.

If "pcd" is not nil and "err" is not nil, then the value was successfully parsed, but there was detected a problem (warning). If "pcd" is nil, but "err" is not nil, then there occurred an error while parsing the value.

func ParseFirmwareDummy

func ParseFirmwareDummy(
	firmwareImage FirmwareImage,
) (ParsedFirmware, error)

ParseFirmwareDummy is a variant of ParseFirmware for dummy firmware, generated by ../../testdata/firmware/scripts/generate_fake_intel_firmware.sh

func ParseFirmwareOCP

func ParseFirmwareOCP(
	firmwareImage FirmwareImage,
) (ParsedFirmware, error)

ParseFirmwareOCP is a variant of ParseFirmware for OCP firmwares

type ParsedFirmwareGeneric

type ParsedFirmwareGeneric struct {
	FirmwareImage FirmwareImage

	FirmwareVendorVersionRanges     pkgbytes.Ranges
	FirmwareVendorVersionCodeRanges pkgbytes.Ranges
	FirmwareVendorVersionFFSGUID    guid.GUID
}

ParsedFirmwareGeneric is a generic parsed PCD

func (*ParsedFirmwareGeneric) GetFirmwareVendorVersion

func (pcd *ParsedFirmwareGeneric) GetFirmwareVendorVersion() []byte

GetFirmwareVendorVersion returns firmware vendor version

func (*ParsedFirmwareGeneric) GetFirmwareVendorVersionCodeRanges

func (pcd *ParsedFirmwareGeneric) GetFirmwareVendorVersionCodeRanges() pkgbytes.Ranges

GetFirmwareVendorVersionCodeRanges return the address of the whole executable, containing the firmware vendor version (if it is stored in the executable file).

func (*ParsedFirmwareGeneric) GetFirmwareVendorVersionFFSGUID

func (pcd *ParsedFirmwareGeneric) GetFirmwareVendorVersionFFSGUID() guid.GUID

GetFirmwareVendorVersionFFSGUID returns the GUID of the component which stores the firmware vendor version

func (*ParsedFirmwareGeneric) GetFirmwareVendorVersionRanges

func (pcd *ParsedFirmwareGeneric) GetFirmwareVendorVersionRanges() pkgbytes.Ranges

GetFirmwareVendorVersionRanges returns where the firmware vendor version is stored.

type ParsedFirmwareOCPGeneric

type ParsedFirmwareOCPGeneric struct {
	ParsedFirmwareGeneric
}

ParsedFirmwareOCPGeneric is a fallback "parser", which is used if the image corresponds to OCP, but a specific parsed was not found.

func (*ParsedFirmwareOCPGeneric) GetFirmwareVendorVersion

func (pcd *ParsedFirmwareOCPGeneric) GetFirmwareVendorVersion() []byte

GetFirmwareVendorVersion returns a hardcoded firmware vendor version if no vendor version was parsed by other parser.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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