Class
FwupdPluginFirmware
Description [src]
class FwupdPlugin.Firmware : GObject.Object {
parent_instance: GObject
}
A firmware file which can have children which represent the images within.
See also: FuDfuFirmware
, FuIhexFirmware
, FuSrecFirmware
Descendants
- FuAcpiTable
- FuArchiveFirmware
- FuCfuOffer
- FuCfuPayload
- FuCoswidFirmware
- FuDfuFirmware
- FuEfiFirmwareFile
- FuEfiFirmwareFilesystem
- FuEfiFirmwareSection
- FuEfiFirmwareVolume
- FuEfiSignature
- FuEfiSignatureList
- FuFdtFirmware
- FuFdtImage
- FuFmapFirmware
- FuIfdFirmware
- FuIfdImage
- FuIfwiCpdFirmware
- FuIfwiFptFirmware
- FuIhexFirmware
- FuIntelThunderboltNvm
- FuLinearFirmware
- FuOpromFirmware
- FuPefileFirmware
- FuSmbios
- FuSrecFirmware
- FuUsbDeviceDs20
- FuUswidFirmware
Constructors
fu_firmware_new_from_bytes
Creates a firmware object with the provided image set as default.
since: 1.3.1
Functions
fu_firmware_strparse_uint16_safe
Parses a base 16 number from a string of 4 characters in length.
The returned value
will range from 0 to 0xffff.
since: 1.5.6
fu_firmware_strparse_uint24_safe
Parses a base 16 number from a string of 6 characters in length.
The returned value
will range from 0 to 0xffffff.
since: 1.5.6
fu_firmware_strparse_uint32_safe
Parses a base 16 number from a string of 8 characters in length.
The returned value
will range from 0 to 0xffffffff.
since: 1.5.6
fu_firmware_strparse_uint4_safe
Parses a base 16 number from a string of 1 character in length.
The returned value
will range from 0 to 0xf.
since: 1.5.6
fu_firmware_strparse_uint8_safe
Parses a base 16 number from a string of 2 characters in length.
The returned value
will range from 0 to 0xff.
since: 1.5.6
Instance methods
fu_firmware_add_patch
Adds a byte patch at a specific offset. If a patch already exists at the specified address then it is replaced.
since: 1.7.4
fu_firmware_build
Builds a firmware from an XML manifest. The manifest would typically have the following form:
since: 1.5.0
fu_firmware_build_from_xml
Builds a firmware from an XML manifest. The manifest would typically have the following form:
since: 1.6.0
fu_firmware_check_compatible
Check a new firmware is compatible with the existing firmware.
since: 1.8.4
fu_firmware_export_to_xml
This allows us to build an XML object for the nested firmware.
since: 1.6.0
fu_firmware_get_bytes
Gets the firmware payload, which does not have any header or footer included.
since: 1.6.0
fu_firmware_get_bytes_with_patches
Gets the firmware payload, with any defined patches applied.
since: 1.7.4
fu_firmware_get_filename
Gets an optional filename that represents the image source or destination.
since: 1.6.0
fu_firmware_get_image_by_checksum
Gets the firmware image using the image checksum. The checksum type is guessed based on the length of the input string.
since: 1.5.5
fu_firmware_get_image_by_idx_bytes
Gets the firmware image bytes using the image index.
since: 1.3.1
fu_firmware_get_size
Gets the total size of the image, which is typically the same size as the data from fu_firmware_write().
since: 1.6.0
fu_firmware_get_version_raw
Gets an raw version that represents the firmware. This is most frequently
used when building firmware with <version_raw>0x123456</version_raw>
in a
firmware.builder.xml
file to avoid string splitting and sanity checks.
since: 1.5.7
fu_firmware_parse_file
Parses a firmware file, typically breaking the firmware into images.
since: 1.3.3
fu_firmware_remove_image_by_id
Removes the first image from the firmware matching the ID.
since: 1.5.0
fu_firmware_remove_image_by_idx
Removes the first image from the firmware matching the index.
since: 1.5.0
fu_firmware_set_bytes
Sets the contents of the image if not created with fu_firmware_new_from_bytes().
since: 1.6.0
fu_firmware_set_filename
Sets an optional filename that represents the image source or destination.
since: 1.6.0
fu_firmware_set_size
Sets the total size of the image, which should be the same size as the data from fu_firmware_write().
since: 1.6.0
fu_firmware_tokenize
Tokenizes a firmware, typically breaking the firmware into records.
since: 1.3.2
fu_firmware_write_chunk
Gets a block of data from the image. If the contents of the image is
smaller than the requested chunk size then the GBytes
will be smaller
than chunk_sz_max
. Use fu_bytes_pad()
if padding is required.
since: 1.6.0
fu_firmware_write_file
Writes a firmware, typically packing the images into a binary blob.
since: 1.3.3
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structure
struct FwupdPluginFirmwareClass {
GObjectClass parent_class;
gboolean (* parse) (
FuFirmware* self,
GBytes* fw,
gsize offset,
FwupdInstallFlags flags,
GError** error
);
GBytes* (* write) (
FuFirmware* self,
GError** error
);
void (* export) (
FuFirmware* self,
FuFirmwareExportFlags flags,
XbBuilderNode* bn
);
gboolean (* tokenize) (
FuFirmware* self,
GBytes* fw,
FwupdInstallFlags flags,
GError** error
);
gboolean (* build) (
FuFirmware* self,
XbNode* n,
GError** error
);
gchar* (* get_checksum) (
FuFirmware* self,
GChecksumType csum_kind,
GError** error
);
gboolean (* check_magic) (
FuFirmware* self,
GBytes* fw,
gsize offset,
GError** error
);
gboolean (* check_compatible) (
FuFirmware* self,
FuFirmware* other,
FwupdInstallFlags flags,
GError** error
);
}
Class members
parent_class: GObjectClass
- No description available.
parse: gboolean (* parse) ( FuFirmware* self, GBytes* fw, gsize offset, FwupdInstallFlags flags, GError** error )
- No description available.
write: GBytes* (* write) ( FuFirmware* self, GError** error )
- No description available.
export: void (* export) ( FuFirmware* self, FuFirmwareExportFlags flags, XbBuilderNode* bn )
- No description available.
tokenize: gboolean (* tokenize) ( FuFirmware* self, GBytes* fw, FwupdInstallFlags flags, GError** error )
- No description available.
build: gboolean (* build) ( FuFirmware* self, XbNode* n, GError** error )
- No description available.
get_checksum: gchar* (* get_checksum) ( FuFirmware* self, GChecksumType csum_kind, GError** error )
- No description available.
check_magic: gboolean (* check_magic) ( FuFirmware* self, GBytes* fw, gsize offset, GError** error )
- No description available.
check_compatible: gboolean (* check_compatible) ( FuFirmware* self, FuFirmware* other, FwupdInstallFlags flags, GError** error )
- No description available.
Virtual methods
FwupdPlugin.FirmwareClass.build
Builds a firmware from an XML manifest. The manifest would typically have the following form:
since: 1.5.0
FwupdPlugin.FirmwareClass.check_compatible
Check a new firmware is compatible with the existing firmware.
since: 1.8.4
FwupdPlugin.FirmwareClass.export
This allows us to build an XML object for the nested firmware.
since: 1.6.0
FwupdPlugin.FirmwareClass.tokenize
Tokenizes a firmware, typically breaking the firmware into records.
since: 1.3.2
FwupdPlugin.FirmwareClass.write
Writes a firmware, typically packing the images into a binary blob.
since: 1.3.1