This is a feature that seems useful, but one that no vendor has actually
asked for. It's also of limited use for peripheral devices.
Showing the instance IDs by default is also going to make it much easier
to explain to hardware vendors where the GUIDs come from.
Fixes https://github.com/fwupd/fwupd/issues/4445
Before we had FuInstallTask which represented the specific install
action (install foo on bar), FuEngineRequest which described why the
install task was created, and FuEngine. The latter being both reposible
for calling *into* FuInstallTask and also *from* FuInstallTask as well.
Depending on the code, we had XbNodes of component and release, *and*
FwupdReleases as releases and lots of duplicated code to marshall the
former into various forms of the latter.
Create a FuRelease wrapper around FwupdRelease to replace FuInstallTask
and to simplify the code. Make the FuRelease builder do the device
requirement checks, and then use the engine to do checks requiring
engine state and context.
This ensures that two different clients cannot update the same device,
as there's a window where we're waiting for the device to come back in
bootloader mode where we might accept a request from a different client.
As a side effect it also means we no longer store the UPDATABLE flag
in the history database -- which is fine as it's pretty useless anyway;
the device had to have been UPDATABLE to be updated in the first place.
If we connect up the device for property changes and then do an update,
we might send the pre-update GVariant data rather than the post-install
FuDevice.
This could mean that any client using the signal to update UI elements
might either flicker between the values, or show the 'wrong' device
version.
The Genesys Logic USB Hub does have support for public-key.
This adds the private flag has-public-key, and sets that flag for the HP
USB Hubs only. Also, this authenticates during setup only if that flag
is set.
The HP M2xfd monitors use GenesysLogic GL3523 USB Hub and provides their
own firmwares. Furthermore, HP uses the same VID/PID for other USB Hubs
products, with a different public-key; the HP M24fd and M27fd use
different public-key.
This appends the public-key to the instance-id string to make the
distinction between all the HP USB Hubs, and prevents to install a
firmware with the wrong public-key.
Genesys Logic uses the same VID/PID for its USB Hubs products, whatever
the chip underneath (GL3523, GL3590...). For example, Genesys Logic
USB2.0 Hub uses 05E3/0610; and Genesys Logic USB3.1 Hub uses 05E3/0612.
The manufacturers may reuse the Genesys Logic VID/PID for its products
or may use its own VID such as HP (03F0).
The genesys plugin supports upgrading GL3523 USB and GL3590 USB2.0 Hubs
for now (the latter is not tested).
The quirk file limits the support to HP Hubs only; and the plugin will
allow upgrade Hub with genuine Genesys Logic VID/PID in the future by
adding the following lines to the quirk file:
[USB\VID_05E3&PID_0610]
Plugin = genesys
However, this change in the quirk file will report the errors below for
the Hub with IC that are not supported:
04:26:40:0325 FuEngine failed to add device usb:01:00:01: Unsupported IC GL3521-22
04:26:40:0344 FuEngine failed to add device usb:01:00:01: Unsupported IC GL3521-22
Note: This may be true already if HP uses Hubs with IC that are not
unsupported.
This change returns the error FWUPD_ERROR_NOT_SUPPORTED instead to fail
silently.
This fixes the memory leak below:
$ sudo valgrind -v --leak-check=full fwupdtool get-devices
(...)
==3244345== 133 (64 direct, 69 indirect) bytes in 2 blocks are definitely lost in loss record 2,488 of 2,681
==3244345== at 0x4845899: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==3244345== by 0x4C04D59: g_malloc (in /usr/lib/libglib-2.0.so.0.7000.4)
==3244345== by 0x4C1C816: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.7000.4)
==3244345== by 0x4C1CE9E: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.7000.4)
==3244345== by 0x4B84684: g_type_create_instance (in /usr/lib/libgobject-2.0.so.0.7000.4)
==3244345== by 0x4B6BB65: ??? (in /usr/lib/libgobject-2.0.so.0.7000.4)
==3244345== by 0x4B6CAF4: g_object_new_with_properties (in /usr/lib/libgobject-2.0.so.0.7000.4)
==3244345== by 0x4B6D659: g_object_new (in /usr/lib/libgobject-2.0.so.0.7000.4)
==3244345== by 0x4AA8969: ??? (in /usr/lib/libgio-2.0.so.0.7000.4)
==3244345== by 0x153967: fu_engine_load_local_metadata_watches (fu-engine.c:7050)
==3244345== by 0x1540FC: fu_engine_load (fu-engine.c:7230)
==3244345== by 0x124D29: fu_util_start_engine (fu-tool.c:262)
(...)
==3244345== LEAK SUMMARY:
==3244345== definitely lost: 64 bytes in 2 blocks
==3244345== indirectly lost: 69 bytes in 2 blocks
==3244345== possibly lost: 1,936 bytes in 8 blocks
==3244345== still reachable: 234,668 bytes in 3,072 blocks
==3244345== suppressed: 0 bytes in 0 blocks
==3244345== Reachable blocks (those to which a pointer was found) are not shown.
==3244345== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==3244345==
==3244345== ERROR SUMMARY: 9 errors from 9 contexts (suppressed: 0 from 0)