Skip to content

Inf generator

inf_generator

Module to generate inf files for capsule update based on an INF template.

Uses supplied information such as Name, Version, ESRT Guid, Rollback, etc.

InfSection

Object representing an INF Section.

__init__

__init__(name: str) -> InfSection

Inits the object.

__str__

__str__() -> str

Returns the string representation of the object.

Returns:

Type Description
str

string representation of the object.

InfGenerator

An object that generates an INF file from data it is initialized with.

Name property writable

Name: str

Getter for the Name Attribute.

Provider property writable

Provider: str

Getter for the Provider Attribute.

Manufacturer property writable

Manufacturer: str

Getter for the Manufacturer Attribute.

NOTE: Returns Provider attribute if Manufacturer attribute is not set.

Description property writable

Description: str

Getter for the Description Attribute.

EsrtGuid property writable

EsrtGuid: str

Getter for the EsrtGuid Attribute.

VersionString property writable

VersionString: str

Getter for VersionString attribute.

VersionHex property writable

VersionHex: str

Getter for the VersionHex attribute.

Arch property writable

Arch: str

Getter for the Arch property.

Date property writable

Date: str

Getter for the date attribute.

Formats to a m/d/y str before returning

IntegrityFilename property writable

IntegrityFilename: Optional[str]

Getter for the Integrity File Name.

Transforms value into string.

__init__

__init__(
    name_string: str,
    provider: str,
    esrt_guid: str,
    arch: str,
    description_string: str,
    version_string: str,
    version_hex: str,
) -> None

Inits the object with data necessary to generate an INF file.

Parameters:

Name Type Description Default
name_string str

Name

required
provider str

Provider

required
esrt_guid str

stringified guid, will be converted

required
arch str

architecture

required
description_string str

description

required
version_string str

version

required
version_hex int

version

required

MakeInf

MakeInf(
    OutputInfFilePath: os.PathLike,
    FirmwareBinFileName: str,
    Rollback: bool = False,
) -> int

Generates the INF with provided information.

Parameters:

Name Type Description Default
OutputInfFilePath PathLike

Path to existing file

required
FirmwareBinFileName str

File Name

required
Rollback
False