Commit Graph

159 Commits

Author SHA1 Message Date
Richard Hughes
e21391f85d trivial: Don't warn if the superclass is using custom flags 2022-02-22 13:28:48 +00:00
Richard Hughes
4cd8468722 trivial: Don't warn if overwriting with the same device name 2022-02-22 13:28:48 +00:00
Richard Hughes
eb6ba4eafb trivial: Show the firmware GType in the device ->to_string() 2022-02-17 06:15:30 +00:00
Richard Hughes
f63080fbe2 Allow assigning issues to devices
This allows us to show in the tools if a device is currently affected
by a specific CVE. For instance, we could inform the user that a device
requires a critical firmware update that is being actively exploited.

Note, this also means we can show the user a firmware update is now
required, even though the firmware may not be available on the LVFS.

Also show the issue in the `fwupdmgr security` output, e.g.

    There are devices with issues:
      Samsung — MZVLB2T0HALB-000L7:
       • CVE-2022-12345
       • CVE-2022-54321
2022-02-16 14:50:29 +00:00
Richard Hughes
55bd4862d3 Try harder to convert to a version into a correct semver
This is really useful for the flashrom plugin.
2022-02-11 15:28:05 +00:00
Richard Hughes
2448660922 trivial: Print the RemoveDelay in the device debug string 2022-02-07 14:21:01 +00:00
Richard Hughes
24c041c3f8 trivial: Fix the range check for the RemoveDelay quirk 2022-02-07 14:21:01 +00:00
Richard Hughes
75b68ed9f9 trivial: Allow NULL @error for fu_device_retry_full()
The docs say `(nullable)` and it's the only function that seems to hard require
an error, for no good reason I can see.
2022-02-01 16:18:28 +00:00
Crag Wang
b728608baa Show results when calling get-details if failing requirements 2022-01-19 12:10:52 +00:00
Richard Hughes
e17a107ce1 trivial: Cast the g_signal_connect() object to allow static analysis
This is useful when using https://gitlab.freedesktop.org/tartan/tartan
2022-01-03 22:46:23 +00:00
Richard Hughes
2e99055d1e trivial: Add some more annotations for language bindings 2022-01-03 22:46:23 +00:00
Richard Hughes
c9a915a579 trivial: Print all the inhibits in the --verbose output 2021-12-29 19:18:26 +00:00
Richard Hughes
f76880182f Do not allow UEFI updates when the lid is closed
Most vendors do not mirror the firmware update to an external display,
and some don't behave correctly when the lid is shut and the machine is
docked. Add this quirk just for Lenovo for now.

Fixes https://github.com/fwupd/firmware-lenovo/issues/181
2021-12-29 19:18:26 +00:00
Richard Hughes
8e6a3f6bbb Allow devices to opt-in to metadata-provided vendor strings 2021-12-22 15:34:36 +00:00
Richard Hughes
b2048820aa Copy private flags from donor devices 2021-12-13 15:21:51 -06:00
Richard Hughes
179f250b9a trivial: Properly namespace _INTERNAL_FLAG_NO_AUTO_REMOVE 2021-12-10 17:25:54 +00:00
Richard Hughes
58d36dcbe5 Check the value range when parsing the quirk keys
At the moment there isn't an error if you enter something like

    CfiDeviceCmdReadId = 0×12
2021-12-09 13:09:43 +00:00
Kranthi Kuntala
de1f971e14 thunderbolt: set ports offline on host controller
This change offline ports in the host controller
for retimers to enumerate in the NDA case.

-offline and rescan usb4 ports
-this enable enumeration of the retimers
-updates nvm to the enumerated retimers
-online usb4 port this will de-enumerate retimers

BUG=b:187506425
TEST=emerge-volteer fwupd

Signed-off-by: Kranthi Kuntala <kranthi.kuntala@intel.corp-partner.google.com>
2021-12-07 15:54:30 +00:00
Richard Hughes
2958586d50 trivial: Add some debugging when a private flag does not match 2021-11-15 16:40:27 +00:00
Richard Hughes
60612294f5 trivial: Use the device GType as the debugging root
We never show the fu_device_to_string() output to the user in normal
circumstances, and it's super useful for it to match the FuFirmware
format.
2021-11-15 14:59:52 +00:00
Richard Hughes
ae278e1b80 Be case insensitive when fixing the device model 2021-11-09 16:09:16 +00:00
Richard Hughes
764df76d34 Allow overriding the firmware GType from a quirk file
This also allows us to remove quite a lot of boilerplate from plugins.
2021-11-08 15:53:41 +00:00
Richard Hughes
1507055849 trivial: Use GObject notify when modifying the proxy 2021-11-05 12:00:48 +00:00
Richard Hughes
15bf534e3f Set the verfmt of the returned device when the daemon device is unset
This regressed in 1.5.5 when we migrated FWUPD_DEVICE_FLAG_MD_SET_VERFMT
into FU_DEVICE_INTERNAL_FLAG_MD_SET_VERFMT and forgot to copy the system
device internal flags.
2021-10-18 06:57:09 +01:00
Richard Hughes
dbf92be359 trivial: Add fu_device_add_string() for future use 2021-10-14 15:49:58 +01:00
Gaël PORTAY
918006f8d5 trivial: Codespell fixes 2021-10-14 09:09:54 -05:00
Richard Hughes
c22c2e0752 trivial: Prevent a possible warning when using _FLAG_INHIBIT_CHILDREN 2021-10-07 17:42:39 +01:00
Richard Hughes
39d8baf516 trivial: Notify when the FuDevice:parent is set
This allows us to perform a callback when the parent instance is set or
changed.
2021-10-05 18:15:53 +01:00
Richard Hughes
1ff96eb4b3 Restore the ABI for fu_device_detach() and provide new symbols
Quite a few plugins are using a FuDeviceLocker to detach then attach in
the error path, and finding them isn't easy as we explicitly cast to a
FuDeviceLockerFunc.

For sanity, just provide both symbols so we can do the right thing in
both cases. It seems like a sensible thing to allow.

Fixes https://github.com/fwupd/fwupd/issues/3771
2021-09-17 16:35:21 +01:00
Richard Hughes
320f8d7d90 Update the child composite ID if the parent changes
Typically, this can be triggered with:

 * create parent
 * set parent physical ID
 * add new child to parent
 * set parent logical ID
2021-09-16 07:44:44 +01:00
Richard Hughes
40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00
Richard Hughes
b3824c94fa Fix a regression in flashing the Dell dock
This fixes a regression caused by 15b668c, we should have been more careful.

Fixes https://github.com/fwupd/fwupd/issues/3732
2021-09-10 15:50:52 +01:00
Richard Hughes
8b47bbeb09 trivial: Allow setting the FuDevice context in a constructor
This allows devices to add instance IDs in object_class->constructed,
e.g. FuWacModule.
2021-09-08 15:49:19 +01:00
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Richard Hughes
486f793df7 Recalculate the device inhibits when the flags property changes
Fixes https://github.com/fwupd/fwupd/issues/3622
2021-08-11 10:54:38 +01:00
Richard Hughes
f42b44e427 Remove some deprecated API 2021-08-06 19:49:53 +01:00
Richard Hughes
12842fdfce Fall back to the parent if the child does not have a battery level set 2021-08-04 09:29:02 +01:00
Richard Hughes
05c1f2b1f3 trivial: Fix docgen warning that crept in with FwupdRequest 2021-08-03 17:33:21 +01:00
Richard Hughes
8f19ea75d3 Sanitize the device name harder 2021-08-03 15:45:37 +01:00
Richard Hughes
3b919fc38d trivial: Actually use USE_PARENT_FOR_OPEN for close as the docs say
This fixes updating the Synaptics prometheus hardware.
2021-07-30 18:53:30 +01:00
Richard Hughes
d8f9b66e0e trivial: Actually use the right USE_PARENT_FOR_OPEN flag 2021-07-30 18:53:30 +01:00
Richard Hughes
0efa97229a Automatically clear the update error as required
This is less fragile than patching all the callers.
2021-07-23 13:16:47 +01:00
Richard Hughes
55f6fd435a Add a ->get_results() vfunc that can be used by subclasses of FuDevice 2021-07-22 12:47:54 +01:00
Richard Hughes
15b668c0c6 Open the device proxy in the engine where required
The benefit of using the proxy device is that we can 'use' the proxy
device for device access, but 'report' the progress on the passed
FuDevice instance.

This means the front-end reports the device status correctly when
updating composite devices that us proxies.

The comment always said we should move it to the daemon if another
plugin started doing this, and that is now.
2021-07-17 17:20:01 +01:00
Richard Hughes
a65f5759ef trivial: Fix a typo of fwupd itself 2021-07-15 09:33:25 +01:00
Richard Hughes
19abf996c7 Allow the daemon to request interactive action from the end user
The "return error and hope the client resubmits the firmware again"
pattern is clunky. There are two plugins doing this now, and about to
be one more.

This adds FwupdRequest which provides a structured way of asking the
user to perform an action, e.g. to replug the device or to press a
special key or button.

This replaces much of the UpdateMessage and UpdateImage API although
it is still used internally. Clients capable of processing the new
DeviceRequest signal should add REQUESTS to their feature flags.

Also, this allows us go back to the old meaning of _NEEDS_BOOTLOADER,
which was "needs rebooting into a bootloader mode" rather than the
slightly weird "user needs to do something and resubmit request".
2021-07-14 17:03:50 +01:00
Richard Hughes
b2ee236060 trivial: Show a critical warning if a device has no context 2021-07-12 19:01:55 +01:00
Richard Hughes
d938ab62e6 trivial: Add fu_device_add_guid_full() to control behaviour 2021-07-12 19:01:55 +01:00
Richard Hughes
53538685fc trivial: Add FU_DEVICE_INSTANCE_FLAG_NO_QUIRKS to avoid quirk matches 2021-07-12 19:01:55 +01:00
Richard Hughes
9c31d1fadd trivial: Set the FuContext on more devices 2021-07-12 19:01:55 +01:00