Commit Graph

1248 Commits

Author SHA1 Message Date
Richard Hughes
d630b5ee66 superio: Never read from port offset zero
At this point, PM1 IOBAD0 is unset, and thus zero...
2019-11-08 17:51:43 +00:00
Richard Hughes
025fc77d7a superio: Fix regression when coldplugging superio devices
Fixes https://github.com/fwupd/fwupd/issues/1546
2019-11-08 17:51:43 +00:00
Mario Limonciello
9b944d8999 trivial: synapticmst: allow missing /proc/modules
If a kernel is compiled without loadable module support this shouldn't
stop synapticsmst plugin from loading, just we can't do an extra safety
check.
2019-11-08 09:52:02 -06:00
Mario Limonciello
5151aa5222 synapticsmst: filter invalid chip IDs
This device was showing up from a LG 38UC99-W USB-C monitor
```
VMM0000:
      Device ID:           d762543f8c20f636e6fff031a000078d3e10c600
      Summary:             Multi-Stream Transport Device
      Current version:     0.00.000
      Vendor:              Synaptics
      GUIDs:               42addef4-40f9-5e89-b925-d564e35ed368 ← MST-(null)-vmm0000-0
                           cf8c03c5-18bf-53c4-971f-4a08f88932b5 ← MST-(null)-0
                           e9427b6a-7389-5461-a592-1da5f8ec99fd ← MST-(null)
      Device Flags:        • Updatable
```
2019-11-08 09:45:39 -06:00
Richard Hughes
2414f24b8a trivial: Provide some defines for common image names 2019-11-08 09:30:09 -06:00
Richard Hughes
c5384e9173 Allow aborting early when using fu_archive_iterate() 2019-11-08 09:30:09 -06:00
Aleksander Morgado
0066195a2c modem-manager: increase re-enumeration delay to 20000ms
The default of 10000ms was a bit too close to the real time seen in
e.g. the DW5821e/eSIM.
2019-11-07 21:34:35 +00:00
Aleksander Morgado
def263e697 modem-manager: add counterpart GUID for the DW5821e/eSIM 2019-11-07 21:34:35 +00:00
Richard Hughes
1e98534e37 trivial: Fix the protocol ID for VLI usbhub devices 2019-11-07 09:37:34 +00:00
Mario Limonciello
330434550c trivial: wacom-raw: add more device IDs for Dell devices 2019-11-07 00:40:22 -06:00
Mario Limonciello
79ac523224 synaptics-rmi: correct an error cleaning up on probe
```
failed to close device: Bad file descriptor
```

fu-udev-device will open a locker automatically now.
However synaptics-rmi closes the file descriptor on it's own with `g_clear_object`.

So destroy the fd in synaptics-rmi.
2019-11-06 08:21:51 -06:00
Richard Hughes
6e55cff444 fastboot: Fix a regression when updating modem firmware
Set `IS_BOOTLOADER` unconditionally when in fastboot mode. This seems logically
what it is; a degraded mode that's able to update firmware without runtime
functionality.

Fixes https://github.com/fwupd/fwupd/issues/1532
2019-11-05 06:04:36 -06:00
Mario Limonciello
d8c8249d16 trivial: conflict with old unifying plugin 2019-11-04 13:35:36 -06:00
Mario Limonciello
5123d4333e Rename unifying plugin to logitech-hidpp (Fixes: #1329) 2019-11-04 13:35:36 -06:00
Richard Hughes
7cb0592f72 trivial: Fix a compile error with older versions of gudev
Just move the G_DEFINE_AUTOPTR_CLEANUP_FUNC to the internal header to avoid
forgetting to define this in each plugin.
2019-11-02 07:47:02 -05:00
Mario Limonciello
15e3137f81 trivial: wacom: add vid/pid for panels in Moffett 2019-11-01 14:23:15 -05:00
Mario Limonciello
6c5e7c1e92 unifying: notify users to replug when using dfu control (Fixes: #1383) 2019-11-01 14:31:03 +00:00
Mario Limonciello
2e06dcd5e3 trivial: 8bitdo: set a transient failure while waiting for user action 2019-11-01 14:31:03 +00:00
Mario Limonciello
8ecb08ec23 trivial: 8bitdo: show the same message for SN30pro and SN30pro+ 2019-11-01 14:31:03 +00:00
Richard Hughes
02792c0ba3 trivial: Fix up some typos from codespell 2019-11-01 14:21:20 +00:00
Richard Hughes
62e7112b4e trivial: Ensure config.h is included in all source files 2019-11-01 13:56:26 +00:00
Richard Hughes
f4998a7636 trivial: Fix up some NULL/FALSE confusion 2019-11-01 13:55:32 +00:00
Richard Hughes
bf00080d3f Move the file descriptor lifecycle into FuUdevDevice
This also means we can provide common 'safe' versions for plugins to use.
This makes a lot of plugins much simpler and we can delete a lot of code.
2019-10-31 09:21:35 -05:00
Richard Hughes
7f1b8e7dce ebitdo: Modernize the plugin to use FuFirmware
This allows us to do three things:

* Fuzz the loader with `fwupdtool firmware-parse`
* Check the firmware *before* the hardware is put into bootloader mode
* Use FuChunk to build the 32 byte payload chunks
2019-10-31 09:21:35 -05:00
Richard Hughes
2ff3cdca06 nitrokey: Use fu_common_dump_raw() when debugging 2019-10-31 09:21:35 -05:00
Mario Limonciello
7e38dffdcb thunderbolt: Create a unique GUID including Thunderbolt controller path
Systems with multiple host controllers will most likely have a different
NVM image for each controller but there is no guarantee that the device_id
within the NVM image varies from one controller to another.

To account for this, build a GUID that contains the last element of the
Thunderbolt controller's udev path.

Sample GUID strings from an XPS 9380 (which only contains one host controller):
```
  Guid:                 0f401ed2-b847-532a-adc8-3193fc737be6 <- TBT-00d408af-native
  Guid:                 420b0596-f5cb-5fd7-8416-c99d48ad8de9 <- TBT-00d408af-native-0000:05:00.0
```

This commit follows the presumption that the kernel will enumerate the controllers
in the same order every time.
2019-10-30 14:19:36 -05:00
Richard Hughes
6bbc4c787b jabra: Move the Jabra-specific detach out into its own plugin
This also lets us remove the call to dfu_device_wait_for_replug() which was
causing a deadlock due to unsafe main context usage. Splitting the code allows
us to use the device list to watch for replug, without adding even more Jabra-
specific plugin code to the DFU plugin.

Looking at this with a 40,000ft view, the Jabra runtime really doesn't have
much in common with DFU and the reason it was originally all lumped together
was that the daemon couldn't "change" plugins between detach and update.

It's unfortunate that we have to include a sleep() in the DFU code after the
DFU probe, but this is specified by Jabra themselves. Attempting to open the
device without waiting reboots the hub back into runtime firmware mode, so we
can't even retry the failing setup action.
2019-10-30 15:09:49 +00:00
Richard Hughes
f04be98153 vli-usbhub: Add support for updating V2 devices 2019-10-30 09:41:32 -05:00
Richard Hughes
51a869a01d Use XMLb to query quirks
During startup we do 1898 persistent allocations to load the quirk files, which
equates to ~90kb of RSS. Use libxmlb to create a mmap'able store we can query
with XPath queries at runtime.
2019-10-30 08:29:58 -05:00
Richard Hughes
480b386512 synaptics-prometheus: Don't add a config-subdevice in bootloader mode
We can't use the IOTA mechanism in bootloader mode, and failing to create the
FuSynapromDevice object means we can't recover the hardware if the flash failed.
2019-10-30 06:44:14 -05:00
Richard Hughes
b9f812750f dfu: Use the VID/PID to identify devices without download capability in runtime
The name is not always going to identify the device.
2019-10-30 10:32:15 +00:00
Mario Limonciello
d2701b12b2 ebitdo: Add SN30Pro+ to recognized quirk list (Fixes: #1503) 2019-10-28 11:31:32 +00:00
Richard Hughes
83e49ddf4a dfu: Add several quirks for Realtek camera hardware 2019-10-28 08:39:47 +00:00
Richard Hughes
d0b821f832 dfu: Always mark devices as UPDATABLE
Some devices don't set the CAN_DOWNLOAD attribute in their runtime descriptor.

Rather than quirk these devices just assume that all DFU devices with a DFU
interface can download in DFU mode. The logic being, why would they expose a
runtime DFU interface if they can't download new firmware in DFU mode...

Devices like the DW1820A that are currently blacklisted because of broken DFU
support will remain blocked with this change.
2019-10-28 08:39:47 +00:00
Mario Limonciello
e7b2ea02b9 uefi: use genpeimg to mark ASLR and DP/NX on EFI binary
If the tool is available at build time use it to this.
2019-10-26 12:59:11 -05:00
Mario Limonciello
7474976481 trivial: solokey: correct a typo 2019-10-25 09:20:41 -05:00
Mario Limonciello
44b9e46d37 uefi: rework ESP path detection and lifecycle
This makes the daemon less destructive at startup, especially if the ESP
is not mounted.

It's stored in 3 different places right now, so move it into one point of truth.

Now the ESP is detected when needed including all point of time safety checks and
dynamically mounted and unmounted if necessary.
2019-10-24 15:22:01 -05:00
Mario Limonciello
9160fd4dd1 trivial: uefi: show more metadata in to_string method 2019-10-24 15:22:01 -05:00
Richard Hughes
679d1c0f9a Add a plugin to update VIA USB hub hardware
Only protocol V1 hardware (VL810~VL813) is currently supported.
2019-10-24 12:52:18 +01:00
Richard Hughes
4b40590460 solokey: Allow parsing firmware with fwupdtool 2019-10-22 18:38:36 +01:00
Richard Hughes
95c98a95b6 Allow fwupdtool to dump details of common firmware formats
To do this, the plugins have to register the GType(s) they are using for
firmware, along with a short 'id' that can be used in CLI scripts.
2019-10-22 12:36:15 -05:00
Mario Limonciello
66dd3a02cb trivial: dell: work around a memory leak caught by address sanitizer
It appears to only happen on non-dell systems trying to look up system
ID through `sysinfo_get_dell_system_id`

Other than CI non-dell systems won't be running this code.
2019-10-18 22:07:49 -05:00
Mario Limonciello
cbbde24e38 ebitdo: if the device has the will disappear flag, don't wait for ack (Fixes: #994)
Some 8bitdo receivers seem to automatically reboot when done writing,
so just stop if we have that flag and notice this behavior.
2019-10-18 14:47:14 -05:00
Mario Limonciello
eb5d7a4659 Add a new plugin for working with eMMC devices (Fixes: #1455) 2019-10-18 14:18:09 -05:00
Mario Limonciello
3d65399626 trivial: coreboot: fix a clang compiler error
```
../plugins/coreboot/fu-plugin-coreboot.c:96:7: error: assigning to 'gchar *' (aka 'char *') from 'const gchar *' (aka 'const char *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]

        name = fu_plugin_coreboot_get_name_for_type (plugin, NULL);

             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../plugins/coreboot/fu-plugin-coreboot.c:98:8: error: assigning to 'gchar *' (aka 'char *') from 'const gchar *' (aka 'const char *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]

                name = fu_plugin_get_dmi_value (plugin, FU_HWIDS_KEY_PRODUCT_NAME);
```
2019-10-18 10:22:21 +01:00
Mario Limonciello
97c1e727c4 Add new device flags indicating update resilience
fwupd clients will ideally use this information as part of a policy to schedule
updates in the background without user interactions on safe devices.
2019-10-17 11:38:46 -05:00
Patrick Rudolph
0b7143da66 plugins: Add coreboot plugin
Detect and parse current coreboot version.
There's no need to depend on libflashrom for now.

An update mechanism isn't implemented as the kernel interface isn't
stable yet and will be implemented in a separate commit.

Tested on coreboot enabled machine.
Example output:
coreboot System Firmware
  DeviceId:             81104bde9db7cb037936659ea727c739f47a5029
  Guid:                 230c8b18-8d9b-53ec-838b-6cfc0383493a <- main-system-firmware
  Guid:                 de6fd40f-4ec9-5c0b-95e1-8fb13d1b030c <- LENOVO&ThinkPad T410&2537VG5
  Guid:                 978b0d18-bfe9-5279-9a9f-68dc247a705f <- LENOVO&ThinkPad T410&LENOVO&2537VG5
  Summary:              Open Source system boot firmware
  Plugin:               coreboot
  Flags:                internal|registered
  Vendor:               LENOVO
  Version:              4.10.991
  VersionFormat:        triplet
  Icon:                 computer
  Created:              2019-10-14

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2019-10-17 18:31:01 +02:00
Richard Hughes
9e4bf87184 dfu: Implement FuDevice->to_string() 2019-10-17 14:06:27 +01:00
Mario Limonciello
dc01c717ed trivial: colorhug: fix a crash that occurs when flashing sometimes
If calling `ch_strerror` with some values returns `NULL` which makes
the `GError` not get populated.

```
0  0x00007f252d64d3bd in fu_colorhug_device_attach (device=0x560d7b5c4520 [FuColorhugDevice], error=0x7ffc57a51040) at ../plugins/colorhug/fu-colorhug-device.c:200
1  0x0000560d7a398279 in fu_device_attach (self=0x560d7b5c4520 [FuColorhugDevice], error=0x7ffc57a51040) at ../src/fu-device.c:1988
2  0x0000560d7a3a4b6c in fu_plugin_device_attach (self=0x560d7b57e160 [FuPlugin], device=0x560d7b5c4520 [FuColorhugDevice], error=0x7ffc57a51040) at ../src/fu-plugin.c:856
3  0x0000560d7a3a553f in fu_plugin_runner_device_generic
   (self=0x560d7b57e160 [FuPlugin], device=0x560d7b5c4520 [FuColorhugDevice], symbol_name=0x560d7a3d4258 "fu_plugin_update_attach", device_func=0x560d7a3a4ac1 <fu_plugin_device_attach>, error=0x7ffc57a51040) at ../src/fu-plugin.c:1049
4  0x0000560d7a3a618d in fu_plugin_runner_update_attach (self=0x560d7b57e160 [FuPlugin], device=0x560d7b5c4520 [FuColorhugDevice], error=0x7ffc57a51040) at ../src/fu-plugin.c:1333
5  0x0000560d7a3bcc33 in fu_engine_update
    (self=0x560d7b4b9830 [FuEngine], device_id=0x560d7b64f200 "d45c9d222f7eeb3987c6a7674478bc6aec127b3f", blob_fw2=0x560d7b62c0d0, flags=FWUPD_INSTALL_FLAG_NONE, error=0x7ffc57a51150)
    at ../src/fu-engine.c:2001

(gdb) print error_local
$1 = (GError_autoptr) 0x0
```
2019-10-16 14:40:38 -05:00
Mario Limonciello
50202f5a89 thunderbolt: some more clarifications when using ICL
Currently ICL shows up like this:
```
├─Unknown Device:
│     Device ID:           d066959bf1b0da600f4fcaab5aa31cab3ff05eee
│     Summary:             Unmatched performance for high-speed I/O
│     Current version:     71.00
│     Update Error:        Missing non-active nvmem
│     Flags:               internal|require-ac|registered
│     GUID:                e72e778e-94f7-5ed2-b560-1c1262ee217c
```

Which isn't very useful to end users.  Instead show the generic name
`Thunderbolt Controller` which matches the behavior change we've made
in UEFI FW and Touchpad FW items too.

```
├─Thunderbolt Controller:
│     Device ID:           d066959bf1b0da600f4fcaab5aa31cab3ff05eee
│     Summary:             Unmatched performance for high-speed I/O
│     Current version:     71.00
│     Update Error:        Missing non-active nvmem
│     Flags:               internal|require-ac|registered
│     GUID:                e72e778e-94f7-5ed2-b560-1c1262ee217c
```

Also, quite the messages about missing vid/did as these won't exist
on ICL either.
2019-10-16 10:35:04 +02:00