Commit Graph

31 Commits

Author SHA1 Message Date
Vincent Huang
0a11350396 synaptics-prometheus: Force the minor version from 0x02 to 0x01 to make
sure the devices can be updated back to 0x01.
2020-05-19 15:12:10 +01:00
Richard Hughes
a8c6c02459 Do not conditionalize attach() and detach() on IS_BOOTLOADER
This is nice in theory, until you need to look at the bootloader status of the
parent, or of a different device entirely. Handle this in plugins for the few
cases we care about and stop setting or clearing IS_BOOTLOADER manually just to
get the vfuncs to be run.

Note: I do not think we want to use cleanup() for attaching devices not in
bootloader states -- as cleanup is only run at the end of the composite update.
2020-04-09 09:55:30 +01:00
Richard Hughes
f50ff2c27e Decouple the version format from the version itself
If we say that the version format should be the same for the `version_lowest`
and the `version_bootloader` then it does not always make sense to set it at
the same time.

Moving the `version_format` to a standalone first-class property also means it
can be typically be set in the custom device `_init()` function, which means we
don't need to worry about *changing* ther version format as set by the USB and
UDev superclass helpers.
2020-02-25 14:00:09 +00:00
Richard Hughes
0cc22a5ff6 trivial: Document the use of vendor-id in each plugin 2019-12-11 18:10:44 +00:00
Vincent Huang
3e3a0277c9 synaptics-prometheus: Allow incremental version major and minor number 2019-12-03 11:06:52 +00:00
Richard Hughes
1d797668fa synaptics-prometheus: Reload the device version after IOTA update 2019-11-29 12:04:42 +00:00
Richard Hughes
6d80b84b95 synaptics-prometheus: Reload the device version after update 2019-11-29 12:03:04 +00:00
Richard Hughes
3ed2ac8315 trivial: Unexport fu_test_get_filename()
We don't actually need either of the things it provides (looking up in source
and built, and converting to an absolute path) so just replace it with
g_build_filename() instead.

This also has the advantage that it does the right thing on Windows.
2019-11-27 12:45:35 +00:00
Mario Limonciello
6b0e66354b Convert libfwupdprivate to a shared library libfwupdplugin 2019-11-27 11:32:43 +00:00
Richard Hughes
ed3f6cfd4f synaptics-prometheus: Manually set the bootloader mode when attaching
The fingerprint reader device doesn't actually disconnect and reconnect and
so the FuDevice->setup() vfunc never gets called.
2019-11-26 14:15:11 +00:00
Richard Hughes
aba4a5a2bd trivial: Split out a new helper funtion
Other devices need to use this functionality too.
2019-11-26 14:15:11 +00:00
Richard Hughes
cb59a44f28 synaptics-prometheus: Mirror the _IS_BOOTLOADER from device to config 2019-11-25 18:10:38 -06:00
Richard Hughes
0df243ad44 synaptics-prometheus: Set the composite parent at construction time 2019-11-25 20:01:33 +00:00
Richard Hughes
56ac823af9 Set the protocol per-device not per-plugin
Some plugins have devices with more than one protocol. Logically the protocol
belongs to the device, not the plugin, and in the future we could use this to
further check firmware that's about to be deployed.

This is also not exported into libfwupd (yet?) as it's remains a debug-feature
only -- protocols are not actually required for devices to be added.
2019-11-25 18:01:54 +00:00
Mario Limonciello
6abe21efbd trivial: stop including fu-hash.h as part of fu-plugin-vfuncs.h
Explicitly include it in all "in-tree" plugins.

If headers are exported out of tree we will likely explicitly not
export this header.
2019-11-25 09:29:46 +00:00
Richard Hughes
480b386512 synaptics-prometheus: Don't add a config-subdevice in bootloader mode
We can't use the IOTA mechanism in bootloader mode, and failing to create the
FuSynapromDevice object means we can't recover the hardware if the flash failed.
2019-10-30 06:44:14 -05:00
Richard Hughes
95c98a95b6 Allow fwupdtool to dump details of common firmware formats
To do this, the plugins have to register the GType(s) they are using for
firmware, along with a short 'id' that can be used in CLI scripts.
2019-10-22 12:36:15 -05:00
Mario Limonciello
8fa0b382fa Add new flags can-verify and can-verify-image
These are used to indicate that the device can verify checksums or
can dump an image for checksumming.
2019-10-14 12:41:09 -05:00
Richard Hughes
8653e70480 trivial: Remove G_BEGIN_DECLS from all private headers 2019-10-09 20:02:16 +01:00
Richard Hughes
731875af86 Remove FU_PLUGIN_RULE_REQUIRES_QUIRK as all the plugins now use it 2019-10-09 20:02:16 +01:00
Richard Hughes
989acf12e7 Create the custom plugin GType in common code
This reduces the amount of boilerplate in plugins.
2019-10-07 12:37:21 +01:00
Richard Hughes
4b30380e78 Provide a default implementation of common FuDevice actions
This reduces the amount of boilerplate in each plugin.

    32 files changed, 156 insertions(+), 584 deletions(-)
2019-10-04 14:57:32 +01:00
Richard Hughes
d1afec8e27 synaptics-prometheus: Fix tiny memory leak when using FuSynapromConfig 2019-09-23 09:59:26 +01:00
Richard Hughes
37c6a7ba46 trivial: Add some helper functions for GByteArray 2019-08-15 09:50:37 +01:00
Richard Hughes
5308ea4fae Never use memcpy() in a possibly unsafe way
There are several subtle bugs in various places in fwupd caused by not treating
user-provided offsets into buffers as unsafe. As fwupd runs as root we have to
assume that all user firmware is evil, and also that devices cannot be trusted.

Make a helper to put all the logic into one place and convert all users.
2019-08-12 09:22:09 -05:00
Richard Hughes
7afd7cba0d Use FuFirmware as a container for firmware images
In many plugins we've wanted to use ->prepare_firmware() to parse the firmware
ahead of ->detach() and ->write_firmware() but this has the limitation that it
can only return a single blob of data.

For many devices, multiple binary blobs are required from one parsed image,
for instance providing signatures, config and data blobs that have to be pushed
to the device in different way.

This also means we parse the firmware *before* we ask the user to detach.

Break the internal FuDevice API to support these firmware types as they become
more popular.

This also allows us to move the Intel HEX and SREC parsing out of the dfu plugin
as they are used by a few plugins now, and resolving symbols between plugins
isn't exactly awesome.
2019-08-08 13:10:57 +01:00
Richard Hughes
67435426f4 synaptics-prometheus: Fix installing CONFIG firmware updates
Open the parent device to perform requests using the proxy virtual device.
2019-05-28 17:24:50 +01:00
Richard Hughes
39a270e1b3 synaptics-prometheus: Set the install duration from a quirk
Yes, it is quick. It's really the time to process one HUGE bulk request...
2019-05-28 17:24:50 +01:00
Richard Hughes
8a5df4dd32 synaptics-prometheus: Don't emit critial warning when updating config firmware 2019-05-28 17:24:50 +01:00
Richard Hughes
5575083677 synaptics-prometheus: Fix missing field in the IOTA reply struct 2019-05-28 17:24:50 +01:00
Richard Hughes
c7bdded2c6 Add a plugin to update Synaptics Prometheus fingerprint readers 2019-05-14 17:18:55 +01:00