since: 1.6.0

Declaration [src]

fu_firmware_build_from_xml (
  FuFirmware* self,
  const gchar* xml,
  GError** error

Description [src]

Builds a firmware from an XML manifest. The manifest would typically have the following form:

<?xml version="1.0" encoding="UTF-8"?>
<firmware gtype="FuBcm57xxFirmware">
  <firmware gtype="FuBcm57xxStage1Image">
  <firmware gtype="FuBcm57xxStage2Image">
    <data/> <!-- empty! -->
  <firmware gtype="FuBcm57xxDictImage">
    <data>aGVsbG8gd29ybGQ=</data> <!-- base64 -->

This would be used in a build-system to merge images from generated files: fwupdtool firmware-build fw.builder.xml test.fw

Static binary content can be specified in the <firmware>/<data> section and is encoded as base64 text if not empty.

Additionally, extra nodes can be included under nested <firmware> objects which can be parsed by the subclassed objects. You should verify the subclassed object FuFirmware->build vfunc for the specific additional options supported.

Plugins should manually g_type_ensure() subclassed image objects if not constructed as part of the plugin fu_plugin_init() or fu_plugin_setup() functions.

Available since: 1.6.0



Type: const gchar*

XML text.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the method if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE for success.