Commit Graph

173 Commits

Author SHA1 Message Date
Richard Hughes
2883b577dc trivial: Fix a potential OOB write that can't actually happen 2022-04-13 15:08:12 +01:00
Richard Hughes
f4fb625fba Set the context automatically when setting the device proxy 2022-04-11 15:36:13 +01:00
Sergii Dmytruk
4795ab3122 trivial: libfwupd,libfwupdplugin: fix typos in several comments
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2022-04-11 15:31:03 +01:00
Richard Hughes
b3e1b74d21 trivial: Use the proxy physical ID automatically 2022-03-31 09:59:33 +01:00
Richard Hughes
8b62bf6b64 Set the context in the right place more often 2022-03-16 09:18:29 +00:00
Richard Hughes
6b5d933e99 Do not show unconnected or unreachable devices in the client tools
Fixes https://github.com/fwupd/fwupd/issues/4378
2022-03-15 14:08:17 +00:00
Richard Hughes
b4e88bae49 trivial: Move the UNREACHABLE inhibit to common code 2022-03-15 11:29:00 +00:00
Richard Hughes
66cb93c4e2 trivial: Make clear sizes are in hex 2022-03-07 12:38:33 +00:00
Richard Hughes
94d572375f trivial: Clarify the unit for the device remove delay 2022-03-03 11:26:17 +00:00
Richard Hughes
c4ca026294 Allow devices to build instance IDs more easily
Provide a device instance builder that allows plugins to easily
create multiple instance IDs based on parent attributes.

Also fix a lot of the instance ID orders, so that we add more generic
IDs first, and more specific IDs after.
2022-03-03 09:13:29 +00:00
Richard Hughes
adfef91731 trivial: Strip leading and trailing spaces from the vendor name 2022-02-24 17:07:44 +00:00
Richard Hughes
f3a13f89dd Allow specifing the DeviceIntegrity flag from metadata 2022-02-22 19:12:06 +00:00
Richard Hughes
758d5d8c6f Add a flag to indicate the device is signed or unsigned
Devices without either flag are unknown.
2022-02-22 19:12:06 +00:00
Richard Hughes
7ef94d7a31 vli: Skip probing the Dell DA300 device
Although 2109:2820 and 2109:0820 is the generic reference firmware,
firmware revision 3003 is specific to this device.

Fixes https://github.com/fwupd/fwupd/issues/4305
2022-02-22 17:22:13 +00:00
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