Commit Graph

1207 Commits

Author SHA1 Message Date
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
Mario Limonciello
8e987c7737 trivial: synaptics-cxaudio: Add Google Pixel buds
I saw a mention that they're actually CX21986 and had some on hand.
They do enumerate:

```
├─Pixel USB-C earbuds:
│     Device ID:           672c087de09848d9e7ee32aa1dea2fbeb8b81e6b
│     Summary:             CX21986 USB audio device
│     Current version:     71.133.20
│     Bootloader Version:  03.01.00.00
│     Vendor:              Google (USB:0x18D1)
│     Install Duration:    3 seconds
│     Flags:               updatable|registered
│     GUIDs:               d76048a5-ca69-5cb8-ac86-d418d70c5f29
│                          98043a29-72c5-549b-ad23-de4e2db20a14
│                          93279fe8-d478-531b-9637-05d026be3c2e
│                          8b71f776-f6d0-549d-9547-42740b24bbbc
```
2019-10-15 15:16:26 -05:00
Richard Hughes
1db25c9f2c Allow a custom FuFirmwareImage->write() in superclassed objects 2019-10-15 08:10:11 -05:00
Richard Hughes
6b72cfa25a dfu: Remove two completely unused helpers 2019-10-15 13:04:09 +01:00
Richard Hughes
8cc41cfa6f dfu: Make DfuFirmware derive from FuFirmware 2019-10-14 15:24:08 -05:00
Richard Hughes
f7862c0085 dfu: Make DfuImage derive from FuFirmwareImage 2019-10-14 15:24:08 -05:00
Richard Hughes
4fec0302d2 dfu: Remove private headers that do not need to exist
These are a throwback to when we exported the DFU headers.
2019-10-14 15:24:08 -05:00
Mario Limonciello
8fa0b382fa Add new flags can-verify and can-verify-image
These are used to indicate that the device can verify checksums or
can dump an image for checksumming.
2019-10-14 12:41:09 -05:00
Mario Limonciello
36e9292973 trivial: test: add checksums for "stock" 1.2.2
This has been failing the test suite silently:
```
b585990a-003e-5270-89d5-3705a17f9a43	FAILED: failed to verify using test: no checksum for 1.2.2
```
2019-10-14 12:41:09 -05:00
Mario Limonciello
069449e427 trivial: uefi: don't add PCRs with all 0's
I was seeing on a CML laptop with a Nuvoton TPM the following which
is definitely wrong:
```
  Checksum:             SHA1(791183aa2c4993dfaf75e95c91bdad067ac2cce1)
  Checksum:             SHA256(8a0656fe0024cc3300cc4dc8af4fc336112a51013aeb74b21c138ed116bb8691)
  Checksum:             SHA1(000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
```
2019-10-14 08:58:14 -05:00
Richard Hughes
8feba21210 synaptics-cxaudio: Support the ThinkPad USB-C Dock Gen2 2019-10-14 11:28:04 +01:00
Mario Limonciello
f37af548da 8bitdo: use will-disappear flag for sf30/sn30 controllers (Fixes: #783)
These controllers reboot back into Nintendo Switch mode typically
and fwupd will not be able to probe them.
2019-10-12 14:07:34 -05:00
Mario Limonciello
b73d255b13 trivial: ebitdo: don't dump out firmware header unless plugin verbose 2019-10-12 14:07:34 -05:00
Mario Limonciello
cee97bc674 trivial: ebitdo: don't use local errors when writing firmware
Just prefix them instead.
2019-10-12 14:07:34 -05:00
Richard Hughes
efa2803eb4 wacom-emr: Fix a regression for EMR devices
Actually trying to instantiate the object leads to:

    Specified class size for type 'FuWacomEmrDevice' is smaller than the
    parent type's 'FuWacomDevice' class size.

Fixes https://github.com/fwupd/fwupd/issues/1456
2019-10-12 19:25:44 +01:00
Richard Hughes
c0695320c8 Add a generic DFU firmware object for plugins to use 2019-10-11 13:19:46 +01:00
Richard Hughes
13f1c2a4da dfu: Use FwupdInstallFlags rather than a DFU-specific version 2019-10-11 13:19:46 +01:00
Richard Hughes
0ae53d3782 dfu: Remove functionality for modifying DfuSe files
Better tools already exist.
2019-10-10 16:53:44 +01:00
Richard Hughes
58bed5200e dfu: Remove functionality you can do now with fwupdtool 2019-10-10 16:53:44 +01:00
Richard Hughes
5a5a824a8d dfu: Remove the merge command as it's unused and broken 2019-10-10 16:53:44 +01:00
Richard Hughes
341ab10808 trivial: Remove the fuzzing details for DfuPatch 2019-10-10 16:18:26 +01:00
Richard Hughes
940df2eade dfu: Remove DfuPatch as no vendor actually uses this
This was a new file format to help out an OEM, but they didn't actually use it.
If we do need it in the future, it would some back as a src/ helper, not in
plugins/dfu.
2019-10-10 16:07:38 +01:00
Richard Hughes
85c34215c7 dfu: Don't wrap provided VID-PID functions 2019-10-10 13:53:27 +01:00
Richard Hughes
23c89edeaa dfu: Use the standard FuDevice custom flags functionality 2019-10-10 13:53:27 +01:00
Richard Hughes
8583184489 dfu: Use klass_device->write_firmware() directly 2019-10-10 13:53:27 +01:00
Richard Hughes
13ffa3e13f dfu: Use the generic fu_plugin_usb_device_added() function 2019-10-10 13:53:27 +01:00
Richard Hughes
b6fbf80f95 dfu: Use daemon flags to ignore devices rather than a special flag 2019-10-10 13:53:27 +01:00
Richard Hughes
79e033907b dfu: Set the device state directly to avoid proxying signals 2019-10-10 13:53:27 +01:00
Richard Hughes
f9fb2a6366 dfu: Use the built-in detach() and attach() vfuncs 2019-10-10 13:53:27 +01:00
Richard Hughes
f0eb091173 Read firmware back from the device as a FuFirmware
Returning a GBytes is not good enough when the device may be returning multiple
partitions which have to be stored as FuFirmwareImage objects.
2019-10-10 11:57:48 +01:00
Richard Hughes
48dbaadd03 dfu: Remove a pointless function 2019-10-09 20:56:38 +01:00
Richard Hughes
7301d06f23 dfu: Remove support for the Metadata Store Proposal
This was never adopted, and firmware now indicates the license in the metainfo
file rather than the DFU file itself.
2019-10-09 20:56:38 +01:00
Richard Hughes
5d064d92e0 dfu: Remove XTEA support
We don't support any hardware that actually uses this proposed standard, and
nowadays there is much better public-key encryption people can easily use.
2019-10-09 20:56:38 +01:00
Richard Hughes
52ccaa305e dfu: Remove the SREC and IHEX parsing out of the DFU plugin
libdfu used to be a grab-bag of useful firmware functions, but now with the
addition of FuFirmware we have proper shared objects for plugins to use.
2019-10-09 20:56:38 +01:00
Richard Hughes
2378ff314f ebitdo: Use klass_device->write_firmware like other plugins 2019-10-09 20:02:16 +01:00
Richard Hughes
8653e70480 trivial: Remove G_BEGIN_DECLS from all private headers 2019-10-09 20:02:16 +01:00
Richard Hughes
731875af86 Remove FU_PLUGIN_RULE_REQUIRES_QUIRK as all the plugins now use it 2019-10-09 20:02:16 +01:00
Richard Hughes
d8a8d5e776 Set all FuUdevDevice plugins to use FU_QUIRKS_PLUGIN
This speeds up startup as we're only calling fu_plugin_udev_device_added() on
plugins that can actually handle the device.
2019-10-09 20:02:16 +01:00
Mario Limonciello
83f8108def thunderbolt: recognize new 'generation' sysfs attribute
Use this attribute to determine whether or not to try to read 'native'
from the Thunderbolt NVM image at probe time.

This attribute is new to kernel 5.5.
2019-10-09 10:25:37 -04:00
Richard Hughes
c15c7835be Rename and modernize the udev plugin
The new plugin is called `optionrom` as this is the only type of image that it
parses for verification only. FuUdevDevice is also the generic parent already.
2019-10-09 14:59:54 +01:00
Richard Hughes
8523ebebf2 synaptics-rmi: Also add the product ID as a GUID without the minor version
Firmware may be suitable for all products that match the 'major ID' and so we
should provide an extra GUID to use in this case.
2019-10-09 14:18:10 +01:00
Richard Hughes
83fe59629d synaptics-rmi: Correctly set the payload length rather than hardcoding it 2019-10-08 12:32:09 +01:00