Commit Graph

4635 Commits

Author SHA1 Message Date
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
Richard Hughes
8667c7e816 cpu: Use the proper vendor name rather than the signature 2020-08-24 16:37:27 +01:00
Richard Hughes
7c4a64b833 trivial: Ensure EAX is set to 0x0 when calling CPUID
This fixes getting the 'Extended Features' from the CPU.
2020-08-24 16:37:27 +01:00
Richard Hughes
bd1dc2a1e2 pcb-bcr: Use the correct BCR register for Bay Trail CPUs
Fixes https://github.com/fwupd/fwupd/issues/2328
2020-08-20 22:07:05 +01:00
Richard Hughes
5976125e25 trivial: Fix two translator comment typos 2020-08-20 07:54:00 +01:00
Mario Limonciello
82c3e3471d Remove support for UEFI dbx security attribute
This is no longer relevant as fwupd is providing dbxtool now.
2020-08-19 07:38:51 +01:00
Richard Hughes
58ba785915 Install the new dbx utility as fwupdbxtool 2020-08-18 17:34:26 +01:00
Richard Hughes
fd0ee5153e Add some of the HSI specification to the generated documentation 2020-08-17 20:23:49 +01:00
Richard Hughes
13b3343aaf vli: Add support for the Realtek RTD21XX I²C protocol 2020-08-17 20:23:09 +01:00
Richard Hughes
04afb39f76 Add X-Configuration to use for dbx updates
This would fall back to X-System.
2020-08-17 16:21:18 +01:00
Richard Hughes
1abb32c623 uefi-dbx: Validate the dbx update is safe to apply
To do this mount all ESP partitions and check all the binaries there to see if
they match any entries in the new dbx. If we applied the update when a hash
matched, we would unintentially 'brick' the users machine, as the grub and shim
binaries *have* to be updated first.

This functionality does reimplement the PE hashing functionality found in
sbsigntools and pesign. This was done for 4 main reasons:

 * There were some memory safety issues found when fuzzing random binaries
 * Executing the tools hundreds of times was a lot of overhead
 * Operating from a blob of immutable mmap'd memory is much faster
 * We only need a very small amount of functionality from both tools
2020-08-17 15:59:02 +01:00
Richard Hughes
adabe53e2b trivial: Fix some NULL/FALSE confusion when getting the HSI 2020-08-17 14:48:30 +01:00
Richard Hughes
bfe6c77549 trivial: Fix some NULL/FALSE confusion in the daemon 2020-08-17 14:48:23 +01:00
Richard Hughes
0e7102c4f8 uefi-dbx: Fix some NULL/FALSE confusion 2020-08-17 14:47:58 +01:00