Commit Graph

1121 Commits

Author SHA1 Message Date
Richard Hughes
cd9c81c106 trivial: Add the closure user_data to the introspection 2023-02-21 08:15:47 +00:00
Richard Hughes
9be0c6dea6 Add a generic ACPI table parser 2023-02-18 20:08:34 +00:00
Richard Hughes
12cfdd2901 Do not run the FuProgress self tests by default
These add over 1000ms to the run time, and also do not work well when
virtualized via qemu.

Fixes https://github.com/fwupd/fwupd/issues/5547
2023-02-18 16:38:45 +00:00
Richard Hughes
a5dd40690b trivial: Add FuProgress to FuPlugin->backend_device_added()
Now we know fu_synaptics_mst_plugin_device_rescan() takes ~267ms...
2023-02-17 06:52:49 +00:00
Mario Limonciello
088359a381 trivial: read vbios_version on dGPUs
This allows getting a read only view of the VBIOS version advertised
by the dGPU driver.
2023-02-16 14:40:51 -06:00
Mario Limonciello
53faf281c1 trivial: read the class sysfs file if present 2023-02-16 14:40:51 -06:00
Mario Limonciello
9635851d4a trivial: add a new helper to read a sysfs attr as guint32 2023-02-16 14:40:51 -06:00
Richard Hughes
9ec39636e2 trivial: Fix -Wunused-variable with old GUsb versions 2023-02-15 20:14:12 +00:00
Richard Hughes
336494190d Allow installing some battery firmware updates when the power is too low
The firmware in this case fixes the battery charging, and as the battery is
*internal* the user isn't able to apply the fix.

Fixes https://github.com/fwupd/firmware-lenovo/issues/315
2023-02-15 16:08:53 +00:00
Richard Hughes
00c50afe21 trivial: Correctly fallback from SMBIOS to FDT 2023-02-14 13:52:04 +00:00
Richard Hughes
cc7c44312b Correctly fall back to the compatible vendor when FDT vendor is missing
Fixes https://github.com/fwupd/fwupd/issues/5530
2023-02-14 13:52:04 +00:00
Richard Hughes
fd5d84a8f5 trivial: Never add missing FDT values as a HwID 2023-02-14 13:52:04 +00:00
Richard Hughes
a7eae27519 Set the device percentage and status for the duration
Fixes part of https://github.com/fwupd/fwupd/issues/5522
2023-02-13 16:47:38 +00:00
Richard Hughes
06c95b22aa trivial: Fix warning: function has a definition with different parameter names 2023-02-13 12:34:46 +00:00
Richard Hughes
8290e4d1ef trivial: Fix warning: declared with a const-qualified typedef 2023-02-13 12:34:46 +00:00
Richard Hughes
5dbc91e769 trivial: Fix warning: repeated branch in conditional chain 2023-02-13 12:34:46 +00:00
Richard Hughes
2336f6a345 trivial: Fix warning: do not use 'else' after 'return' 2023-02-13 12:34:46 +00:00
Richard Hughes
e4ce1c4d19 trivial: Test for the correct thing in the tests 2023-02-13 12:34:46 +00:00
Richard Hughes
670e5b9750 trivial: Remove the unused deprecated header files 2023-02-13 12:34:46 +00:00
Richard Hughes
ac5f9412e0 Add support for emulating and recording devices
Based on patches from Frédéric Danis <frederic.danis@collabora.com>
2023-02-10 14:43:25 +00:00
Richard Hughes
2f6d3f71cc trivial: Use g_string_replace() from GLib when available 2023-02-10 13:11:25 +00:00
Richard Hughes
ae80ba6d16 Fix SMBIOS struct parsing when there are three NULs in a row
We need to be careful detecting the end of a string section when the struct
ends with NUL NUL NUL.

Fixes https://github.com/fwupd/fwupd/issues/5509
2023-02-10 13:11:25 +00:00
Richard Hughes
7c10fb0e12 Ensure composite devices all share the same acquiesce delay
We go to great pains to set the parent to the MAX of the child delays, but we
don't actually set the children to have the new parent value.

This means if you update the child device without the parent in the transaction
we don't always wait for all the USB devices to come back -- which is what the
acquiesce delay is designed to do.

Fixes an intermittant device test for the Wacom USB tablet.
2023-02-09 13:29:59 +00:00
Richard Hughes
fa72578666 trivial: Ignore device requests when emulated 2023-02-09 09:17:16 +00:00
Richard Hughes
4edf2c5079 Use the correct range check when parsing SMBIOS
The SMBIOS specification says:

    Maximum size of SMBIOS Structure Table, pointed to by the
    Structure Table Address, in bytes. The actual size is guaranteed
    to be less or equal to the maximum size.

So, the firmware is actually allowed to return a DMI blob smaller than the
specified size.

Fixes https://github.com/fwupd/fwupd/issues/5486
2023-02-04 12:55:22 +00:00
Valentin David
5ce5080844 Allow overriding lock directory with an environment variable 2023-02-01 20:44:56 -06:00
Richard Hughes
99df74f0c2 Add API to wait for a device
This allows us to ignore all the delays when the device is emulated, with the
idea being to do dozens of device emulations in the CI tests.

Also, do not call fu_progress_sleep() when the device is emulated.
2023-02-01 09:42:08 +00:00
Richard Hughes
654dd756b7 Do not invalidate the probe for emulated devices
If the device does not replug, and we change the GUsbDevice because the phase
changed we don't want reprobe the hardware.

If we reprobe then the emulated device will request extra data compared to the
real device, which will cause emulation to fail.
2023-01-31 16:58:31 +00:00
Richard Hughes
32d6c7f8dd Use indexes when building the quirk prepared queries
This can save 250us on each query (of which we do a *lot*), and reduces the
number of queries by about half if the user is using a libxmlb version that can
convert from `_BOUND_TEXT` to `_BOUND_INDEX_TEXT`.

The more devices detected, the bigger the difference, and without this patch
fixing libxmlb would break fwupd as we'e been searching with an index, but not
actually providing one.
2023-01-30 14:47:56 +00:00
Richard Hughes
6e34a90a12 trivial: Add FuProgress to fu_context_load_hwinfo()
TIL: fu_bios_settings_setup() takes over 50ms (10%!) at startup.
2023-01-30 14:47:44 +00:00
Richard Hughes
c1ffebae48 Remove unused API for setting backend tags
It turns out we do not want to know the current phase of the device, and we can
achieve the same thing tagging the GUsbDevice manually and clearing the events
at exactly the correct time.
2023-01-30 13:32:48 +00:00
Richard Hughes
047b093904 Copy some flags from the proxy to the logical device 2023-01-30 12:00:04 +00:00
Frédéric Danis
3dcf24cae0 Propagate device tag to parent device 2023-01-26 15:37:35 +01:00
Richard Hughes
83229af12a trivial: Correctly compress zip files in FuArchive 2023-01-26 14:36:57 +00:00
Richard Hughes
f3f951d3a7 trivial: Add fu_device_has_problem() to be consistent and hide details 2023-01-26 12:35:08 +00:00
Richard Hughes
110ef12cc7 Add a device problem for 'update-in-progress'
We already had this as an inhibit, but this was not translated client-side.

We also need to propagate the problem to the bootloader device if the device
replugs during firmware update.
2023-01-26 09:01:26 +00:00
Richard Hughes
575871f505 Add fu_device_remove_backend_tag() for future use 2023-01-24 14:54:23 +00:00
Richard Hughes
90e5a58736 Do not make any of the HWIDs setup failures fatal
It's perfectly okay to have no HWIDs defined.

Should help with https://github.com/fwupd/fwupd/issues/5402
2023-01-24 12:45:36 +00:00
Richard Hughes
296fe5fb46 trivial: Add a device flag specifying it is emulated 2023-01-24 09:51:04 +00:00
Richard Hughes
a6deceda32 Allow desktop software to inhibit the system to prevent all updates
On edge hardware a process may want to disable firmware updates as it might be
a bad time to allow an upgrade.
2023-01-23 13:14:23 +00:00
Richard Hughes
fd08eaefee trivial: Fix bitwise operators in last commit 2023-01-22 08:29:20 +00:00
Richard Hughes
5d6cb83d1c Add fu_context_remove_flag() for future use 2023-01-22 07:35:48 +00:00
Richard Hughes
c647d0d0f6 Parse the DT chassis-type when parsing the FDT 2023-01-18 18:20:35 +00:00
Richard Hughes
eb30233b35 Improve FDT parsing compatibility
Newer versions of dtc agressively pack the string table, using *any* matching
suffix rather than whole strings. This is specification compliant, but breaks
if you use the offset as a hash key as a [premature] optimization.

Just use the string table as a flat block of memory rather than pre-parsing it.

This fixes reading the system FDT on new OpenBMC builds.
2023-01-18 07:59:45 +00:00
Richard Hughes
2b0f92506b Refactor the hwids functionality
This refactors the code as it was getting very confusing; before FuSmbios was
reading both SMBIOS and the kernel-provided DT -- and various things were
injecting overrides in three different place. To properly support FDT remove
one layer of indirection.

This also lets us use the compatible strings to enable plugins specifying the
flag _REQUIRE_HWID -- which means we only load the plugin if it's got a chance
of working. e.g.

    [aspeed,ast2500]
2023-01-18 07:04:44 +00:00
Richard Hughes
72f5c1e01e trivial: Make the installed-tests redfish.conf secure to avoid a warning
Also, don't attempt to change the permissions if the correct one is already
set.
2023-01-17 19:29:39 +00:00
Richard Hughes
4057edb24b trivial: Add FU_PATH_KIND_SYSFSDIR_DMI for future use 2023-01-16 20:23:28 +00:00
Richard Hughes
0efc1bebce trivial: Add fu_context_get_hwids() for future use 2023-01-16 17:49:57 +00:00
Richard Hughes
2737b05cf8 trivial: Add fu_context_get_smbios() for future use 2023-01-16 17:49:57 +00:00
Richard Hughes
0e381a8666 trivial: Store the chassis kind in the context 2023-01-16 17:49:57 +00:00