Commit Graph

4748 Commits

Author SHA1 Message Date
Richard Hughes
af53a4fc22 vli: Do not dedupe USB hub PD devices
This object derives from FuDevice rather than FuVliDevice and so does not
inherit the NO_GUID_MATCHING flag like other devices.

Fixes https://github.com/fwupd/fwupd/issues/2364
2020-09-09 16:27:16 +01:00
Mario Limonciello
110eb286bc Make TPM more optional (Fixes: #2360)
- Rename the `plugin_tpm` option to `tpm` and when it's disabled
remove TPM support from all plugins
- If enabled then require the TSS to be installed
2020-09-08 15:16:58 -05:00
Richard Hughes
d19aff3df1 mei: Do not attempt to parse HFSTS6 when using TXT
It seems the MEI parameters are not set for platforms such as Apollo Lake.
The only bit set was FPF_SOC_LOCK, with the others all cleared to zero.

Fixes https://github.com/fwupd/fwupd/issues/2335 for a peculiar definition of 'fix'.
2020-09-08 17:05:02 +01:00
Richard Hughes
45fbc50f8d mei: Document some more of HFSTS6 2020-09-08 17:05:02 +01:00
Richard Hughes
9b688d0b73 trivial: Set FWUPD_STATUS_DECOMPRESSING when preparing firmware
This avoids the plugins forgetting to do it themselves.
2020-09-08 14:18:46 +01:00
Richard Hughes
fbe3304420 trivial: Remove the anti-pattern where plugins check the firmware size
This is already done in fu_device_prepare_firmware() and so is completely
redundant.
2020-09-08 14:18:46 +01:00
Richard Hughes
581aa3c0be elantp: Support more hardware types
Read the pattern from the hardware rather than hardcoding and support bigger
page sizes for later hardware versions.
2020-09-07 20:46:52 +01:00
Jerry Zhang
ae7563d7d7 dfu: Allow device to attach to normal without a bus reset
As described in DFU protocol (7. Manifestation Phase), after the
firmware reprogramming is done, if bitWillDetach = 1, it doesn't
require the host to issue a USB bus reset, but the device can
generate a detach-attach sequence itself to go back to normal.

Add a quirk flag "no-bus-reset-attach" to skip the bus reset in
dfu_device_attach(), and increase the "RemoveDelay" as well.
2020-09-04 17:52:00 +01:00
Richard Hughes
2506dbff6f trivial: Use the same indent size when appending key values 2020-09-03 16:50:41 +01:00
Richard Hughes
9a07407401 Use the FuUdevDevice ->to_string() output
Print the sysfs path for devices deriving from FuUdevDevice, which also allows
us to use FU_UDEV_DEVICE_DEBUG without monkey-patching the plugins that also
define a device_class->to_string() vfunc.
2020-09-03 16:50:41 +01:00
Richard Hughes
ecb4d1416d trivial: Only use FU_UDEV_DEVICE_FLAG_VENDOR_FROM_PARENT as a fallback
If the device node actually provides a vendor string, always use that before
falling back. The flag was initially designed to fall back in the event the NVMe
device does not declare a valid sysfs vendor ID.
2020-09-03 16:50:41 +01:00
Richard Hughes
82f9a85201 Fall back from ID_VENDOR_FROM_DATABASE to ID_VENDOR for NVMe devices 2020-09-03 16:50:41 +01:00
Richard Hughes
7c8a830659 libfwupd: Add async versions of the library for GUI tools
Rather than force the GUI to interact with fwupd using threads, provide
async versions so thay can be run without blocking the UI thread.
2020-09-03 15:46:57 +01:00
Jerry Zhang
9f31bc22df dfu: Specify "RemoveDelay" for Poly USB Cameras in dfu.quirk
For some Poly USB Cameras, it takes a longer time than the
default (FU_DEVICE_REMOVE_DELAY_RE_ENUMERATE) for being detached
to DFU or attached to normal mode. Need to specify the timeout in
"RemoveDelay" quirk key.

Also replace the hard-coded timeout with fu_device_get_remove_delay()
in dfu-tool.c.
2020-09-02 12:01:46 -05:00
Richard Hughes
a018b3cbb4 Do not return HSI attributes when running in a VM or container 2020-09-01 21:00:55 +01:00
Richard Hughes
0b6f58394b Cancel the file monitor before disposal to avoid a potential deadlock
Fixes https://github.com/fwupd/fwupd/issues/2350
2020-09-01 20:59:56 +01:00
Jerry Zhang
409a2c958c dfu: Support polling the status from device in dfuManifest state
Some devices may accumulate the firmware image and perform the
entire reprogramming operation at one time. In this case, the
device enters dfuMANIFEST-SYNC or dfuMANIFEST state after
dfuDNLOAD-IDLE.

The fwupd shall be able to poll the status from the device via
DFU_GETSTATUS until the device completes the reprogramming or
reports an error.

For details, please refer to Section 7. Manifestation Phase and
A.1 Interface State Transition Diagram in the USB DFU protocol.
https://www.usb.org/sites/default/files/DFU_1.1.pdf

For not affecting the other DFU capable devices, introduce a quirk
"manifest-poll" to limit the logic.
2020-09-01 19:43:55 +01:00
Richard Hughes
7286951771 Use newer libxmlb features to properly display more AppStream markup 2020-09-01 16:11:50 +01:00
Richard Hughes
f0735f4583 trivial: Fix a logic thinko spotted by Coverity 2020-09-01 14:14:02 +01:00
Richard Hughes
241bdbb0f5 trivial: Fix some dead code as-seen by Coverity 2020-09-01 14:12:27 +01:00
Richard Hughes
ec2fbb054c trivial: Fix a copy paste mistake spotted by Coverity 2020-09-01 13:49:05 +01:00
Richard Hughes
840e84bcf2 elantp: Add a plugin to update Elan Touchpads using HID 2020-09-01 12:17:44 +01:00
Jan Tojnar
3e82beedda build: fix systemd_root_prefix for systemd 246
systemd 246 replaced the variable names (4908de44b0).
The old ones are kept for backwards compatibility but some of them interpolate new variable names so redefining them breaks.
Curiously, only systemdshutdowndir is affected by that here.
2020-08-30 13:39:48 +01:00
Jerry Zhang
783bc5c8a8 dfu: Support download of large DFU firmware
The nr_chunks is defined as an unsigned short, the max value is
65536. Assume the transfer_size reported by device is 4096, the
maximum size of DFU firmware supported is 65536 * 4096 = 256MB.

To support larger DFU firmware, we can change the guint16 to
guint32.
2020-08-29 09:32:03 +01:00
Benson Leung
c0fcd64b4a Bump libgusb-devel version to 0.3.5 for debian 2020-08-28 10:48:03 -07:00
Benson Leung
40efe471c4 Disable gusb:tests 2020-08-28 10:48:03 -07:00
Benson Leung
72aea1f8ed cros-ec: Save new firmware version on successful write 2020-08-28 10:48:03 -07:00
Benson Leung
a5487d4848 cros-ec: Do RO write as ANOTHER WRITE using custom flags
This implements the following simple state machine:
1. Reboot to RO, Update RW first, set ANOTHER_WRITE_REQUIRED
2. Second time around, don't reboot into RO. Stay in RW.
3. Update RO.
4. Done.
2020-08-28 10:48:03 -07:00
Benson Leung
24f0570e1b cros-ec: Set FWUPD_DEVICE_FLAG_DUAL_IMAGE 2020-08-28 10:48:03 -07:00
Benson Leung
7f3095d9ff cros-ec: Use iConfiguration to determine RO versus RW versions
This requires an API upgrade. libgusb 0.3.5 is required for iConfiguration.
2020-08-28 10:48:03 -07:00
Benson Leung
96bad357ad Require libgusb 0.3.5
Newer version of libgusb has g_usb_device_get_configuration_index which
will be used by cros-ec plugin.

Skip bumping this dependency on Debian and Ubuntu as of this commit date,
they don't know about 0.3.5 yet.
2020-08-28 10:48:03 -07:00
Benson Leung
9832b4138c cros-ec: Restart to RO on detach and to RW on attach
Add external command support and functions to reset to RO and RW.
This will now jump to the RO no matter what, and update the RW, then
jump to RW.
2020-08-28 10:48:03 -07:00
Benson Leung
879b8149c7 cros-ec: Set FWUPD_DEVICE_FLAG_UPDATABLE 2020-08-28 10:48:03 -07:00
Mario Limonciello
58eeeff9a8 trivial: only run scan-build if compiler is clang 2020-08-28 12:12:23 -05:00
Mario Limonciello
6f4b72cea5 trivial: disable gusb self tests for ubuntu 2020-08-28 11:51:23 -05:00
Richard Hughes
024b37fcee trivial: Fix segfault when xmlb cache cannot be written 2020-08-28 17:41:28 +01:00
Richard Hughes
019c096fcc trivial: Fix Fedora s390x build 2020-08-28 16:58:08 +01:00
Richard Hughes
439945c71c trivial: Do not require and obsolete dbxtool 2020-08-28 16:58:08 +01:00
Mario Limonciello
ac4444b528 trivial: debian ci: don't use packaging when subproject active
This prevents carrying hacks in the packaging specific to CI things
that will never actually land in Debian.

This will keep CI availability high while new packages are not yet
actually landed into Debian.
2020-08-28 10:56:20 -05:00
Mario Limonciello
c76775641b Revert "trivial: debian: don't fail CI for subprojects"
This reverts commit fc9cb560eb.
2020-08-28 10:56:20 -05:00
Mario Limonciello
5de5dd3582 Install the installed tests
Move binaries out of fwupd tree to https://github.com/fwupd/fwupd-test-firmware

Fixes some of https://github.com/fwupd/fwupd/issues/1956
2020-08-28 10:10:43 -05:00
Mario Limonciello
e89ce1a935 trivial: dell-dock: check for valid dock type on open
Only add instance ID if it actually probes properly.

Otherwise this makes an invalid assumption that the device is a WD19
EC just because it had the correct hub in front.

Instead check the first time it's opened that the correct device
is identified (`EXPECTED_DOCK_TYPE`)
2020-08-28 09:53:54 -05:00
Richard Hughes
f9902f1cdd Fix building GUsb as a subproject with introspection enabled 2020-08-27 18:18:33 +01:00
Richard Hughes
93ba041ce2 trivial: Use @self in FwupdClient to modernize the object 2020-08-27 08:03:16 +01:00
Richard Hughes
8819ee54f3 trivial: Update the CI to Fedora 32 and drop various workarounds 2020-08-26 16:42:46 +01:00
Mario Limonciello
fc9cb560eb trivial: debian: don't fail CI for subprojects 2020-08-26 10:14:41 -05:00
Richard Hughes
7818067c33 trivial: Construct the HSI auto-URL correctly 2020-08-26 09:38:35 +01:00
Richard Hughes
8307bd603e cpu: Directly probe the CPUID data to improve startup speed
This is much more efficient than parsing hundreds of lines of /proc/cpuinfo
and also causes hundreds of thousands less allocations at startup. For systems
with dozens of virtual CPUs the deduplication of device objects was increasing
start up time considerably.

Use the msr plugin to read the microcode version as this is not obtained using
CPUID, as it is instead being provided in an MSR.
2020-08-24 16:37:27 +01:00
Richard Hughes
f779a0cfaa msr: Use the new fu_common_cpuid() functionality 2020-08-24 16:37:27 +01:00
Richard Hughes
3a095cdadf cpu: Use the extended IDs where required 2020-08-24 16:37:27 +01:00