### Virtual Method

# FwupdPlugin Firmware build

#### Declaration [src]

    gboolean
    build (
      FuFirmware* self,
      XbNode* n,
      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">
      <version>1.2.3</version>
      <firmware gtype="FuBcm57xxStage1Image">
        <version>7.8.9</version>
        <id>stage1</id>
        <idx>0x01</idx>
        <filename>stage1.bin</filename>
      </firmware>
      <firmware gtype="FuBcm57xxStage2Image">
        <id>stage2</id>
        <data/> <!-- empty! -->
      </firmware>
      <firmware gtype="FuBcm57xxDictImage">
        <id>ape</id>
        <addr>0x7</addr>
        <data>aGVsbG8gd29ybGQ=</data> <!-- base64 -->
      </firmware>
    </firmware>

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.5.0

#### Parameters

`n` | `XbNode`
| A Xmlb node.
| The data is owned by the caller of the function.
`error` | `GError **`
| The return location for a `GError*`, or `NULL`.

#### Return value

Returns: | `gboolean`
| `TRUE` for success.