fwupd/plugins/synaptics-prometheus/meson.build
Richard Hughes 41400a8cc6 Allow contructing a firmware with multiple images
At the moment there are commands to convert one file format to another, but not
to 'merge' or alter them. Some firmware files are containers which can store
multiple images, each with optional id, idx and addresses.

This would allow us to, for instance, create a DfuSe file with two different
raw files that are flashed to different addresses on the SPI flash. It would
also allow us to create very small complicated container formats for fuzzing.

This can be used by writing a `firmware.builder.xml` file like:

   <?xml version="1.0" encoding="UTF-8"?>
   <firmware gtype="FuBcm57xxFirmware">
     <version>1.2.3</version>
     <image>
       <version>4.5.6</version>
       <id>header</id>
       <idx>456</idx>
       <addr>0x456</addr>
       <filename>header.bin</filename>
     </image>
     <image>
       <version>7.8.9</version>
       <id>payload</id>
       <idx>789</idx>
       <addr>0x789</addr>
       <data>aGVsbG8=</data>
     </image>
   </firmware>

...and then using something like:

   # fwupdtool firmware-convert firmware.builder.xml firmware.dfu builder dfu
2020-09-21 18:11:13 +01:00

88 lines
1.8 KiB
Meson

cargs = ['-DG_LOG_DOMAIN="FuPluginSynapticsPrometheus"']
install_data(['synaptics-prometheus.quirk'],
install_dir: join_paths(datadir, 'fwupd', 'quirks.d')
)
shared_module('fu_plugin_synaptics_prometheus',
fu_hash,
sources : [
'fu-plugin-synaptics-prometheus.c',
'fu-synaprom-common.c',
'fu-synaprom-config.c',
'fu-synaprom-device.c',
'fu-synaprom-firmware.c',
],
include_directories : [
root_incdir,
fwupd_incdir,
fwupdplugin_incdir,
],
install : true,
install_dir: plugin_dir,
link_with : [
fwupd,
fwupdplugin,
],
c_args : cargs,
dependencies : [
plugin_deps,
],
)
if get_option('tests')
testdatadirs = environment()
testdatadirs.set('G_TEST_SRCDIR', meson.current_source_dir())
testdatadirs.set('G_TEST_BUILDDIR', meson.current_build_dir())
e = executable(
'synaptics-prometheus-self-test',
fu_hash,
sources : [
'fu-self-test.c',
'fu-synaprom-common.c',
'fu-synaprom-config.c',
'fu-synaprom-device.c',
'fu-synaprom-firmware.c',
],
include_directories : [
root_incdir,
fwupd_incdir,
fwupdplugin_incdir,
],
dependencies : [
plugin_deps,
],
link_with : [
fwupd,
fwupdplugin,
],
c_args : cargs,
install : true,
install_dir : installed_test_bindir,
)
test('synaptics-prometheus-self-test', e, env : testdatadirs) # added to installed-tests
# for fuzzing
executable(
'synaptics-prometheus-dump',
sources : [
'fu-dump.c',
'fu-synaprom-firmware.c',
],
include_directories : [
root_incdir,
fwupd_incdir,
fwupdplugin_incdir,
],
dependencies : [
gio,
libxmlb,
],
link_with : [
fwupd,
fwupdplugin,
],
c_args : cargs
)
endif