Commit Graph

794 Commits

Author SHA1 Message Date
Richard Hughes
0cbcac93cd Rename fu_udev_device_ioctl_full() as we broke ABI 2022-06-03 13:47:11 -05:00
Richard Hughes
029d2895bd Rename fu_udev_device_pread_full() as we broke ABI 2022-06-03 13:47:11 -05:00
Richard Hughes
7e62e5b0c9 Add a FuProgress to ->verify() 2022-06-03 13:47:11 -05:00
Richard Hughes
106d45dede Make the API porting document more useful 2022-06-03 13:47:11 -05:00
Richard Hughes
a7642a7b7e Speed up daemon startup by 650ms
Reading properties from drm_dp_aux1 and drm_dp_aux2 took 700ms, and
we're never going to match any GUIDs as the vendor and model IDs are
both unset.
2022-06-01 15:50:13 +01:00
Richard Hughes
f14e4f8b8d trivial: Do not require an ID to finish a progress object
The function might have returned (possibly with an error set) before
fu_progress_set_id() was called.
2022-06-01 15:05:43 +01:00
Richard Hughes
5ef0ae182d Add a 'name' attribute to each FuProgress step
This allows us to print better warning strings, and in the future
would allow us to profile each operation in a meaningful way.

Also, add context to some of the progress steps as required.
2022-06-01 15:05:43 +01:00
Gaël PORTAY
41cbf8aa18 progress: Inherit status from parent 2022-05-27 11:19:51 -04:00
Richard Hughes
a78f660363 Emit a critical warning when duplicating private flags 2022-05-26 11:55:32 +01:00
Richard Hughes
6c93fe8b13 trivial: Fix a tiny leak when reading archives 2022-05-26 11:49:47 +01:00
Richard Hughes
67c77d7ec1 trivial: Fix a gtk-doc warning on build 2022-05-25 09:02:50 +01:00
Richard Hughes
2319f19306 Allow a plugin to only use the RemoveDelay when waiting for replug
Only opt-in plugins that have been tested -- unconditionally enabling
this may cause regressions on devices like docks.

Fixes https://github.com/fwupd/fwupd/issues/4378
2022-05-24 19:52:04 +01:00
Richard Hughes
4df0d2176b trivial: Fix docstring for fu_archive_write() 2022-05-22 11:28:25 +01:00
Gaël PORTAY
f862b8c9f3 trivial: Fix typos 2022-05-21 13:49:36 -04:00
Gaël PORTAY
f64783a75b trivial: Rename local that is not related to firmware 2022-05-21 13:49:36 -04:00
Gaël PORTAY
e6b01cbb18 archive: Add writing support 2022-05-21 08:21:55 -04:00
Richard Hughes
8ebad4ea75 Specify an enumerated problem when inhibiting devices
This allows us to make smarter policy decisions in the future on when
to show unavailable updates. It also means we can show translated
text in the frond-end clients.

Only problems the user can "fix" are enumerated. For example, opening
the laptop lid, or charging the device battery.
2022-05-19 13:09:03 -05:00
Gaël PORTAY
d7ffd821ff bluetooth: Set version if REV has been set 2022-05-18 02:23:59 -04:00
Richard Hughes
679628c091 Move the battery attributes down into libfwupd
This allows us to show the current value and the threshold on the CLI
and in tools like gnome-firmware.
2022-05-18 07:16:07 +01:00
Richard Hughes
f06061701c Allow setting the quirk ID from the quirk entry
Allow the admin to override the inhibit(s) on devices using a similar
format to the other kvs. For instance, setting two different quirks and
clearing another could be done using:

Quirk = usb-blocked:Device defective,needs-reboot:Reboot system,not-authorized:

This also allows unsetting the quirk, which was impossible before as
`@value` was always non-NULL.
2022-05-17 16:54:01 +01:00
Richard Hughes
c0a668ab18 Allow the device to pause the polling when writing firmware 2022-05-10 18:51:17 +01:00
Richard Hughes
d3d7cfa816 Add plugin quirk keys earlier in the startup process
This allows creating the silo when starting the engine with custom
plugin keys such as WacomI2cFlashBaseAddr.

If we move the plugin initialization earlier then we don't get the
HwID matches, so we really do have to split this into a 4-stage startup,
e.g. ->load(), ->init(), ->startup() and ->coldplug().
2022-05-09 11:13:52 +01:00
Richard Hughes
517dc88f4f trivial: Fix the win32 CI tests 2022-05-06 13:55:51 +01:00
Richard Hughes
5031ea2c6b trivial: Fix introspection warning when building docs 2022-05-06 08:38:01 +01:00
Richard Hughes
f6c6e98786 trivial: Include header needed for GetLastError() 2022-05-02 12:36:28 +01:00
Richard Hughes
2fcdf352df Retry the device ioctl for EAGAIN 2022-04-29 15:01:32 +01:00
Richard Hughes
beb49d7ac0 trivial: Add fu_common_read_uint24() helper for future code 2022-04-28 14:18:30 +01:00
Richard Hughes
855ece352d Check the alignment when reading in raw firmware 2022-04-28 14:15:49 +01:00
Richard Hughes
3553336eff trivial: Don't print a critical warning in fu_common_sum8_bytes()
If the size if zero, the buffer may be NULL.

Fixes: https://oss-fuzz.com/testcase-detail/5453386322935808
2022-04-28 07:24:00 +01:00
Richard Hughes
f3ec632492 trivial: Add some new helper API for future functionality 2022-04-26 14:30:28 +01:00
Richard Hughes
492563d5f2 trivial: Ignore the return value of g_strlcpy() when safe 2022-04-23 10:30:50 +01:00
Richard Hughes
a1517e4875 dfu: Use the correct icon automatically for USB webcams 2022-04-23 08:56:58 +01:00
Richard Hughes
519110b70e Support firmware with uSWID header version 2
This allows multiple coSWID objects to be saved into a uSWID firmware,
and adds support for Zlib compressed payloads.
2022-04-18 17:48:52 +01:00
Richard Hughes
2d5186622c Add FuProgress to ->prepare and ->cleanup
Some plugins were creating local versions (which were not attached to
the daemon progress in any way) as a workaround as they needed to do
actions that took a long time to complete.
2022-04-15 16:50:06 +01:00
Richard Hughes
a8497ad5c2 trivial: Allow invalidating backends when subsystems change 2022-04-15 16:49:48 +01:00
Richard Hughes
58fd419fb8 Do not clear the instance-id hash during ->setup()
Some plugins rely on adding more instance IDs after the device has been
added.
2022-04-15 06:49:51 +01:00
Richard Hughes
0b7af7d54b trivial: Ignore the return value of setenv() in most cases
This makes Coverity happy.
2022-04-13 15:08:12 +01:00
Richard Hughes
0d7d8b3240 trivial: Always call va_end() even in the error path 2022-04-13 15:08:12 +01:00
Richard Hughes
2883b577dc trivial: Fix a potential OOB write that can't actually happen 2022-04-13 15:08:12 +01:00
Mario Limonciello
65e3bc57c5 trivial: fix a logic error in obsolete calculation 2022-04-12 12:23:16 -05:00
Mario Limonciello
3006d238d6 Automatically obsolete negative duplicate attributes
To a user there is no point to explicitly showing two failures for
encrypted RAM if the system supports SME and TSME both.

To show them a single failure, de-duplicate the attributes by appstream
ID during depsolve.

If the plugin didn't explicitly set obsoletes and two attributes are both
failures and both share the same appstream ID obsolete one of them.
2022-04-12 11:59:49 -05: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
633571fa99 trivial: Fix some 'Comparison of narrow type with wide type in loop condition' 2022-04-05 14:45:42 +01:00
Richard Hughes
91e9f359c3 Add a plugin for the CH341A device 2022-04-03 16:29:30 +01:00
Mario Limonciello
55af9a8238 trivial: return an error string rather than HSI number for missing data 2022-04-03 09:06:00 -05:00
Richard Hughes
18f3b927e0 Add some default size values to the CFI device 2022-04-01 19:35:36 +01:00
Richard Hughes
f042bbd42c Add fu_common_reverse_uint8() for future functionality 2022-03-31 16:34:27 +01:00
Richard Hughes
356bd2fa5e Use the CFI manufacturer ID to set the vendor 2022-03-31 15:44:54 +01:00
Richard Hughes
ea9dd851af trivial: Add a missing possible CFI quirk key 2022-03-31 15:44:54 +01:00