Class
FwupdPluginFirmware
Description [src]
class FwupdPlugin.Firmware : GObject.Object
{
/* No available fields */
}
A firmware file which can have children which represent the images within.
See also: FuDfuFirmware
, FuIhexFirmware
, FuSrecFirmware
.
Descendants
- FuAcpiTable
- FuArchiveFirmware
- FuCabFirmware
- FuCabImage
- FuCfuOffer
- FuCfuPayload
- FuCoswidFirmware
- FuCsvEntry
- FuCsvFirmware
- FuDfuFirmware
- FuEdid
- FuEfiDevicePath
- FuEfiDevicePathList
- FuEfiFile
- FuEfiFilesystem
- FuEfiLoadOption
- FuEfiSection
- FuEfiSignature
- FuEfiSignatureList
- FuEfiVolume
- FuElfFirmware
- FuFdtFirmware
- FuFdtImage
- FuFmapFirmware
- FuHidDescriptor
- FuHidReport
- FuIfdFirmware
- FuIfdImage
- FuIfwiCpdFirmware
- FuIfwiFptFirmware
- FuIhexFirmware
- FuIntelThunderboltNvm
- FuLinearFirmware
- FuOpromFirmware
- FuPefileFirmware
- FuSbatlevelSection
- FuSmbios
- FuSrecFirmware
- FuUsbBosDescriptor
- FuUsbConfigDescriptor
- FuUsbDeviceDs20
- FuUsbEndpoint
- FuUsbInterface
- 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_image_full
Adds an image to the firmware. This method will fail if the number of images would be above the limit set by fu_firmware_set_images_max().
since: 1.9.3
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_gtype_bytes
Gets the firmware image bytes using the image GType
.
since: 1.9.3
fu_firmware_get_image_by_idx_bytes
Gets the firmware image bytes using the image index.
since: 1.3.1
fu_firmware_get_image_by_idx_stream
Gets the firmware image stream using the image index.
since: 2.0.0
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_bytes
Parses a firmware, typically breaking the firmware into images.
since: 2.0.1
fu_firmware_parse_file
Parses a firmware file, typically breaking the firmware into images.
since: 1.3.3
fu_firmware_parse_stream
Parses a firmware from a stream, typically breaking the firmware into images.
since: 2.0.0
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_set_size_max
Sets the maximum size of the image allowed during parsing.
Implementations should query fu_firmware_get_size_max()
during parsing when adding images to
ensure the limit is not exceeded.
since: 1.9.7
fu_firmware_tokenize
Tokenizes a firmware, typically breaking the firmware into records.
since: 2.0.0
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,
GInputStream* stream,
FwupdInstallFlags flags,
GError** error
);
GByteArray* (* write) (
FuFirmware* self,
GError** error
);
void (* export) (
FuFirmware* self,
FuFirmwareExportFlags flags,
XbBuilderNode* bn
);
gboolean (* tokenize) (
FuFirmware* self,
GInputStream* stream,
FwupdInstallFlags flags,
GError** error
);
gboolean (* build) (
FuFirmware* self,
XbNode* n,
GError** error
);
gchar* (* get_checksum) (
FuFirmware* self,
GChecksumType csum_kind,
GError** error
);
gboolean (* validate) (
FuFirmware* self,
GInputStream* stream,
gsize offset,
GError** error
);
gboolean (* check_compatible) (
FuFirmware* self,
FuFirmware* other,
FwupdInstallFlags flags,
GError** error
);
gchar* (* convert_version) (
FuFirmware* self,
guint64 version_raw
);
}
No description available.
Class members
parent_class: GObjectClass
No description available.
parse: gboolean (* parse) ( FuFirmware* self, GInputStream* stream, FwupdInstallFlags flags, GError** error )
No description available.
write: GByteArray* (* 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, GInputStream* stream, 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.
validate: gboolean (* validate) ( FuFirmware* self, GInputStream* stream, gsize offset, GError** error )
No description available.
check_compatible: gboolean (* check_compatible) ( FuFirmware* self, FuFirmware* other, FwupdInstallFlags flags, GError** error )
No description available.
convert_version: gchar* (* convert_version) ( FuFirmware* self, guint64 version_raw )
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: 2.0.0