Commit Graph

1843 Commits

Author SHA1 Message Date
Richard Hughes
393b0a1677 vli: Fix the error enum values for the MSP430 2020-03-10 15:09:15 +00:00
Richard Hughes
c6c3d6c4c8 vli: Fix the version calculation for MSP430
Nobody from USI reviewed this, so it was wrong.
2020-03-10 15:07:17 +00:00
Richard Hughes
75b7d79424 vli: Fix compile warning introduced in 75cc9161c5 2020-03-10 12:16:09 +00:00
Richard Hughes
f4f4ebe0a2 vli: Ignore one more error when attaching 2020-03-10 12:11:19 +00:00
Richard Hughes
75cc9161c5 vli: Always expect the VL103 header at 0x1003 or 0x4000
I misunderstood the original specification, and it seems even USB-hub-less
devices have the same header location as their "write-through" counterparts.
2020-03-10 12:09:27 +00:00
Richard Hughes
640dbbb0f0 vli: Do not fall back to the recovery write for usbhubs
The checksum check was only being calculated on the size of the pointer, rather
than the size of the struct.
2020-03-10 12:07:28 +00:00
Richard Hughes
09e8e5e7ef vli: Only show the 2nd header if the device ID is valid
Otherwise we get a scary warning about the CRC not being valid, when the block
is just empty.
2020-03-10 12:06:12 +00:00
Richard Hughes
aebd90baad vli: Fix VL103 reboot from ROM mode to FW mode
The logic was wrong; we should have been using command 0xB0 for attach back to
FW mode for both VL10x and VL103. Using a generic reset on VL103 always reset
the device back into bootloader mode as the ROM signatures were being written
by command 0xC0.

As now attach and detach have different code paths, there's no point having a
`FuVliDevice->reset()` vfunc, and so we can make everything a little simpler at
the same time.
2020-03-10 10:46:01 +00:00
Richard Hughes
df2ae010d5 vli: Add some better comments for writing GPIOs 2020-03-10 10:42:52 +00:00
Richard Hughes
7fe2e48d7b trivial: Remove now-unused functionality in dfu-tool 2020-03-09 21:12:01 +00:00
Mario Limonciello
5972a49495 Add a new plugin for CPU microcode 2020-03-09 09:04:38 +00:00
Mario Limonciello
6a0f25f649 trivial: uefi: restore uefi.quirk
It was a casualty in 6f8a3da8f0
2020-03-06 12:10:15 +00:00
Richard Hughes
a32034b844 Drop UEFI quirks we now inherit from metadata
Fixes https://github.com/fwupd/fwupd/issues/1843
2020-03-06 12:10:15 +00:00
Mario Limonciello
b87d48a042 When TPM PCR0 measurements fail, query if secure boot is available and enabled
If the measurements are missing but it's a UEFI system, it's a good indication
that the user has secure boot turned off.
Notify the user on the UEFI device through a non-fatal `UpdateMessage`

To accomplish this, move fu-uefi-vars into the plugin library for other plugins to use
2020-03-05 07:54:15 -06:00
Mario Limonciello
be1a555737 trivial: uefi: set vendor ID on dummy device 2020-03-05 07:54:15 -06:00
Tilmann Meyer
9f137339e9 ata: Add OUI quirk for Western Digital and Intel 2020-03-04 19:29:36 +00:00
Richard Hughes
6dd54fa9c4 vli: Set the MSP430 version format to pair
Apparently the Windows tool ignores the first byte, so we should too.
2020-03-03 14:19:42 +00:00
Mario Limonciello
29e085f441 trivial: send users to a wiki page for TPM PCR0 construction errors 2020-03-02 11:53:18 -06:00
Richard Hughes
9e54fc595a ata: Add trivial OUI quirk for Micron 2020-03-02 13:58:38 +00:00
Richard Hughes
1beec89c57 nvme: Do not try to handle integer version numbers
We've never come across a drive that uses anything other than plain.
2020-02-27 13:26:00 +00:00
Richard Hughes
b097603800 Allow server metadata to set the version format on some devices
It appears just choosing 'if Dell then QUAD else TRIPLET' isn't good enough.
2020-02-26 15:45:40 +00:00
Richard Hughes
cfde249435 Inihbit all power management actions using logind when updating
Fixes https://github.com/fwupd/fwupd/issues/1814
2020-02-25 14:31:46 +00:00
Richard Hughes
f50ff2c27e Decouple the version format from the version itself
If we say that the version format should be the same for the `version_lowest`
and the `version_bootloader` then it does not always make sense to set it at
the same time.

Moving the `version_format` to a standalone first-class property also means it
can be typically be set in the custom device `_init()` function, which means we
don't need to worry about *changing* ther version format as set by the USB and
UDev superclass helpers.
2020-02-25 14:00:09 +00:00
Mario Limonciello
c1776c9ad4 Add raw versions for bootloader and lowest
The assumption is that same version format is used for all 3 of these
versions.
2020-02-25 12:20:51 +00:00
Mario Limonciello
1afe177696 trivial: add an OUI quirk for a seagate disk 2020-02-24 17:16:20 +00:00
Richard Hughes
f43381f4a7 Allow server metadata to set the device name on some devices
This does 'bleed' the metadata contents into areas previously covered by quirks,
but in this case may be pragmatic and more up to date than a build-time
generated quirk file, which increases the user-friendliness of fwupdmgr.
2020-02-24 14:15:34 +00:00
Richard Hughes
9113f3edd1 trivial: Add a OUI quirk for Intel 2020-02-21 12:07:47 +00:00
Richard Hughes
dac0bc5fb7 trivial: Ensure the OUI quirk required prompt starts on a new line 2020-02-21 12:06:32 +00:00
Richard Hughes
dbcc8e1137 ata: Include a vendor ID for ATA hardware
Some vendors want to ship updates for ATA hardware, but there are currently no
lock-down restrictions in place for these kind of devices.

There is the OUI from the WWN block which is supposed to identify the vendor,
but this is not always set and so we have to be a little creative. We can match
90% of hardware using the vendor name prefix, and the last 10% can be detected
with a heuristic that was the result of comparing over 900 drive models.

I'm not including very old drive models, media converters, raid controllers,
or external 'portable' drives as I don't think it is useful. Also, if the drive
contains a Dell vendor block just hardcode this as Dell rather than trying to
be clever.

Also ask the user to contribute OUI values if this data is found with no quirk
data as this is the only real sane way to manage this data long term.
The list of OUIs can be found here: http://standards-oui.ieee.org/oui.txt
2020-02-20 16:02:44 +00:00
Richard Hughes
52bbae8209 ata: Switch off the verbose logging by default 2020-02-20 16:02:44 +00:00
Richard Hughes
9a68084dbc Always check for PLAIN when doing vercmp() operations
In 1de7cc we checked the version format when checking for update, but there are
many other places that are doing verfmt-insensitive comparisons. For instance,
the predicates in <requires> all fail if the device version format is plain.
his breaks updating some NVMe drives where the `ne` requirements are not
semantic versions.

To avoid trying to catch all the bugs in different places, and in case we have
a future verfmt that should be treated another way, refactor this out in to a
common function and deprecate the old function.
2020-02-20 15:49:27 +00:00
Mario Limonciello
9ee0e63e53 trivial: add some better descriptions for man pages
Since more utilities are now in `bindir`, they should be more descriptive.
2020-02-20 09:34:10 -06:00
Mario Limonciello
b2dc3d481f Improve the description of fwupdtpmevlog for man page 2020-02-20 09:02:11 -06:00
Mario Limonciello
9fa7b38ac1 Move fwupdtpmevlog into bindir 2020-02-20 09:02:11 -06:00
Mario Limonciello
21e7faa78b uefi: Move fwupdate into bindir
Intended to be executed by users for debugging purposes, create a man
page as well.
2020-02-20 09:02:11 -06:00
Richard Hughes
334ba7994c trivial: Add helper fu_plugin_get_config_value_boolean() 2020-02-20 14:55:10 +00:00
Richard Hughes
6f8a3da8f0 Generate an additional UEFI quirk file using the stable LVFS metadata
The UEFI ESRT table just gives us a table of GUIDs with some basic flags, and
isn't very useful to end users. This is acceptable for Dell as there is only
typically one ESRT entry, which is for the system firmware. On typical Lenovo
hardware there might be half-a-dozen different 'Device' entries which all look
very similar.

As it's not possible to get a channel-of-data from the ODMs to fwupd, use the
existing LVFS metadata to generate some better names for these devices.
Although this looks like a lot of repeated data, libxmlb helpfully dedupes the
strings for us, making the quirk store only slightly larger.

Also, I've deliberately made this a manual step as we're not going to have
internet access on distro builders, and I'd also like the fwupd tarball output
to be deterministic and repeatable.
2020-02-14 17:14:24 +00:00
Bhaskar Upadhaya
73461ca1b7 uefi: Apply capsule update even with single valid capsule
Currently if there is an invalid boot entry for firmware update, the fwupd
EFI program will not call UpdateCapsule(), even if there is a valid entry.

For example, if the following entries exist the firmware update will fail:

HD(1,GPT,A672BBCA-325E-4D6F-91E1-DD57FAA85A9C)/\EFI\rhel\fw\fwupdate-6cialq.cap ... /*Valid entry*/
HD(1,GPT,E8176B29-6F73-43F2-AE8E-05E09DE20EE5)/\EFI\fedora\fw\fwupd-6dcbd5ed-e82d-4c44-bda1-7194199ad92a.cap ... /*InValid entry*/

Ensure capsule update is happening even if a valid capsule entry exists.

Signed-off-by: Bhaskar Upadhaya <bupadhaya@marvell.com>
2020-02-14 15:37:08 +00:00
Richard Hansen
a1edff9ab1 ebitdo: Fix the endpoint address logged in the error message
Addresses #1681.
2020-02-14 06:07:37 +00:00
Richard Hughes
52cda3db9c uefi: Find the correct lds and crt name when specifying -Defi_ldsdir
This fixes the Flatpak build of fwupd.
2020-02-13 17:56:33 +00:00
Mario Limonciello
7a3985f2de upower: Move battery threshold declaration into a configuration file 2020-02-13 09:52:20 -08:00
Mario Limonciello
e396f62d74 upower: Decrease minimum battery requirement to 10%
Dell's behavioral spec for this aligns the threshold for this at 10%
rather than 30%.
2020-02-13 09:52:20 -08:00
Richard Hughes
22edab6da8 altos: Output raw buffer data when using FWUPD_ALTOS_VERBOSE 2020-02-12 17:15:48 +00:00
Richard Hughes
1a76852d74 altos: Prefix an error to provide more context 2020-02-12 17:15:48 +00:00
Richard Hughes
f0eeceb9e9 altos: Add a trivial _to_string() implementation 2020-02-12 17:15:48 +00:00
Richard Hughes
48a9da5091 synaptics-cxaudio: Make the verfmt match that of the existing Windows tools
This is causing too much confusion, and we don't actually need to force to a
dotted decimal for any reason.
2020-02-12 17:15:40 +00:00
Richard Hughes
de5573c68b synaptics-mst: Allow MST to fall back if no PCI device is marked as parent
At the moment not having a udev parent was causing the dock device to not be
detected.
2020-02-12 17:15:28 +00:00
Richard Hughes
bc49d019cd synaptics-mst: Fix trivial thinko caused by the wrong dock connected 2020-02-12 09:48:07 +00:00
Richard Hughes
ea71dc7e73 vli: Invert the logic to reboot the parent FuCliUsbhubDevice, not the child 2020-02-12 08:51:24 +00:00
Richard Hughes
e20d6b3c33 vli: Switch around the hub tier values
I got given the wrong values...
2020-02-12 08:50:48 +00:00
Richard Hughes
d2fe61289b uefi: Fix a build regression with Fedora 30
Fixes https://github.com/fwupd/fwupd/issues/1754
2020-02-11 14:53:01 +00:00
Mario Limonciello
ddfc72db56 logitech_hidpp: Ignore detach failures (Fixes: #1183)
Some logitech devices seem to reboot immediately and the failures then
look like a broken pipe, but are actually the device rebooting.

If the device really did fail to detach after the timeout is done we'll
see a message that the device failed to come back instead.
2020-02-11 14:14:51 +00:00
Mario Limonciello
38d7074215 logitech_hidpp: When detaching to bootloader use non-blocking IO and wait for timeout
Should hopefully resolve issues that take a long time for devices to reboot.
Fixes: #1667
2020-02-11 14:14:51 +00:00
Richard Hughes
2b108e4ab1 vli: Show erase progress when doing a v2 recovery 2020-02-11 13:40:05 +00:00
Richard Hughes
60373e03fd uefi: Do not remove the 'Linux Firmware Updater' boot entry before update
Deleting boot entries from EFI sometimes triggers problems on some firmware.

We don't actually need to do it from the EFI binary, and it's perfectly safe to
leave it in the boot list. It also means when doing multiple updates over
several months we're not creating, deleting, creating, deleting and can just
re-use the same BootXXXX number each time.

It also makes the EFI binary simpler, which is good.
2020-02-11 13:36:08 +00:00
Richard Hughes
507f24a735 uefi: Do not rewrite BootOrder in the EFI helper
At the moment fwupd creates a BootXXXX for fwupd.efi and marks it BootNext.
It *also* adds it to the end of BootOrder to work around various old firmware
bugs like https://github.com/rhboot/fwupdate/issues/55 which we can perhaps
drop sometime thie century.

Remove the rewriting of BootOrder from the EFI binary; we've accidentally not
been doing it for a long time and nothing broke, and I'd like to make the EFI
binary as small and simple as possible. The user can remove the entry from the
BIOS or using efibootmgr if required, but it's harmless to just leave it.
2020-02-11 13:36:08 +00:00
Richard Hughes
00a0be068a vli: Add support for the PS186 device 2020-02-11 12:08:37 +00:00
Richard Hughes
af3b91d490 Set up more parent devices for various Lenovo USB hubs 2020-02-11 11:22:20 +00:00
Richard Hughes
1bd0617aac cxaudio: Set the update protocol to prevent a daemon warning 2020-02-11 11:18:44 +00:00
Richard Hughes
6c3db94f14 vli: Add support for Lenovo Modularized dock 2020-02-11 11:18:10 +00:00
Richard Hughes
e7e37ec223 vli: Remove the unused tierX custom flags for each device
We now know what this means on real hardware!
2020-02-10 14:58:38 -06:00
Mario Limonciello
d5bf8e45f2 Revert "Correctly delete UEFI variables"
This reverts commit 44f55e2ee6.

This behavior caused fwupdx64.efi to loop for a very long time until
either aborting, running out of memory or some other problems.
Fixes: #1756
Fixes: #1751
2020-02-10 12:39:26 -06:00
Mario Limonciello
bcd14de89f uefi: make debugging output more readable 2020-02-10 12:39:26 -06:00
Richard Hughes
ef168b289e vli: Fix a potential buffer-overflow when parsing firmware
Spotted by Coverity.
2020-02-07 15:16:39 +00:00
Richard Hughes
b27f0d42f9 tpm: Optimize the string parsing and fix the boolean logic
The g_ascii_isgraph() correctly handles NUL so just remove the check rather
than adding brackets around the logic.
2020-02-07 15:16:39 +00:00
Richard Hughes
04fde48e9a synaptics-rmi: Add a missing error enum value
This was spotted whilst fixing the last bug...
2020-02-07 15:16:39 +00:00
Richard Hughes
9baaacc099 synaptics-rmi: Correctly identify a checksum failure
The typo was spotted by Coverity.
2020-02-07 15:16:39 +00:00
Richard Hughes
2f85c24363 synaptics-rmi: Fix Coverity issue that is impossible to hit in reality
The guint16 was promoted to (signed) int for the multiplication, which meant
that the highest address possible was 0x7FFFFFFF not 0xFFFFFFFF. Which doesn't
really matter in reality, as all addresses are much smaller than that now.
2020-02-07 15:16:39 +00:00
Richard Hughes
072efbde88 trivial: Fix broken commit
I didn't actually mean to push this, but as I did, lets make it at least compile...
2020-02-07 12:04:03 +00:00
Richard Hughes
af7c098df2 solokeys: Parse old versions of the bootloader string 2020-02-07 11:49:01 +00:00
Richard Hughes
1910e84c72 Add a plugin to update PD controllers by Fresco Logic 2020-02-07 11:46:25 +00:00
Richard Hughes
e4661788ec vli: Set the device progress correctly when erasing a PD device 2020-02-06 20:38:19 +00:00
Richard Hughes
e17dd6f0cd vli: Use the correct command to get the device firmware version
Mea culpa; I misread the example code. It's a different command entirely.
2020-02-06 20:38:19 +00:00
Richard Hughes
6afe612c2f vli: Correctly reset all VL100 devices
The reset happens before the USB transfer completes.
2020-02-06 20:38:19 +00:00
Richard Hughes
4359ea9017 vli: Set all standalone PD devices to not do SPI auto-detection 2020-02-06 20:38:19 +00:00
Richard Hughes
9d22db26f9 vli: Mark standalone PD devices as updatable 2020-02-06 20:38:19 +00:00
Richard Hughes
003c150cc2 vli: Set the protocol for FuVliUsbhubPdDevice types 2020-02-05 17:23:51 +00:00
Richard Hughes
7d11d44242 Support the new gnuefi file locations
gnu-efi 3.0.11 moves a few files around, e.g.

    /usr/lib64/gnuefi/elf_x64_efi.lds -> /usr/lib64/gnuefi/x64/efi.lds

...and this causes the UEFI EFI helper to fail to link.

Add support for the 'new' paths and fall back to the old ones.

Fixes https://github.com/fwupd/fwupd/issues/1736
2020-02-05 07:41:35 -06:00
Mario Limonciello
8527405c8d Cleanup ancient fwupdate-* EFI variables too (Fixes: #1739)
It seems that fwupd.efi is picking up both fwupdate-* and fwupd-*
entries that are sitting around in efivarfs.
2020-02-04 11:36:58 -06:00
Mario Limonciello
9dce1f7011 Detect kernel lockdown status
Disable superio when kernel lockdown in effect.
2020-02-04 10:08:25 -06:00
Richard Hughes
e01c4cc8cb vli: Add the DEV instance ID to all devices
In some composite dock hardware there are two USB devices exported to the host,
both with the same VID:PID values. We need to use the device type (e.g. VL812B3)
to differenciate the devices and install the correct fw on the correct device.
2020-02-04 15:52:07 +00:00
Richard Hughes
59d947ac24 tpm-eventlog: Replay the TPM event log to get the PCRx values
In theory, these should always match the reported PCRx values from the TPM.

If the reconstructed event log checksum does not match the TPM value then
something is either implemented wrongly, or something bad has happened.
2020-02-04 11:54:27 +00:00
Richard Hughes
ca3e785c40 tpm-eventlog: Store the eventlog hashes in binary form
This means we use half the amount of memory to store the event hashes, and also
means we can process the raw data in future patches without parsing back out
of ASCII format.
2020-02-04 11:54:27 +00:00
Ivan Hu
44f55e2ee6 Correctly delete UEFI variables
UEFI runtime service GetVariable with DataSize NULL, will fail and get
EFI_INVALID_PARAMETER returned. Set DataSize 0 and allocate the buffer for
getting attributes for the deleted variable.

Also, fix the real reason Boot#### was never found.
2020-01-30 16:52:41 +00:00
Mario Limonciello
da2adf0e6f trivial: synaptics-mst: adjust last part of triplet to be 2 digits not 3
Synaptics versions are encoded as BCD, the largest version that will
ever be represented in this field is '99'.

Using 3 digits in this field has caused multiple problems in upgrades from
LVFS.

1. Devices are being upgraded when not necessary.
IE `5.3.10 > 5.3.010`

2. Device upgrades are deemed failures as follows:

```
BootTime=1571436076,
CompileVersion(com.redhat.efivar)=37,
CompileVersion(com.redhat.fwupdate)=12,
CompileVersion(org.freedesktop.fwupd)=1.3.2,
CompileVersion(org.freedesktop.gusb)=0.3.0,
CpuArchitecture=x86_64,
DistroId=fedora,
DistroVariant=workstation,
DistroVersion=32,
FirmwareId=1915,
Flags=4194346,
Guid=f15aa55c-9cd5-5942-85ae-a6bf8740b96c,
MachineId=97aa89528b88d9631867a4e20c68a5208124ef592e19d05f0c5e7d22bd4d7afb,
Plugin=synapticsmst,
RuntimeVersion(com.dell.libsmbios)=2.4,
RuntimeVersion(com.redhat.fwupdate)=12,
RuntimeVersion(org.freedesktop.appstream-glib)=0.7.14,
RuntimeVersion(org.freedesktop.fwupd)=1.3.2,
RuntimeVersion(org.kernel)=5.4.0-0.rc2.git2.1.fc32.x86_64,
UpdateError=device version not updated on success, 05.03.10 != 5.03.010,
UpdateState=failed,
VersionNew=05.03.10,
VersionOld=5.03.010

```
2020-01-22 15:22:11 -06:00
Richard Hughes
47862828e1 trivial: Allow setting an ID of NULL for the FuFirmwareImage
There's no reason to prevent NULL, and doing so means the caller has to check
before setting the value. Only one subclassed type was actually doing this...
2020-01-16 11:24:55 -06:00
Richard Hughes
b1fd77780f trivial: Fix a tiny memory leak introduced with the UPower fix 2020-01-16 15:29:08 +00:00
Richard Hughes
6b8c261225 Disable the battery percentage checks if UPower is unavailable
Based on a patch by Crag Wang <Crag.Wang@dell.com>, many thanks.
2020-01-15 15:54:00 +00:00
Richard Hughes
21eaeeff8d trivial: Fix up some typos found using codespell 2020-01-14 12:25:41 +00:00
Mario Limonciello
0dd8db545e trivial: tpm-eventlog: correct a typographical error 2020-01-09 10:42:08 -06:00
Mario Limonciello
bd266bd0cf trivial: add some missing protocol definitions 2020-01-08 15:49:38 -06:00
Mario Limonciello
7442b7ba77 synaptics-mst: Skip self tests for systems with amdgpu
No need to fail these self tests when using amdgpu, just skip them.
Fixes unrelated issue found in #1183

Signed-off-by: Richard Hughes <richard@hughsie.com>
2020-01-08 08:44:01 +00:00
Richard Hughes
af14073522 Allow applying all releases to get to a target version
Some hardware does not handle upgrading from version 1.2.2 to 1.2.4 and instead
needs to be upgraded from 1.2.2->1.2.3->1.2.4 so that on-device metadata can be
migrated correctly.

Add a new per-device flag `install-all-releases` which causes the daemon to not
skip directly to the newest release. This is designed to be set from a quirk
file.

This can obviously only be used for devices that can apply firmware "live" and
thus do not need a reboot or system shutdown to actually apply the firmware.
This also needs the cabinet archive to ship multiple versions of the firmware,
and for the metainfo.xml file to refer to multiple release objects.
2020-01-07 15:33:12 +00:00
Mario Limonciello
2d172534a8 logitech_hidpp: use the correct timeout for IO channel writes 2020-01-07 08:12:23 -06:00
Richard Hughes
63b9ac8844 Don't always get the vendor ID for udev devices using the parent
Fixes bugs like https://github.com/fwupd/fwupd/issues/1673
2020-01-06 14:48:58 +00:00
Richard Hughes
7f765005e2 Add a runtime warning when adding a device without an vendor-id or protocol set
Also, allow setting the protocol in the quirk file if required.
2020-01-06 14:48:32 +00:00
Richard Hughes
5bf8c1a23b vli: Set more of the firmware max sizes automatically
With data from VIA, many thanks.
2020-01-02 13:24:13 +00:00
Richard Hughes
727938427b vli: Add a SpiAutoDetect quirk for some of the PD devices
It seems command 0xc0 is not supported on this hardware.
2020-01-02 13:24:13 +00:00
Richard Hughes
fbffb16378 vli: Use a different protocol ID for i2c devices
These devices report a triplet version format, not a quad.
2020-01-02 13:24:13 +00:00
Richard Hughes
a24752d661 vli: Add support for standalone Single PD devices 2020-01-02 13:24:13 +00:00
Richard Hughes
52a7d0bd34 vli: Move generic SPI functionality into the FuVliDevice base class
To implement the SPI commands, objects can derive from FuVliDevice and
implement the new vfuncs. This allows us to override the implementation for
minor API changes.
2020-01-02 13:24:13 +00:00
Richard Hughes
c12163b374 vli: Remove the PD emulation code
I have actual hardware now...
2020-01-02 13:24:13 +00:00
Richard Hughes
714c4ce9d3 vli: Use a more standard GUID for the child i²c and shared SPI devices
We sometiems need to restrict the firwmare to the parent VID:PID too.
2020-01-02 13:24:13 +00:00
Richard Hughes
e2a9b15f16 vli: Allow setting the device kind from a quirk 2020-01-02 13:24:13 +00:00
Richard Hughes
050f998835 vli: Make more function names match the docs 2020-01-02 13:24:13 +00:00
Richard Hughes
3243374d41 vli: Move the SPI command quirking from FuVliUsbhubDevice down to FuVliDevice 2020-01-02 13:24:13 +00:00
Richard Hughes
8b5a560b1c vli: Rename FuVliUsbhubPdFirmware to FuVliPdFirmware
This is used by non-usbhub devices too, albeit at offset 0x0.
2020-01-02 13:24:13 +00:00
Richard Hughes
617bd7025f vli: Allow the device to specify the PD firmware header offset
We only want a non-0x0 offset for firmware with a prepended USB hub header.
2020-01-02 13:24:13 +00:00
Richard Hughes
b02d9988ad vli: Add a FuVliDevice as a subclass to FuVliUsbhubDevice
At the moment this doe not do anything clever, but other device types will
derive from the base class in the future.
2020-01-02 13:24:13 +00:00
Richard Hughes
62b84d4c5b vli: Define the device GType in the quirk file
This allows us to define different types of devices in the future.
2020-01-02 13:24:13 +00:00
Richard Hughes
15857f8056 vli: Move the CRC calculations out of usbhub scope 2020-01-02 13:24:13 +00:00
Richard Hughes
e968c0ec07 vli: Have one 'DeviceKind' for all objects
We'll soon have PD devices that are not children of the FuVliUsbhubDevice and
so it makes sense to flattern out the namespace. Also, less code.
2020-01-02 13:24:13 +00:00
Richard Hughes
f169186700 vli: Rename the vli_usbhub plugin to vli
In the future we'll be doing PD updates without any USB hub at all.
2020-01-02 13:24:13 +00:00
Michael Forney
9bdb96f768 plugins/coreboot: Add missing fu_hash dependency
This fixes the build when using samurai in place of ninja.
2019-12-18 08:33:10 +00:00
Mario Limonciello
171758180d trivial: synaptics-cxaudio: Add Google type C <-> 3.5mm adapter 2019-12-15 20:17:42 -06:00
Mario Limonciello
a21802acad trivial: dell-dock: drop unused quirk keyx 2019-12-12 13:59:41 -06:00
Mario Limonciello
fd6ffd6dac trivial: rename synapticsmst to synaptics-mst
This brings the naming nomenclature inline with the other plugins
2019-12-12 13:59:41 -06:00
Mario Limonciello
a906cef924 trivial: actually set vendor ID for synaptics
The `README.md` was updated, but this device wasn't actually setting
a vendor ID.
2019-12-12 13:59:41 -06:00
Mario Limonciello
fc326d9ad4 trivial: synaptics-rmi: hardcode Vendor string
Right now vendor string is detected by walking up the udev chain
until a vendor is found.  On some systems this is finding incorrect
data such as `Intel Corporation` for the vendor on the touchpad.

As the plugin only supports Synaptics devices, Correct it by hardcoding
vendor to `Synaptics`.

Sample output:
```
└─Touchpad:
      Device ID:           b26933c085b020ecf84c490812458523aee710ac
      Current version:     1.5.2767034
      Bootloader Version:  54.0
      Vendor:              Synaptics (HIDRAW:0x06CB)
      GUIDs:               f4384034-9243-5334-8075-a534be913e46 ← HIDRAW\VEN_06CB&DEV_76AF&REV_00
                           424bd00e-9789-5cdf-a12a-3c81bc4676d6 ← HIDRAW\VEN_06CB&DEV_76AF
                           140f4458-951b-5bb9-85e2-879bd5b02615 ← SYNAPTICS_RMI\TM3038-003
                           b29d3c85-cd0e-503e-9c7e-f6731c1eaf2d ← SYNAPTICS_RMI\TM3038
      Device Flags:        • Internal device
                           • Updatable
```
2019-12-12 09:57:47 -06:00
Mario Limonciello
e2db568490 trivial: Set vendor ID for Dell WD19 to USB:0x413C (Fixes: #1653)
View after this update:
```
├─WD19TB:
│ │   Device ID:           a455a3a21752e5d31c228f1f5b51761dad88a432
│ │   Summary:             High performance dock
│ │   Current version:     01.00.00.02
│ │   Minimum Version:     01.00.00.00
│ │   Vendor:              Dell Inc. (USB:0x413C)
│ │   Install Duration:    1 minute
│ │   Serial Number:       J4T6SV2/3169046018716226
│ │   GUID:                cd357cf1-40b2-5d87-b8df-bb2dd82774aa ← USB\VID_413C&PID_B06E&hub&embedded
│ │   Device Flags:        • Updatable
│ │                        • Requires AC power
│ │                        • Supported on remote server
│ │                        • Device stages updates
│ │                        • Device can recover flash failures
│ │                        • Device is usable for the duration of the update
│ │
│ ├─Thunderbolt controller in Dell dock:
│ │     Device ID:         8357922f7f208e1f3b7537141ce17db04bc219d9
│ │     Summary:           Thunderbolt controller
│ │     Current version:   43.00
│ │     Vendor:            Dell Inc. (TBT:0x00D4)
│ │     Install Duration:  22 seconds
│ │     GUID:              c94770ca-1773-592c-b20a-e87243bc7cd0 ← TBT-00d4b070
│ │     Device Flags:      • Updatable
│ │                        • Requires AC power
│ │                        • Supported on remote server
│ │                        • Device stages updates
│ │
│ ├─Package level of Dell dock:
│ │     Device ID:         1eca9eabb0c992c136e1deb1f89e3f70c465aa1c
│ │     Summary:           A representation of dock update status
│ │     Current version:   01.00.08.01
│ │     Vendor:            Dell Inc. (USB:0x413C)
│ │     Install Duration:  5 seconds
│ │     GUID:              8ceeeffd-51b6-580c-9b75-69143227aff8 ← USB\VID_413C&PID_B06E&hub&status
│ │     Device Flags:      • Updatable
│ │                        • Supported on remote server
│ │                        • Device can recover flash failures
│ │                        • Device is usable for the duration of the update
│ │
│ ├─RTS5413 in Dell dock:
│ │     Device ID:         ca36279eeac13463fd5d974c88794859294fbfb1
│ │     Summary:           USB 3.1 Generation 1 Hub
│ │     Current version:   01.21
│ │     Vendor:            Dell Inc. (USB:0x413C)
│ │     Install Duration:  14 seconds
│ │     GUIDs:             86fb40c0-8bf5-5a8b-a4ad-3156cf6bfaf4 ← USB\VID_413C&PID_B06F&REV_0101
│ │                        b27d25f1-019d-5718-b41a-02ddaefe5577 ← USB\VID_413C&PID_B06F
│ │                        ac5b774c-b49d-566b-9255-85f0f7f8a4ed ← USB\VID_413C&PID_B06F&hub
│ │     Device Flags:      • Updatable
│ │                        • Requires AC power
│ │                        • Supported on remote server
│ │                        • Device stages updates
│ │                        • Device is usable for the duration of the update
│ │
│ ├─RTS5487 in Dell dock:
│ │     Device ID:         acb404019656654d44f80922d94735e831d9bb40
│ │     Summary:           USB 3.1 Generation 2 Hub
│ │     Current version:   01.47
│ │     Vendor:            Dell Inc. (USB:0x413C)
│ │     Install Duration:  3 seconds
│ │     GUIDs:             707c63d2-e597-5c40-84db-9b1bb4c48d96 ← USB\VID_413C&PID_B06E&REV_0101
│ │                        acfcd89b-105d-55b9-b85b-08bf8508f38c ← USB\VID_413C&PID_B06E
│ │                        568ffa1e-a0db-5287-9ea3-872b60f7730b ← USB\VID_413C&PID_B06E&hub
│ │     Device Flags:      • Updatable
│ │                        • Requires AC power
│ │                        • Supported on remote server
│ │                        • Device stages updates
│ │                        • Device is usable for the duration of the update
│ │
│ └─VMM5331 in Dell dock:
│       Device ID:         58931e8c9ef5eead9c007563814f96fcadb1b993
│       Summary:           Multi Stream Transport controller
│       Current version:   05.04.00
│       Vendor:            Dell Inc. (USB:0x413C)
│       Install Duration:  6 minutes
│       GUID:              89fec0b6-6b76-5008-b82c-5e5c6c164007 ← MST-panamera-vmm5331-259
│       Device Flags:      • Updatable
│                          • Requires AC power
│                          • Supported on remote server
│                          • Device stages updates
│                          • Device is usable for the duration of the update
```
2019-12-12 09:44:20 -06:00
Richard Hughes
0cc22a5ff6 trivial: Document the use of vendor-id in each plugin 2019-12-11 18:10:44 +00:00
Richard Hughes
d3d64b5b54 superio: Use the baseboard vendor as the vendor ID 2019-12-11 18:10:44 +00:00
Richard Hughes
56700a3db8 uefi: Use the BIOS vendor as the vendor ID
This is only set for non-FMP ESRT entries.
2019-12-11 18:10:44 +00:00
Richard Hughes
89425b01bd coreboot: Use the BIOS vendor as the vendor ID 2019-12-11 18:10:44 +00:00
Richard Hughes
49eeca05d0 flashrom: Use the BIOS vendor as the vendor ID 2019-12-11 18:10:44 +00:00
Richard Hughes
3544ac03b3 dell: Hardcode a plausible vendor ID 2019-12-11 18:10:44 +00:00
Richard Hughes
d1b9bbd842 emmc: Set the correct vendor ID prefix 2019-12-11 18:10:44 +00:00
Richard Hughes
038d8f463e vli-usbhub: Fix the quirk for the legacy VIA 813 chip 2019-12-10 14:02:13 +00:00
Richard Hughes
f5c6e1d276 Add a new plugin that can parse the TPM event log
Some devices do not have a stable PCR0 for the same firmware version, and I'd
like to collect the TPM event log for affected machines to debug why.
2019-12-06 15:05:16 +00:00
Mario Limonciello
ad311189d4 trivial: dell: hardcode the physical device ID for tpm to match the tpm plugin
This allows the better-than logic to work properly.
2019-12-05 21:05:17 +00:00
Richard Hughes
fbb677bee2 Add a new plugin that exposes the system TPM device firmware version
This plugin does not yet allow the device to be upgraded, and is provided for
information only.
2019-12-05 21:05:17 +00:00
Richard Hughes
6c924a69c4 Add fu_udev_device_set_flags()
This allows us to specify with more detail how the device is opened.
2019-12-05 14:08:48 -06:00
Mario Limonciello
bda8bdf0e6 trivial: wacom-raw: mark all Moffett SKUs as self recovery
These will all support the recovery feature added by 59970600ad
2019-12-05 08:05:49 -06:00
Richard Hughes
f1a7122250 Add a dell-bios version format
Dell does not include the first byte in the ESRT value, ignoring it. Using a
`quad` means we get versions like `0.1.4.0` rather than `1.4.0` which confuses
both users comparing versions to the vendor website, and also anyone trying to
do analysis on the firmware.
2019-12-04 16:22:46 +00:00
Vincent Huang
3e3a0277c9 synaptics-prometheus: Allow incremental version major and minor number 2019-12-03 11:06:52 +00:00
Richard Hughes
10079e6b8c Export the raw device version to the client --verbose output
It turns out this is really useful for debugging UEFI firmware updates which
typically use the 0x-prefixed version numbers without a version format.
2019-12-02 06:51:25 +00:00
Richard Hughes
297d1598ef trivial: Only dlopen the test plugin once
This causes problems in the self tests when not lazy-loading symbols.

Also use g_build_filename() for the paths to be more portable and readable.
2019-12-01 20:59:19 +00:00
Francois Berder
bb5385de76 plugins: Fix potential use of NULL pointer in fu_dell_dock_mst_write_register
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-29 06:33:09 -06:00
Richard Hughes
1d797668fa synaptics-prometheus: Reload the device version after IOTA update 2019-11-29 12:04:42 +00:00
Richard Hughes
6d80b84b95 synaptics-prometheus: Reload the device version after update 2019-11-29 12:03:04 +00:00
Crag Wang
923120e55f trivial: wacom: remove coretronic config from Moffett scope 2019-11-28 06:37:53 -06:00
Richard Hughes
6aceaf9409 trivial: Fix a NULL/FALSE confusion 2019-11-27 16:36:17 +00:00
Richard Hughes
6e5fd3b3d8 trivial: Fix coreboot commit to fix CI 2019-11-27 14:40:49 +00:00
Patrick Rudolph
b21c3af2ea plugins/coreboot: Improve version detection
Only on Lenovo devices the DMI version string is prefixed with
CBETxxxx to make the thinkpad_acpi kernel module happy.

Add a new quirk called "CorebootVersionQuirks" to detect platforms
that need to cut of the prefix.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2019-11-27 14:26:26 +00:00
Patrick Rudolph
bd94740404 plugins/coreboot: Get rid of FU_HWIDS_KEY_BIOS_VENDOR in coldplug
In fu_plugin_startup we make sure that the FU_HWIDS_KEY_BIOS_VENDOR
matches "coreboot", so there's no need to read it again.

Remove the call to fu_plugin_get_dmi_value and drop the first call
to fu_device_set_vendor as it gets overwritten below.

Hardcode the id string for now.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2019-11-27 14:26:26 +00:00
Richard Hughes
3ed2ac8315 trivial: Unexport fu_test_get_filename()
We don't actually need either of the things it provides (looking up in source
and built, and converting to an absolute path) so just replace it with
g_build_filename() instead.

This also has the advantage that it does the right thing on Windows.
2019-11-27 12:45:35 +00:00
Richard Hughes
606fa91dae trivial: Unexport fu_test_compare_lines()
It's only used two places in the self tests.
2019-11-27 12:45:35 +00:00
Richard Hughes
aed7826c8f trivial: Properly namespace the defines in the exported header 2019-11-27 12:45:35 +00:00
Mario Limonciello
6b0e66354b Convert libfwupdprivate to a shared library libfwupdplugin 2019-11-27 11:32:43 +00:00
Richard Hughes
9e5675e1b4 trivial: Allow compiling without <glib-unix.h> 2019-11-26 17:15:45 +00:00
Richard Hughes
f0f504c740 trivial: Do not use FuProgressbar in dfu-tool
This is a debug-only command line program, and we don't want plugins to have
access to the animated progressbar header in the future.
2019-11-26 17:15:18 +00:00
Richard Hughes
ed3f6cfd4f synaptics-prometheus: Manually set the bootloader mode when attaching
The fingerprint reader device doesn't actually disconnect and reconnect and
so the FuDevice->setup() vfunc never gets called.
2019-11-26 14:15:11 +00:00
Richard Hughes
aba4a5a2bd trivial: Split out a new helper funtion
Other devices need to use this functionality too.
2019-11-26 14:15:11 +00:00
Richard Hughes
11d10a00e7 Always use the more portable 3-arg form for open() 2019-11-26 14:14:37 +00:00
Richard Hughes
5c508de173 trivial: Allow compiling without <fnmatch.h>
This also allows us to add a Win32 implementation if required in the future.
2019-11-26 13:13:31 +00:00
Richard Hughes
28e8b953d0 Revert "synaptics-rmi: Use the build ID as the version number to match the vendor tool"
This reverts commit 28ab968cbf as Synaptics
deviced that vmajor and vminor would actually be useful.
2019-11-26 08:25:45 +00:00
Richard Hughes
cb59a44f28 synaptics-prometheus: Mirror the _IS_BOOTLOADER from device to config 2019-11-25 18:10:38 -06:00
Richard Hughes
741e1e5323 vli_usbhub: Set the composite parent at construction time 2019-11-25 20:01:33 +00:00
Richard Hughes
0df243ad44 synaptics-prometheus: Set the composite parent at construction time 2019-11-25 20:01:33 +00:00
Richard Hughes
52e15b8fb3 vli-usbhub: Whitelist the PD and I²C devices
On advice from VIA.
2019-11-25 12:36:13 -06:00
Richard Hughes
56ac823af9 Set the protocol per-device not per-plugin
Some plugins have devices with more than one protocol. Logically the protocol
belongs to the device, not the plugin, and in the future we could use this to
further check firmware that's about to be deployed.

This is also not exported into libfwupd (yet?) as it's remains a debug-feature
only -- protocols are not actually required for devices to be added.
2019-11-25 18:01:54 +00:00
Richard Hughes
28ab968cbf synaptics-rmi: Use the build ID as the version number to match the vendor tool 2019-11-25 17:44:25 +00:00
Richard Hughes
1665837e78 Make gudev a compile-time option
This should make it nearly possible to build fwupd on FreeBSD.
2019-11-25 09:29:46 +00:00
Richard Hughes
afdba37644 trivial: Set the offline trigger using an environment variable
This allows us to build a object that does not have a custom FU_OFFLINE_DESTDIR.
2019-11-25 09:29:46 +00:00
Mario Limonciello
6abe21efbd trivial: stop including fu-hash.h as part of fu-plugin-vfuncs.h
Explicitly include it in all "in-tree" plugins.

If headers are exported out of tree we will likely explicitly not
export this header.
2019-11-25 09:29:46 +00:00
Leo
6640b571bf Fix shebangs on scripts 2019-11-24 18:51:56 -06:00
Richard Hughes
668ee21567 trivial: Use prefixes for DATADIR in config.h for portability
DATADIR is an enumerated type in MinGW, and the other names are very generic.
2019-11-24 14:17:38 -06:00
Mario Limonciello
89a9e245f9 trivial: optionrom: remove unneeded includes 2019-11-23 14:34:55 -06:00
Richard Hughes
633445dc10 trivial: Allow compiling without <errno.h> 2019-11-23 17:07:53 +00:00
Richard Hughes
8694dee4e7 trivial: Allow compiling without realpath() 2019-11-23 17:07:53 +00:00
Richard Hughes
01c0badd38 trivial: Allow compiling without getuid() 2019-11-23 17:07:53 +00:00
Mario Limonciello
0f54b54250 trivial: plugins: only build coreboot when option set
The option was set but wasn't being used.
2019-11-22 14:50:15 -06:00
Richard Hughes
18b0a739e2 dell: Use the more portable g_usleep() 2019-11-22 14:23:48 +00:00
Richard Hughes
7eeebae1c7 vli-usbhub: Make erasing less verbose and writing more obvious 2019-11-22 14:07:39 +00:00
Richard Hughes
ae21b15ec1 vli-usbhub: Correctly print the 24-bit USB3 offset 2019-11-22 14:07:39 +00:00
Richard Hughes
ad7c7e5fb3 vli-usbhub: Print the PD firmware offset and size for debugging 2019-11-22 14:07:39 +00:00
Richard Hughes
233868124e vli-usbhub: Open the parent device before attempting to read or write from the child 2019-11-22 14:07:39 +00:00
Richard Hughes
6496f12b37 vli-usbhub: Set the install duration for the PD device 2019-11-22 14:07:39 +00:00
Richard Hughes
24ce9837e9 trivial: Fix a failed error prefix string 2019-11-22 14:07:39 +00:00
Mario Limonciello
8bcaad800e trivial: wacom-raw: Remove embedded from device name
This is already implied by the internal flag.
2019-11-21 13:03:12 -06:00
Mario Limonciello
59970600ad wacom-raw: Correct HWID support
This support was using the wrong commands to add a HWID and thus
never actually functioned.  Furthermore it's purpose is to pull
the PID out of the bootloader to be able to properly identify
the device when in bootloader mode (as in recovery mode).

When in this state, generate the correct instance IDs for both
possible Wacom VID.  We can't tell which Wacom VID we are in
bootloader mode.
2019-11-21 13:03:12 -06:00
Richard Hughes
fdb4c4507b uefi: Just use a uint16_t for BootNext processing
This makes everything simpler, at the expense of not being able to create a
`BootFFFF` entry -- but if we get that far something has already gone very
wrong with the firmware...
2019-11-20 16:24:21 +00:00
Richard Hughes
5772e8451c uefi: Use a simpler entries set algorithm
Although slightly wasteful on memory, allocating 64kb is no big deal, and it
means we can simplify creation and reading a lot.
2019-11-20 16:24:21 +00:00
Richard Hughes
55b2df9df6 vli-usbhub: Add support for writing using I2C passthru 2019-11-20 11:07:23 +00:00
Richard Hughes
9f960c154a vli-usbhub: Support updating PD devices that share the hub flash 2019-11-20 11:07:23 +00:00
Richard Hughes
171f18c1c8 vli-usbhub: Support the PD file format 2019-11-20 11:07:23 +00:00
Mario Limonciello
66fcf55f9a trivial: uefi: correct a NULL pointer dereference
This could happen if the machine doesn't have `/etc/os-release`.
2019-11-18 16:22:01 -06:00
Mario Limonciello
e888b58ccd uefi: fall back to ID_LIKE when the path for ID doesn't exist (Fixes:# 1566)
Some derivative distributions re-use bootloader paths from their
upstream.  When this happens the current logic to look for the `ID`
key in `/etc/os-release` doesn't work properly.

Adjust the logic to:
1) Use `ID`
2) Test the path exists.  If so, use it.
3) If it doesn't use `ID_LIKE`.
4) Test if that path exists, if so use it.
5) If that path doesn't exist, return the key from `ID`
6) The plugin will make this path.
2019-11-18 14:55:04 -06:00
Jan Tojnar
34743c5fab uefi: Make generate_binary.sh more robust
command is a shell builtin unlike which, which might not be available.

While at it, let us also make the variables space-safe.
2019-11-18 18:43:40 +00:00
Richard Hughes
22c124dba4 trivial: Detect the USB version automatically
Unfortunately we can't remove the usb2 and usb3 custom flags as we don't yet
depend on a new enough GUsb version.
2019-11-15 18:59:44 +00:00
Mario Limonciello
e2b8a2797e Skip cleanup after device is done updating if will-disappear is set (Fixes: #1529)
This fixes a regression introduced by 2031ce3bf6
that leads to:
```
USB error on device 2dc8:5750 : No such device (it may have been disconnected) [-4]
```
2019-11-14 08:06:17 -06:00
YiFei Zhu
8b044c6cb3 efi: use a wildcard section copy for final EFI generation
The GNU gold linker uses the section name `.rela.dyn` instead of
`.rela` for containing the relocation information. If this section
is not copied the EFI executable can crash.

Fixes #1530
2019-11-14 09:46:50 +00:00
Aleksander Morgado
705f5b64e3 modem-manager: explicitly use plain version format
The devices managed by this plugin expose version strings that are to
be treated as plain ASCII and compared just as plain ASCII.
2019-11-13 17:41:22 +00:00
Aleksander Morgado
e66e0b7114 modem-manager: add quirks for the Foxconn T77W968 modules 2019-11-13 10:54:29 +00:00
Mario Limonciello
e8ec462e07 trivial: thunderbolt: clarify error message
In an error block that checks for `NULL` sysfs, you will always see
`(null)` in the string.

```
FuPluginThunderbolt  Unable to read generation: failed get id generation for (null)
```
2019-11-11 16:16:51 -06:00
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
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
Richard Hughes
9a5f076b6b synaptics-rmi: Write the core config correctly 2019-10-08 12:32:09 +01:00
Richard Hughes
d0fbc34704 synaptics-rmi: Decode BL7 status failures as actual errors 2019-10-08 12:32:09 +01:00
Richard Hughes
5b03566465 synaptics-rmi: Add some trivial debugging to help debug a write problem 2019-10-08 12:32:09 +01:00
Mario Limonciello
e42b42bf9b trivial: uefi: Make efivarvs errors clearer (Fixes: 1330) 2019-10-07 07:23:54 -05:00
Mario Limonciello
01c2f651da trivial: uefi: don't prefix efivar errors
Although they can be useful for debugging the codepath leading to
a problem, they are also confusing when it comes to the end user
messages:

```
{error #0} linux.c:406 device_get(): readlink of /sys/block/nvme0n1/device/driver failed: No such file or directory
{error #1} linux.c:406 device_get(): readlink of /sys/block/nvme0n1/device/driver failed: No such file or directory
{error #2} linux.c:406 device_get(): readlink of /sys/block/nvme0n1/device/driver failed: No such file or directory
{error #3} linux.c:406 device_get(): readlink of /sys/block/nvme0n1/device/driver failed: No such file or directory:
Error writing to file descriptor: No space left on device
```

Whereas if they weren't shown, that last message would have been plenty.
2019-10-07 07:23:54 -05:00
Richard Hughes
5c68f8c81f altos: Modernize the plugin to simplify it 2019-10-07 12:37:21 +01:00
Richard Hughes
989acf12e7 Create the custom plugin GType in common code
This reduces the amount of boilerplate in plugins.
2019-10-07 12:37:21 +01:00
Richard Hughes
7f67721432 Reduce more boilerplate in plugins 2019-10-07 12:37:21 +01:00
Richard Hughes
d6fc172ec9 synaptics-rmi: Check the correct register when querying bootloader mode 2019-10-07 11:50:49 +01:00
Richard Hughes
9cb3c84712 modem-manager: Fix a tiny memory leak when starting the daemon 2019-10-05 13:03:02 +01:00
Richard Hughes
2524c3fd79 synaptics-rmi: Copy the behavior of rmi4utils for BL7 detach 2019-10-05 09:07:22 +01:00
Richard Hughes
1c53c0eb86 synaptics-rmi: Simplify fu_synaptics_rmi_device_read()
We don't need a double loop here as we only ever require one READ_ADDR request.
2019-10-05 09:07:22 +01:00
Richard Hughes
08ddb2b7c4 synaptics-rmi: Set the version after ->setup has run
The build_id might be overwritten in the BL-specific setup.
2019-10-05 09:07:22 +01:00
Richard Hughes
339f823ee2 synaptics-rmi: Use the correct mask when getting the bootloader mode on BL7 2019-10-05 09:07:22 +01:00
Richard Hughes
3b8a2ea47f syanptics-rmi: The build_id is 3 bytes long, not 2 2019-10-04 17:08:21 +01:00
Richard Hughes
007140bd78 synaptics-rmi: Read the config partition the same as rmi4utils 2019-10-04 15:47:16 +01:00
Richard Hughes
4b30380e78 Provide a default implementation of common FuDevice actions
This reduces the amount of boilerplate in each plugin.

    32 files changed, 156 insertions(+), 584 deletions(-)
2019-10-04 14:57:32 +01:00
Christian Kellner
7e5c7b269a thunderbolt-power: avoid checking for bolt support
Avoid checking if bolt supports force-power in coldplug (early on)
because that will dbus-activate boltd, even on systems where there
is no actual thunderbolt hardware and thus also no force-power
support. Since boltd does use the very same kernel mechanism that
fwupd would use when boltd is not around this can not lead to any
regressions.
2019-10-04 08:16:28 -05:00
Richard Hughes
0e17281997 synaptics-rmi: Add some debugging for BL7 devices 2019-10-04 10:59:08 +01:00
Yehezkel Bernat
bddfde9615 Fix usage of incorrect type for return value
This seems like a bug, as `FALSE` == `0` == `VALIDATION_PASSED`
2019-10-03 10:41:48 -05:00
Richard Hughes
c6cda8bc71 synaptics-rmi: Do as little as possible in device setup
This reduces the setup time by another 70ms and also makes the plugin simpler.
2019-10-03 15:14:10 +01:00
Richard Hughes
b8e97e56c3 synaptics-rmi: Speed up reading the PDT from 900ms to 30ms
Don't continue to scan pages after the last function.
2019-10-03 15:14:10 +01:00
Richard Hughes
eeb6c22c1e synaptics-rmi: Ignore the ATTN reports from the hardware when reading DATA
Fixes https://github.com/fwupd/fwupd/issues/1427
2019-10-03 13:10:58 +01:00
Richard Hughes
9f7a3364ae synaptics-rmi: Move the fuzzing instructions to the toplevel README 2019-10-02 16:28:28 +01:00
Richard Hughes
47ae4f89d7 Fuzz the SREC and IHEX file parsers once more 2019-10-02 16:28:28 +01:00
Richard Hughes
e87abd81a2 synaptics-rmi: Fix the packing of the partition table
The data was part of the union, not the struct. It's also binary format and
thus needs to be packed.
2019-10-02 12:28:06 +01:00
Richard Hughes
63aa6759f0 Add a plugin to update Synaptics RMI4 devices 2019-10-02 10:45:13 +01:00
Mario Limonciello
5bd649ef31 uefi: detect unmounted ESP partitions (Fixes: #1405)
Mount these while writing out updates.
Leave them mounted when done (you gotta reboot anyway).
2019-09-26 10:39:45 -05:00
Mario Limonciello
dc227c6037 uefi: stop recording efibootmgr output after flash
We've not had to reference this in a long time for bugs, all the major
IBVs and OEMs have good fwupd support now.
2019-09-26 10:39:45 -05:00
Richard Hughes
59593b0c50 thelio-io: Add a plugin to detach the Thelio IO board
This does not use the DFU runtime to detach.
2019-09-25 16:05:32 +01:00
Mario Limonciello
a1f9d5850b trivial: uefi, dell: skip self tests with TPM if non-root (Fixes: #1396)
There are some packaging problems in some distributions that lead
to TSS stack emitting warnings that will fail self tests.

These don't occur as root, and furthermore those distributions run
CI as root already.

And in the dell plugin make it non-fatal to have TPM register read failures
in case the system has TPM1.2 not TPM2.0
2019-09-25 08:38:04 -05:00
Mario Limonciello
4e343bc1b9 trivial: dell: quiet the TSS output
This is the same as commit 5206592347
2019-09-25 08:38:04 -05:00
Mario Limonciello
42ee62ef34 trivial: uefi: allow forcing to TPM2 via environment variable
Use this environment variable to ensure that TPM2 is used in self
tests even if the system has TPM1.2.
2019-09-25 08:38:04 -05:00
Richard Hughes
bb59837ae0 Add a new plugin to update Conexant audio devices 2019-09-24 12:26:47 +01:00
Mario Limonciello
15cd821094 trivial: dell-dock: correct another write_size error
This was more fallout from 7afd7cba0d
which led to write_size being set to 0 and an endless loop.
2019-09-23 09:57:38 -05:00
Richard Hughes
17c02b8b1f trivial: Fix some NULL/FALSE confusion 2019-09-23 09:59:30 +01:00
Richard Hughes
d1afec8e27 synaptics-prometheus: Fix tiny memory leak when using FuSynapromConfig 2019-09-23 09:59:26 +01:00
Richard Hughes
63c1712194 unifying: Use the instance ID to check for supported devices
If we're using an instance ID with FU_DEVICE_INSTANCE_FLAG_ONLY_QUIRKS (e.g.
for the vendor match in the previous commit) then the GUID is not available.
2019-09-20 18:56:31 +01:00
Richard Hughes
d9f52c7573 unifying: Ensure HID++ v2.0 peripheral devices get scanned by the plugin
Since adding fu_plugin_add_rule(FU_PLUGIN_RULE_REQUIRES_QUIRK) all peripheral
devices were being ignored.
2019-09-20 18:56:31 +01:00
Mario Limonciello
f32c3fdbc0 trivial: wacom: Add support for second vendor ID
Wacom indicates that some systems will use this alternative VID.
2019-09-19 17:35:11 +01:00
Mario Limonciello
01a7958cd1 uefi, dell-esrt: Show firmware version when capsule updates unavailable
When the system doesn't support UEFI capsule updates no firmware version
is displayed for the BIOS.  Fix this by creating a dummy device:
```
├─System Firmware:
│     Device ID:           123fd4143619569d8ddb6ea47d1d3911eb5ef07a
│     Current version:     1.7.0
│     Vendor:              Dell Inc.
│     Update Error:        UEFI Capsule updates not available or enabled
│     Flags:               internal|require-ac|registered|needs-reboot
```

If the dell-esrt plugin determines that capsule updates can be enabled
however, make the device it creates replace the dummy device:
```
├─Dell UEFI updates:
│     Device ID:           123fd4143619569d8ddb6ea47d1d3911eb5ef07a
│     Summary:             Enable UEFI Update Functionality
│     Current version:     0
│     Update Error:        Firmware updates disabled; run 'fwupdmgr unlock' to enable
│     Flags:               locked|supported|registered|needs-reboot
```

Fixes: #1366
2019-09-19 15:48:39 +01:00
Mario Limonciello
78987fb394 uefi: make the TPM optional for runtime again (Fixes: #1362)
It's intentional to use a different error message for library failure
so that we can tell if there is a regression in CI related to TPM usage.
2019-09-17 23:41:41 +01:00
Mario Limonciello
5206592347 trivial: uefi: Make the TCTI output less verbose 2019-09-17 23:41:41 +01:00
Richard Hughes
fa0c41fb36 modem-manager: Fix two build warnings on Fedora 30 2019-09-12 18:05:20 +01:00
Richard Hughes
1c257b7779 synapticsmst: Add another name quirk for the ThinkPad USB-C Dock 2019-09-12 09:44:38 +01:00
Richard Hughes
04cb360847 uefi-recovery: Add a plugin to add a fake ESRT entry for device recovery
The factory-shipped MinnowBoardMAX board has firmware that does not include
the ESRT table. Create a 'fake' UEFI device with the lowest possible version
so that it can be updated to any version firmware.

All the HwId GUIDs are used for the fake UEFI device, and so should be used in
the firmware metadata for releases that should recover the system.
2019-09-11 12:47:31 +01:00
Richard Hughes
1984180592 Add a DMI quirk for the Minnowboard Turbot
The fwupd UEFI plugin refuses to start if bit 3 of the "BIOS Characteristics
Extension Byte 2" (13h) is cleared. Bit 3 is UEFI Specification is supported.

Also, double-check that /sys/firmware/efi does not exist before disabling the
plugin as other machines may be affected too. The quirk then acts to supress
the console warning about the broken SMBIOS value.

Fixes https://github.com/fwupd/fwupd/issues/1342
2019-09-10 20:39:45 +01:00
Filipe Laíns
718905f7f0 unifying: fix timeout metadata
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-09-07 15:25:29 -05:00
Filipe Laíns
a39951b289 unifying: fix timeout
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-09-06 13:44:10 +01:00
Mario Limonciello
20cc9eebc5 Try to only show DMI product name once
* libfwupd: export new property HostProduct
* clients: Use this property for setting the title of trees

Before:
```
○
├─XPS 13 7390 TPM 2.0:
│     Device ID:           c56e9f77cfee65151bdef90310776f9d62827f5a
│     Summary:             Platform TPM device
│     Current version:     7.2.1.0
│     Vendor:              Dell Inc.
│     Update Error:        Updating disabled due to TPM ownership
│     Flags:               internal|require-ac|registered
└─XPS 13 7390 System Firmware:
      Device ID:           b6c08fb9e5384d9d101853cc1ca20cf0ce2df2e2
      Current version:     0.1.1.1
      Minimum Version:     0.1.1.1
      Vendor:              Dell Inc.
      Flags:               internal|updatable|require-ac|registered|needs-reboot

```

After:
```
XPS 13 7390
│
├─TPM 2.0:
│     Device ID:           c56e9f77cfee65151bdef90310776f9d62827f5a
│     Summary:             Platform TPM device
│     Current version:     7.2.1.0
│     Vendor:              Dell Inc.
│     Update Error:        Updating disabled due to TPM ownership
│     Flags:               internal|require-ac|registered
└─System Firmware:
      Device ID:           b6c08fb9e5384d9d101853cc1ca20cf0ce2df2e2
      Current version:     0.1.1.1
      Minimum Version:     0.1.1.1
      Vendor:              Dell Inc.
      Flags:               internal|updatable|require-ac|registered|needs-reboot
```
2019-09-05 11:22:39 -05:00
Mario Limonciello
2275379196 dell: Use TSS to query and build TPM vendor strings for GUIDs
These are a more scalable way to apply firmware across a variety of
platforms.

An example:
```
XPS 13 7390 TPM 2.0
  DeviceId:             c56e9f77cfee65151bdef90310776f9d62827f5a
  Guid:                 a4352c96-f8d7-526c-8485-7f84085f348e <- 0962-2.0
  Guid:                 7d65b10b-bb24-552d-ade5-590b3b278188 <- DELL-TPM-2.0-NTC-NPCT
  Guid:                 6f5ddd3a-8339-5b2a-b9a6-cf3b92f6c86d <- DELL-TPM-2.0-NTC-NPCT75x
  Guid:                 fe462d4a-e48f-5069-9172-47330fc5e838 <- DELL-TPM-2.0-NTC-NPCT75xrls
  Summary:              Platform TPM device
  Plugin:               uefi
  Flags:                internal|require-ac|registered
  Vendor:               Dell Inc.
  Version:              7.2.1.0
  VersionFormat:        quad
  Icon:                 computer
  Created:              2019-09-04
```

When this system is queried using tpm2-tools:
```
$ sudo tpm2_getcap -c properties-fixed
TPM_PT_FAMILY_INDICATOR:
  as UINT32:                0x08322e3000
  as string:                "2.0"
TPM_PT_LEVEL:               0
TPM_PT_REVISION:            1.38
TPM_PT_DAY_OF_YEAR:         0x00000008
TPM_PT_YEAR:                0x000007e2
TPM_PT_MANUFACTURER:        0x4e544300
TPM_PT_VENDOR_STRING_1:
  as UINT32:                0x4e504354
  as string:                "NPCT"
TPM_PT_VENDOR_STRING_2:
  as UINT32:                0x37357800
  as string:                "75x"
TPM_PT_VENDOR_STRING_3:
  as UINT32:                0x02010024
  as string:                ""
TPM_PT_VENDOR_STRING_4:
  as UINT32:                0x726c7300
  as string:                "rls"
```
2019-09-05 00:23:23 -05:00
Mario Limonciello
43742bcd3b trivial: dell: show reasons for lack of updates in UpdateError
```
└─XPS 13 7390 TPM 2.0:
      Device ID:           c56e9f77cfee65151bdef90310776f9d62827f5a
      Summary:             Platform TPM device
      Current version:     7.2.1.0
      Vendor:              Dell Inc.
      Update Error:        Updating disabled due to TPM owernship
      Flags:               internal|require-ac|registered
```
2019-09-05 00:23:23 -05:00
Filipe Laíns
21b591f996 unifying: use fu_firmware_strparse_uint16 to read be 16bit values
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-08-29 20:01:58 +01:00
Filipe Laíns
e3f380afda unifying: fix incomplete hex file parsing
The new firmware for receivers with the nordic chips is using the 0x04
record type. This was previously not handled when parsing the file,
causing wrong behavior when trying to update the device. This patch
tries to properly deal with the record types, being them 0x04 or other.

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-08-29 20:01:58 +01:00
Mario Limonciello
0f490525f0 trivial: UEFI skip self tests if library fails to initialize
This means no simulator or TPM actually available
2019-08-29 12:52:27 -05:00
Mario Limonciello
6865dd3bac thunderbolt: Add support for kernel safety checks (Fixes: #1312)
There are commits to the Thunderbolt kernel driver that make sure
that the upgrade process goes smoothly.  If these commits aren't
present then it will look like a fwupd problem, when it's actually
a kernel problem.

When this issue was reported it appeared that commit
e4be8c9b6a
was missing from the locally tested kernel, but it's impossible
to determine that from userspace.

Prevent running the thunderbolt plugin on older kernels than that
set in `$sysconfdir/fwupd/thunderbolt.conf`.

By default that is set to 4.13.0, but if a distribution vendor has
backported all the necessary support it can be decreased to a lower
version for distro packages.
2019-08-28 11:06:18 -05:00
Richard Hughes
d350b2ecd7 synapticsmst: Partially rewrite the plugin (Fixes #1105)
This removes the 'two-layer' FuDevice and FuSyanpticsmstDevice model, where
a complicated plugin cache was used to add and remove devices to the daemon.

By making FuSynapticsmstDevice derive from FuDevice rather than GObject we can
also use a lot of the helper functionality like the other plugins, for instance
->prepare_firmware().

The `drm_dp_aux_dev` devices do not emit uevents on unplug/re-plug and so all
devices of `drm` class are watched and the actual DP AUX devices rescanned after
a small delay. When the AUX devices emit changes from the kernel this workaround
can be removed.

Also drop force power support for MST controllers in the Dell plugin. Overall
this has just led to more problems than it's helped.

 * Monitor flickers when turned on
 * Crashing graphics drivers from time to time
 * Fragile logic that doesn't always represent the device state
2019-08-28 08:50:15 -05:00
Richard Hughes
758f3b5abd trivial: Fix running the tests on devices with the TPM in v1.2 mode 2019-08-27 20:03:53 +01:00
Mario Limonciello
e13f7a142e trivial: dell-dock: correct an error preventing write_size from being set
This fixes 7afd7cba0d which led to write_size
being set to 0 and an endless loop.
2019-08-27 09:28:30 -05:00
Jonas Witschel
5a7575d947 uefi: add test for TPM 2.0 PCR read function
The test is run if a physical TPM is available or if the environment
variable "TPM_SERVER_RUNNING" is set. In the latter case, the user is
expected to start a TPM simulator on their own, like we do in the Arch
Linux CI script here.
2019-08-27 06:23:42 -05:00
Jonas Witschel
1b5f1da202 uefi: use tpm2-tss library to read PCR values
Using the library instead of the command line tools provides a more
stable interface. This implementation only fetches PCR 0 for all
available hash algorithms since this is the only PCR that is actually
used in fwupd.
2019-08-27 06:23:42 -05:00
Jonas Witschel
db82620413 uefi: add support for tpm2-tools 4.X
tpm2_pcrlist has been renamed to tpm2_pcrread in
aedb0291d2
and the output format has changed slightly to include a leading "0x" in
9374bd70f4
Also add an example of the new output format to the self test.
2019-08-25 09:56:16 +01:00
Mario Limonciello
b56571eceb trivial: plugins: clarify stance on afuefi.efi 2019-08-23 10:54:58 -05:00
Mario Limonciello
36d2fea858 trivial: plugins/: Update README
Reference fwupd.github.io
2019-08-23 10:54:58 -05:00
Mario Limonciello
71d2f62dc2 trivial: update references of hughsie/fwupd to fwupd/fwupd 2019-08-22 09:47:52 -05:00
Mario Limonciello
8de8e3523a trivial: uefi: set vendor name for system firwmare from DMI data 2019-08-21 12:37:06 -05:00
Filipe Laíns
246ab42951 unifying: update Solaar url
Signed-off-by: Filipe Laíns <lains@archlinux.org>
2019-08-21 07:08:06 -05:00
Mario Limonciello
4fa965a9f7 thunderbolt: Fix logic to work properly with ICL thunderbolt controller
This controller isn't flashable in fwupd, but fwupd can display information
about it.
* Use a generic device ID (similar to safemode)
* Build device name attribute from DMI data
2019-08-19 13:16:10 -05:00
Richard Hughes
5074b97d78 synapticsmst: Make FuSynapticsmstConnection an actual GObject
This allows us to use FuDeviceLocker in the future without a wrapper device.
2019-08-15 14:44:56 +01:00
Richard Hughes
9cfe6b6a21 synapticsmst: Use the same style as other plugins
Also split up the Tesla and Leaf hardware families.

No logic changes.
2019-08-15 14:11:48 +01:00
Richard Hughes
37c6a7ba46 trivial: Add some helper functions for GByteArray 2019-08-15 09:50:37 +01:00
Richard Hughes
6e3e62bee8 Use fu_common_string_append_kv() in subclassed device
Also define the indent level in the the ->to_string vfunc so we can correctly
print client devices in all cases.
2019-08-14 16:48:37 +01:00
Richard Hughes
b962bc206b synapticsmst: Use G_DECLARE_FINAL_TYPE to simplify the object
No logic changes.
2019-08-14 16:48:37 +01:00
Richard Hughes
21ef40f19b synapticsmst: Add a SynapticsMSTBoardID for another Lenovo dock 2019-08-14 16:48:37 +01:00
Mario Limonciello
63eb12a241 trivial: remove unnecessary CUSTOMERID_DELL define
This was previously used when the plugin was only run on Dell devices.
The plugin was already adjusted to run on other vendor's firmware
but this definition was not removed.
2019-08-14 10:36:25 -05:00
Richard Hughes
c6db17fd6a synapticsmst: Add a SynapticsMSTBoardID for a Lenovo dock 2019-08-13 17:39:33 +01:00
Richard Hughes
c85a89eff2 synapticsmst: Display the board ID in non-hex form in the error message
The SynapticsMSTBoardID quirk option is generated with the non-hex version,
so output the same format to avoid head-scratching when adding new models.
2019-08-13 17:39:29 +01:00
Richard Hughes
ba3d913804 synapticsmst: Use a more suitable icon for the device 2019-08-13 17:39:24 +01:00
Richard Hughes
d0e952bd93 trivial: Remove unused variable 2019-08-13 17:39:19 +01:00
Richard Hughes
5308ea4fae Never use memcpy() in a possibly unsafe way
There are several subtle bugs in various places in fwupd caused by not treating
user-provided offsets into buffers as unsafe. As fwupd runs as root we have to
assume that all user firmware is evil, and also that devices cannot be trusted.

Make a helper to put all the logic into one place and convert all users.
2019-08-12 09:22:09 -05:00
Richard Hughes
7afd7cba0d Use FuFirmware as a container for firmware images
In many plugins we've wanted to use ->prepare_firmware() to parse the firmware
ahead of ->detach() and ->write_firmware() but this has the limitation that it
can only return a single blob of data.

For many devices, multiple binary blobs are required from one parsed image,
for instance providing signatures, config and data blobs that have to be pushed
to the device in different way.

This also means we parse the firmware *before* we ask the user to detach.

Break the internal FuDevice API to support these firmware types as they become
more popular.

This also allows us to move the Intel HEX and SREC parsing out of the dfu plugin
as they are used by a few plugins now, and resolving symbols between plugins
isn't exactly awesome.
2019-08-08 13:10:57 +01:00
Aleksander Morgado
3eb27564ef modem-manager: add counterpart GUID for the DW5821e
The DW5821e in modem mode uses the 0x81D7 PID, but when it boots in
fastboot mode it uses the 0x81D6 PID. The upgrade procedure was able
to automatically match these two devices because they both shared the
very generic per-VID (0x413C) GUID, but this is no longer operational
since commit 8ef139faba, as the very generic GUIDs have been removed
for matching purposes.

So, define a quirk for the DW5821e, in order to add a counterpart
GUID to make device matching work properly again.

Fixes https://github.com/hughsie/fwupd/issues/1271
2019-08-05 16:15:09 +01:00
Richard Hughes
c6dba62cf0 solokey: Release the interface and rebind the kernel driver on close 2019-08-05 09:25:04 +01:00
Richard Hughes
a7715bc74a uefi: Actually write the new device path if different than before
If we add or remove a quirk from a machine using the uefi plugin then the new
setting is not used until the BootXXXX EFI key is manually removed. Rather than
just writing the contents of the found key back to the key (doh) just write the
new DP buffer contents if it is different from the previous buffer.
2019-08-02 14:34:12 +01:00
Richard Hughes
fad78a758e Allow setting custom flags when using fwupdate
This allows the ODM to specify command line arguments such as:

    --flags=use-shim-unique,use-legacy-bootmgr-desc,no-ux-capsule

..which is useful for testing broken firmware.
2019-08-02 14:34:12 +01:00
Richard Hughes
c5eb83cb87 trivial: Do not show a critical warning if no firmware is specified 2019-08-02 14:34:12 +01:00
Richard Hughes
90da72ad76 trivial: Fix overzealous search-replace action in user string 2019-08-02 14:34:12 +01:00
Richard Hughes
dfaca2de2e Fix a crash when stopping the fwupd service
This difficult to debug bug only showed up when the fwupd service was stopped,
which the user never noticed, but services like abrt were still keen to report.
The root issue was that the call to fu_plugin_get_smbios_data() in
fu-plugin-uefi.c:fu_plugin_startup() was freeing the returned const GBytes,
which rippled down all the way to a double-free deep in libxmlb.

It's somewhat unusual to have a const GBytes, so just change the plugin helper
to returned a ref'd copy, on the logic a potential 16 byte memory leak is better
than a double-free when the next plugin gets the logic the wrong way around.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1734746
2019-08-01 13:00:51 +01:00
Mario Limonciello
ffe7fe24bc trivial: Update icons for Thunderbolt and MST devices 2019-07-30 13:15:20 -07:00
Richard Hughes
d8f78d0b93 Add support for the SoloKey Secure 2019-07-30 16:16:14 +01:00
Mario Limonciello
a1a4a3378a trivial: thunderbolt: catch failure setting up device
Fixes: b3aa793539 ("thunderbolt: Convert the instance IDs as we never open the device")
2019-07-15 08:12:26 -07:00
Mario Limonciello
ac627cd8ca dell-esrt: Improve the experience for the plugin (Closes: #1245)
* Set UpdateError to indicate how the device needs to be updated
* Set the device as needing reboot
* If admin password is set show the message to frontend via `UpdateError`
2019-07-15 04:37:37 -07:00
Jeff
a4826d3eb1 remove those PIDs with Bluetooth interface, Wacom updater doesn't support updating from Bluetooth interface
Signed-off-by: Jeff <jeff.gu@wacom.com>
2019-07-15 09:09:29 +01:00
Richard Hughes
e8c5f783bb flashrom: Only show DEBUG and DEBUG2 output if using --plugin-verbose=flashrom 2019-07-12 09:22:38 -07:00
Richard Hughes
53263a3a99 flashrom: Only call flashrom_programmer_init() on whitelisted boards
I'm not 100% sure calling flashrom_programmer_init('internal') unconditionally
on every platform is a very good idea. Only probe the hardware if there is a
whitelisted supported device.

Fixes https://github.com/hughsie/fwupd/issues/1239
2019-07-12 09:22:38 -07:00
Artur Raglis
1e47690fd9 flashrom: Fix no version format set
Signed-off-by: Artur Raglis <artur.raglis@3mdeb.com>
2019-07-11 19:16:14 +01:00
Mario Limonciello
e219a994dd trivial: uefi: use UEFI-dummy for device ID instead of just uefi 2019-07-11 09:33:23 -07:00
Mario Limonciello
badef4daf3 trivial: fix error handling for non UEFI case (#1220) 2019-07-11 09:33:23 -07:00
Richard Hughes
4266ac4765 Add a specific error code for the low battery case
Users are getting confused when they're being told that AC power is required
when they are already on AC power... but the battery is too low to perform the
update.
2019-07-11 09:31:34 -07:00
Mario Limonciello
65a4894bba uefi: Determine whether running in legacy mode or not (Fixes: #1220)
* In startup, check BIOS characteristics for UEFI supported instead of for /sys/firmware/uefi
* In coldplug check for /sys/firmware/uefi
* If /sys/firwmare/uefi missing, create a dummy device telling the user it is in legacy mode
2019-07-10 10:20:49 -07:00
Yehezkel Bernat
6b5f5d13c7 trivial: Fix typos in error messages 2019-07-05 12:48:17 +01:00
Artur Raglis
13fd21d806 flashrom: Use libflashrom
This also means we now include a flashrom subproject as no distro currently has
a flashrom new enough to build the plugin.

Signed-off-by: Richard Hughes <richard@hughsie.com>
Signed-off-by: Artur Raglis <artur.raglis@3mdeb.com>
Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
2019-06-28 08:28:51 +01:00
sigurdb
9608e50a84 Add support for 8bitdo USB Retro Receiver 2019-06-13 20:49:07 +01:00
Richard Hughes
ea995da5f2 Revert "Allow SuperIO updates to be done live"
This reverts commit 87a392954a7427d68b61d0e53987a46d5984a9fd.
2019-06-11 08:04:09 +00:00
Richard Hughes
59e375707a uefi: Try to find a duplicate using the loadopt name
This means if the loadoptdata changes for any reason (e.g. we start using a
different quirk) we don't get duplicate entries in efibootmgr.
2019-06-05 11:12:07 +01:00
Richard Hughes
49c99038eb uefi: Provide a quirk to disable the use of the UX capsule 2019-06-05 11:12:07 +01:00
Mario Limonciello
53f0c585ed trivial: uefi: use the path for efibootmgr that was detected
A failure report on LVFS shows that NixOS wasn't able to launch
efibootmgr.
2019-05-31 10:07:59 -05:00
Richard Hughes
67435426f4 synaptics-prometheus: Fix installing CONFIG firmware updates
Open the parent device to perform requests using the proxy virtual device.
2019-05-28 17:24:50 +01:00
Richard Hughes
39a270e1b3 synaptics-prometheus: Set the install duration from a quirk
Yes, it is quick. It's really the time to process one HUGE bulk request...
2019-05-28 17:24:50 +01:00
Richard Hughes
8a5df4dd32 synaptics-prometheus: Don't emit critial warning when updating config firmware 2019-05-28 17:24:50 +01:00
Richard Hughes
5575083677 synaptics-prometheus: Fix missing field in the IOTA reply struct 2019-05-28 17:24:50 +01:00
Richard Hughes
10f8d15af1 redfish: Never set NULL device name 2019-05-24 12:57:56 +01:00
Richard Hughes
ebe1d43122 modem-manager: Never set NULL device name 2019-05-24 12:57:56 +01:00
Richard Hughes
501a84d08f ata: Never set NULL device name
Probably fixes https://github.com/hughsie/fwupd/issues/1206
2019-05-24 12:57:56 +01:00
Mario Limonciello
6f352cb7e5 synapticsmst: fix GUID generation (Closes: #1207)
When converting to instances we forgot to add the GUIDs to the device
as well.
2019-05-23 09:52:18 -05:00
Sean-StarLabs
7239c6ab45 Lite Mk II flag for use-shim-unique
Added AMI fix for the "duplicate entry" issue to firmware version 1.0.4 - quirk is needed to install new version
2019-05-23 14:57:17 +01:00
Richard Hughes
13800b719e Allow SuperIO updates to be done live
Apparently Star Labs have been using this for some time. It's still important
to reboot after the update has been performed.
2019-05-22 12:54:38 +01:00
Mario Limonciello
d83f5fe05e trivial: uefi: clarify error message
Help people to debug when their ESP isn't found.
2019-05-20 10:59:54 -07:00
Richard Hughes
c7bdded2c6 Add a plugin to update Synaptics Prometheus fingerprint readers 2019-05-14 17:18:55 +01:00
Richard Hughes
dfa9e11bb2 Allow handling FORCE for devices that subclass FuDevice
Pass FwupdInstallFlags down to the vfunc to allow us to check the flags when
parsing the firmware and updating the device.
2019-05-05 15:29:00 -05:00
Richard Hughes
26d3da4074 uefi: Fix a libasan failure when reading a UEFI variable
It seems some older versions of libefi var incorrectly build the 'length' value
in the DP returned from efi_generate_file_device_path(). This means we copy past
the end of the allocated buffer when parsing the efi_update_info_t structure.

This bug seems fixed in efivar git master, and this fix is only going to help
people with older efivar versions. It's probably a good thing to be a bit more
paranoid about EFI variable data anyway.

    DEBUG: UpdateInfo:
           ? 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
    ????????????????????????????????????????????????????????????????????????????????????????????????????????
    0x0000 ? 07 00 00 00 20 d9 7b 69 cf 12 a9 4d 83 85 99 69 09 bc 65 59 00 00 05 00 00 00 00 00 00 00 00 00
    0x0020 ? 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 01 2a 00 01 00 00 00 00 08 00 00
    0x0040 ? 00 00 00 00 00 40 06 00 00 00 00 00 5a aa 97 5a 10 d5 7e 49 99 0b ca 8d 35 4d c8 6d 02 02 04 04
    0x0060 ? 86 00 5c 00 45 00 46 00 49 00 5c 00 66 00 65 00 64 00 6f 00 72 00 61 00 5c 00 66 00 77 00 5c 00
    0x0080 ? 66 00 77 00 75 00 70 00 64 00 2d 00 36 00 39 00 37 00 62 00 64 00 39 00 32 00 30 00 2d 00 31 00
    0x00a0 ? 32 00 63 00 66 00 2d 00 34 00 64 00 61 00 39 00 2d 00 38 00 33 00 38 00 35 00 2d 00 39 00 39 00
    0x00c0 ? 36 00 39 00 30 00 39 00 62 00 63 00 36 00 35 00 35 00 39 00 2e 00 63 00 61 00 70 00 00 00 7f ff
    0x00e0 ? 04 00
    DEBUG: DP type:0x04 subtype:0x01 size:0x002a
    DEBUG: DP type:0x04 subtype:0x04 size:0x0086
    DEBUG: found END_ENTIRE at 0x00aa
    DEBUG: DP length invalid! Truncating from 0x0086 to 0x0080
    DEBUG: DP type:0x7f subtype:0xff size:0x0004
2019-05-02 17:25:34 +01:00
Richard Hughes
bb5199b428 trivial: Fix an libasan failure in the dell plugin
Use a buffer of an explicit size to avoid reading junk off the stack.
2019-05-02 10:46:06 +01:00
Richard Hughes
f5a0d24a95 trivial: Fix a missing config.h include in a new source file 2019-05-02 09:59:47 +01:00
Mario Limonciello
8be5756edd ata: Set version format to plain for devices obtained from udev
This matches behavior of those obtained by ID command.
2019-04-30 09:31:55 +01:00
Richard Hughes
5079f26f0e Never guess the version format from the version string
This leads to madness, as some formats are supersets of the detected types,
e.g. 'intel-me' is detected as 'quad' and 'bcd' is detected as 'pair'.

Where the version format is defined in a specification or hardcoded in the
source use a hardcoded enum value, otherwise use a quirk override.

Additionally, warn if the version does not match the defined version format
2019-04-30 09:25:41 +01:00
Richard Hughes
c84b36c541 Export the version-format to clients
This allows a vendor to verify the VersionFormat of a device without running
the daemon in verbose mode.
2019-04-30 09:25:41 +01:00
Richard Hughes
5d7f5a2a87 dfu: Add some trivial, but useful, debugging for AVR DFU devices 2019-04-29 08:27:51 -05:00
Richard Hughes
3c7f58170d dfu: Correctly identify DFU firmware that starts at offset zero
Use 0xffffffff as the 'never set' base address.
2019-04-29 08:27:51 -05:00
Richard Hughes
2cebf6c555 dfu: Don't keep showing trivial debug output 2019-04-29 08:27:51 -05:00
Richard Hughes
e4e96742e7 dfu: Reset the forced version during attach and detach
If the runtime DFU version is a vanilla DFU runtime rather than the AVR32 DFU
variant then we no longer need to use the override.
2019-04-29 08:27:51 -05:00
Mario Limonciello
8b222bd557 ata/nvme: For devices running Dell firmware, set VersionFormat (Fixes: #1169)
Dell firmware is known to use `VersionFormat` `plain`.
2019-04-25 10:26:02 -05:00
Richard Hughes
cdd390a785 trivial: Fix fwupdate --apply 2019-04-25 12:52:59 +01:00
Mario Limonciello
398afe545f trivial: dell-dock: set minimum board to 6
Drop all TODO and quirks for older pre-production boards.
2019-04-23 13:36:30 -05:00
Richard Hughes
7886c086a1 Don't upload reports when the user has configured their system in a broken way
I'm getting a bit fed up with failed reports from arch users where they just
have a broken system. I don't think it's useful to upload to the LVFS or notify
the vendor about failures like this.
2019-04-18 22:06:01 +08:00
Richard Hughes
3c8777f0f6 Do not fall back integers to a plain version format
We can't possibly know what version format to use.
2019-04-17 12:11:45 -04:00
Richard Hughes
1fb8202b06 nvme: Fix the correct handling of a plain version number 2019-04-17 15:46:58 +01:00
Mario Limonciello
c73c02fa70 trivial: uefi: clarify errors related to secure boot 2019-04-17 16:39:29 +08:00
Mario Limonciello
a50b02faf2 uefi: Don't leak the application build path into the binary
This can be set at runtime if needed using environment variables.
2019-04-17 16:39:29 +08:00
Richard Hughes
8fada51919 Correctly parse DFU interfaces with extra vendor-specific data
Fixes: https://github.com/hughsie/fwupd/issues/1152
2019-04-17 15:12:43 +08:00
Richard Hughes
cce6a1cb5a Do not report transient failures
We don't need to report failures to do with AC or battery level to the LVFS.
2019-04-17 08:20:44 +08:00
Kelly Anderson
31b2ce83e1 Updated: Add support for 8BitDo M30. 2019-04-09 12:38:24 -04:00
Aleksander Morgado
8a1dce9472 modem-manager: increase the timeout to wait for modem after uninhibited
The timeout to wait for the modem after being uninhibited was until
now exclusively to cover the port probing time, because the device
would be already available and ready to be used as soon as the
inhibition was removed.

With the change to include carrier config selection as part of the
fwupd upgrade process, the time to wait for the modem after being
uninhibited should now cover a full reboot of the module, and so the
original timeout of 45s could be a bit tight under some circumstances
(e.g the MM device probing logic is quite slow when there is no SIM
card detected by the module).

We increase this timeout to a much safer value of 120s, which is
extremely long for most cases, but should also be enough to cover even
the worst case scenario.
2019-04-09 07:54:46 -04:00
Aleksander Morgado
ffb8fd5edc modem-manager: implement qmi pdc active config selection as attach()
When we install the MCFG carrier config files with QMI PDC, we were
not explicitly selecting one, and that would end up reporting the
"DF" (default) config is in use. Instead, we should explicitly select
the carrier configuration that we were using before the firmware
upgrade operation.

For example, if the device originally was running with the Vodafone
specific carrier configuration (e.g. T77W968.F1.0.0.3.7.VF.009) and we
trigger the upgrade to the next available firmware associated to
the Vodafone carrier (e.g. T77W968.F1.0.0.3.8.VF.009), we would want
the device to boot with the Vodafone carrier config selected, instead
of booting without any config selected (T77W968.F1.0.0.3.8.DF.009).

This also fixes several upgrade problems detected by fwupd, because it
may end up complaining that the target firmware that was selected to
be installed (e.g. VF variant) is not the one actually reported by the
device after the upgrade (e.g. DF variant).

The selection of which is the config to activate is based on mapping
the mcfg file name with the firmware version reported by the module
before the upgrade. E.g. if the VF variant is reported by the module
(T77W968.F1.0.0.3.7.VF.009), fwupd will look for a MCFG file named
with the "mcfg.VF." prefix.
2019-04-09 07:54:46 -04:00
Mario Limonciello
cc3d560571 thunderbolt: Set require-ac for Thunderbolt devices (Fixes: #1142) 2019-04-09 03:15:30 -04:00
Richard Hughes
dce91204c9 Fix some typos spotted using codespell 2019-04-08 12:47:53 +01:00
Mario Limonciello
2df922c23d Move the core built-in 'fwupd' remote over to the dell-esrt plugin
This metadata is useless to other systems, so if compiling a custom
fwupd without -Dplugin_dell=true it shouldn't be included.
2019-04-02 07:18:29 -05:00
Mario Limonciello
33527a8d5c ata: Flush cache before standby and activate
I had thought this should be implicit from standby immediate command
but it isn't.
2019-03-31 16:26:53 -05:00
Mario Limonciello
57816a7907 synapticsmst: blacklist plugin when using amdgpu (Fixes: #1121)
An undiagnosed kernel issue is leading to a kernel crash involving
DP aux reads with amdgpu involved.

It's been reproduced in kernel 4.15 with a DKMS version of amdgpu as
well as kernel 4.19 with amdgpu within the kernel.

```
[16862.519947] [drm:generic_reg_wait [amdgpu]] *ERROR* REG_WAIT timeout 10us * 160 tries - submit_channel_request line:246
[16862.519983] WARNING: CPU: 5 PID: 3015 at drivers/gpu/drm/amd/amdgpu/../display/dc/dc_helper.c:254 generic_reg_wait+0xe2/0x160 [amdgpu]
[16862.519984] Modules linked in: rfcomm snd_hda_codec_realtek snd_hda_codec_generic cmac bnep arc4 nls_iso8859_1 amdkfd amd_iommu_v2 amdgpu i915 dell_rbtn iwlmvm snd_soc_skl wmi_bmof dell_wmi intel_rapl x86_pkg_temp_thermal dell_laptop intel_powerclamp snd_soc_skl_ipc dell_smbios coretemp snd_soc_sst_ipc dell_wmi_descriptor kvm_intel dcdbas snd_soc_sst_dsp snd_hda_ext_core kvmgt dell_smm_hwmon snd_soc_acpi_intel_match mac80211 vfio_mdev crct10dif_pclmul mdev vfio_iommu_type1 crc32_pclmul snd_soc_acpi vfio ghash_clmulni_intel snd_soc_core kvm pcbc snd_compress ac97_bus aesni_intel snd_hda_codec_hdmi snd_pcm_dmaengine chash gpu_sched aes_x86_64 snd_hda_intel crypto_simd snd_hda_codec cryptd ttm glue_helper pcmcia irqbypass snd_hda_core drm_kms_helper intel_cstate intel_rapl_perf snd_hwdep uvcvideo snd_pcm
[16862.520008]  drm cdc_ether iwlwifi cdc_mbim videobuf2_vmalloc snd_seq_midi videobuf2_memops cdc_ncm snd_seq_midi_event videobuf2_v4l2 snd_rawmidi videobuf2_common videodev input_leds serio_raw btusb qmi_wwan btrtl r8152 snd_seq btbcm media cdc_wdm btintel usbnet option mii usb_wwan bluetooth usbserial cdc_acm hid_multitouch joydev snd_seq_device snd_timer cfg80211 snd yenta_socket pcmcia_rsrc idma64 pcmcia_core soundcore virt_dma i2c_algo_bit fb_sys_fops syscopyarea mei_me sysfillrect ecdh_generic sysimgblt mei ucsi_acpi intel_lpss_pci processor_thermal_device typec_ucsi intel_lpss intel_soc_dts_iosf intel_pch_thermal typec wmi soc_button_array mac_hid intel_hid int3400_thermal video int3403_thermal dell_smo8800 sparse_keymap acpi_thermal_rel int340x_thermal_zone acpi_pad sch_fq_codel parport_pc
[16862.520033]  ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid uas usb_storage e1000e ahci libahci i2c_hid hid
[16862.520040] CPU: 5 PID: 3015 Comm: fwupd Not tainted 4.19.0 #1
[16862.520040] Hardware name: Dell Inc. Latitude 7424 Rugged Extreme/, BIOS 1.0.0 09/12/2018
[16862.520062] RIP: 0010:generic_reg_wait+0xe2/0x160 [amdgpu]
[16862.520063] Code: ab 44 8b 45 20 48 8b 4d 18 44 89 e6 8b 55 10 48 c7 c7 f0 bf 12 c1 44 89 4d d4 e8 79 1d 65 ff 41 83 7d 18 01 44 8b 4d d4 74 02 <0f> 0b 48 83 c4 18 44 89 c8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 41 0f
[16862.520064] RSP: 0018:ffffbdff831ffbe0 EFLAGS: 00010297
[16862.520065] RAX: 0000000000000000 RBX: 00000000000000a1 RCX: 0000000000000000
[16862.520065] RDX: 0000000000000000 RSI: ffff965fee356428 RDI: ffff965fee356428
[16862.520066] RBP: ffffbdff831ffc20 R08: 00000000000004d5 R09: 00000000ffffffff
[16862.520066] R10: fffff464915dbd00 R11: ffffffff981923ed R12: 000000000000000a
[16862.520067] R13: ffff965fdea5d480 R14: 0000000000000001 R15: 0000000000000000
[16862.520068] FS:  00007f17444485c0(0000) GS:ffff965fee340000(0000) knlGS:0000000000000000
[16862.520068] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[16862.520069] CR2: 00007f1732987150 CR3: 000000045f4fe006 CR4: 00000000003606e0
[16862.520070] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[16862.520070] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[16862.520070] Call Trace:
[16862.520097]  submit_channel_request+0x394/0x480 [amdgpu]
[16862.520118]  dc_link_aux_transfer+0xca/0x160 [amdgpu]
[16862.520142]  dm_dp_aux_transfer+0x59/0x120 [amdgpu]
[16862.520146]  drm_dp_dpcd_access+0x75/0x110 [drm_kms_helper]
[16862.520148]  drm_dp_dpcd_read+0x33/0xc0 [drm_kms_helper]
[16862.520152]  auxdev_read_iter+0x10f/0x1d0 [drm_kms_helper]
[16862.520154]  __vfs_read+0x106/0x180
[16862.520155]  vfs_read+0x8e/0x130
[16862.520156]  ksys_read+0x55/0xc0
[16862.520157]  __x64_sys_read+0x1a/0x20
[16862.520159]  do_syscall_64+0x5a/0x120
[16862.520161]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[16862.520162] RIP: 0033:0x7f1741b3a384
[16862.520163] Code: 84 00 00 00 00 00 41 54 55 49 89 d4 53 48 89 f5 89 fb 48 83 ec 10 e8 8b fc ff ff 4c 89 e2 41 89 c0 48 89 ee 89 df 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 48 89 44 24 08 e8 c7 fc ff ff 48
[16862.520163] RSP: 002b:00007fffadd980f0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[16862.520164] RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 00007f1741b3a384
[16862.520165] RDX: 0000000000000001 RSI: 00007fffadd98154 RDI: 0000000000000013
[16862.520165] RBP: 00007fffadd98154 R08: 0000000000000000 R09: 000055fd7e9c7010
[16862.520166] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
[16862.520166] R13: 00007fffadd981c0 R14: 00007fffadd98154 R15: 000055fd7eae35b0
[16862.520167] ---[ end trace 8e8b280a234718a5 ]---
[16862.520176] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[16862.520177] PGD 0 P4D 0
[16862.520179] Oops: 0000 [#1] SMP PTI
[16862.520180] CPU: 5 PID: 3015 Comm: fwupd Tainted: G        W         4.19.0 #1
[16862.520181] Hardware name: Dell Inc. Latitude 7424 Rugged Extreme/, BIOS 1.0.0 09/12/2018
[16862.520205] RIP: 0010:dal_ddc_close+0xd/0x30 [amdgpu]
[16862.520207] Code: f1 00 e8 06 f5 ff ff 48 8b 55 f8 65 48 33 14 25 28 00 00 00 75 02 c9 c3 e8 70 09 65 d5 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb <48> 8b 7f 08 e8 da f5 ff ff 48 8b 3b e8 d2 f5 ff ff 5b 5d c3 66 2e
[16862.520208] RSP: 0018:ffffbdff831ffc58 EFLAGS: 00010246
[16862.520209] RAX: ffffffffc103f410 RBX: 0000000000000000 RCX: 0000000000000000
[16862.520210] RDX: ffffffffc10de660 RSI: 0000000000005c58 RDI: 0000000000000000
[16862.520211] RBP: ffffbdff831ffc60 R08: 0000000000000001 R09: 00000000ffffffff
[16862.520211] R10: fffff464915dbd00 R11: 0000000000000001 R12: 0000000000000000
[16862.520212] R13: ffffbdff831ffdd0 R14: ffffbdff831ffd3d R15: 0000000000000000
[16862.520213] FS:  00007f17444485c0(0000) GS:ffff965fee340000(0000) knlGS:0000000000000000
[16862.520214] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[16862.520215] CR2: 0000000000000008 CR3: 000000045f4fe006 CR4: 00000000003606e0
[16862.520216] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[16862.520217] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[16862.520218] Call Trace:
[16862.520242]  release_engine+0x16/0x70 [amdgpu]
[16862.520263]  dc_link_aux_transfer+0xfd/0x160 [amdgpu]
[16862.520287]  dm_dp_aux_transfer+0x59/0x120 [amdgpu]
[16862.520290]  drm_dp_dpcd_access+0x75/0x110 [drm_kms_helper]
[16862.520293]  drm_dp_dpcd_read+0x33/0xc0 [drm_kms_helper]
[16862.520296]  auxdev_read_iter+0x10f/0x1d0 [drm_kms_helper]
[16862.520298]  __vfs_read+0x106/0x180
[16862.520300]  vfs_read+0x8e/0x130
[16862.520301]  ksys_read+0x55/0xc0
[16862.520302]  __x64_sys_read+0x1a/0x20
[16862.520304]  do_syscall_64+0x5a/0x120
[16862.520306]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[16862.520307] RIP: 0033:0x7f1741b3a384
[16862.520308] Code: 84 00 00 00 00 00 41 54 55 49 89 d4 53 48 89 f5 89 fb 48 83 ec 10 e8 8b fc ff ff 4c 89 e2 41 89 c0 48 89 ee 89 df 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 48 89 44 24 08 e8 c7 fc ff ff 48
[16862.520309] RSP: 002b:00007fffadd980f0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[16862.520310] RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 00007f1741b3a384
[16862.520311] RDX: 0000000000000001 RSI: 00007fffadd98154 RDI: 0000000000000013
[16862.520312] RBP: 00007fffadd98154 R08: 0000000000000000 R09: 000055fd7e9c7010
[16862.520312] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
[16862.520313] R13: 00007fffadd981c0 R14: 00007fffadd98154 R15: 000055fd7eae35b0
[16862.520314] Modules linked in: rfcomm snd_hda_codec_realtek snd_hda_codec_generic cmac bnep arc4 nls_iso8859_1 amdkfd amd_iommu_v2 amdgpu i915 dell_rbtn iwlmvm snd_soc_skl wmi_bmof dell_wmi intel_rapl x86_pkg_temp_thermal dell_laptop intel_powerclamp snd_soc_skl_ipc dell_smbios coretemp snd_soc_sst_ipc dell_wmi_descriptor kvm_intel dcdbas snd_soc_sst_dsp snd_hda_ext_core kvmgt dell_smm_hwmon snd_soc_acpi_intel_match mac80211 vfio_mdev crct10dif_pclmul mdev vfio_iommu_type1 crc32_pclmul snd_soc_acpi vfio ghash_clmulni_intel snd_soc_core kvm pcbc snd_compress ac97_bus aesni_intel snd_hda_codec_hdmi snd_pcm_dmaengine chash gpu_sched aes_x86_64 snd_hda_intel crypto_simd snd_hda_codec cryptd ttm glue_helper pcmcia irqbypass snd_hda_core drm_kms_helper intel_cstate intel_rapl_perf snd_hwdep uvcvideo snd_pcm
[16862.520332]  drm cdc_ether iwlwifi cdc_mbim videobuf2_vmalloc snd_seq_midi videobuf2_memops cdc_ncm snd_seq_midi_event videobuf2_v4l2 snd_rawmidi videobuf2_common videodev input_leds serio_raw btusb qmi_wwan btrtl r8152 snd_seq btbcm media cdc_wdm btintel usbnet option mii usb_wwan bluetooth usbserial cdc_acm hid_multitouch joydev snd_seq_device snd_timer cfg80211 snd yenta_socket pcmcia_rsrc idma64 pcmcia_core soundcore virt_dma i2c_algo_bit fb_sys_fops syscopyarea mei_me sysfillrect ecdh_generic sysimgblt mei ucsi_acpi intel_lpss_pci processor_thermal_device typec_ucsi intel_lpss intel_soc_dts_iosf intel_pch_thermal typec wmi soc_button_array mac_hid intel_hid int3400_thermal video int3403_thermal dell_smo8800 sparse_keymap acpi_thermal_rel int340x_thermal_zone acpi_pad sch_fq_codel parport_pc
[16862.520351]  ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid uas usb_storage e1000e ahci libahci i2c_hid hid
[16862.520356] CR2: 0000000000000008
[16862.520357] ---[ end trace 8e8b280a234718a6 ]---
[16862.520380] RIP: 0010:dal_ddc_close+0xd/0x30 [amdgpu]
[16862.520382] Code: f1 00 e8 06 f5 ff ff 48 8b 55 f8 65 48 33 14 25 28 00 00 00 75 02 c9 c3 e8 70 09 65 d5 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb <48> 8b 7f 08 e8 da f5 ff ff 48 8b 3b e8 d2 f5 ff ff 5b 5d c3 66 2e
[16862.520382] RSP: 0018:ffffbdff831ffc58 EFLAGS: 00010246
[16862.520384] RAX: ffffffffc103f410 RBX: 0000000000000000 RCX: 0000000000000000
[16862.520384] RDX: ffffffffc10de660 RSI: 0000000000005c58 RDI: 0000000000000000
[16862.520385] RBP: ffffbdff831ffc60 R08: 0000000000000001 R09: 00000000ffffffff
[16862.520386] R10: fffff464915dbd00 R11: 0000000000000001 R12: 0000000000000000
[16862.520387] R13: ffffbdff831ffdd0 R14: ffffbdff831ffd3d R15: 0000000000000000
[16862.520388] FS:  00007f17444485c0(0000) GS:ffff965fee340000(0000) knlGS:0000000000000000
[16862.520389] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[16862.520390] CR2: 0000000000000008 CR3: 000000045f4fe006 CR4: 00000000003606e0
[16862.520391] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[16862.520392] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
```
2019-03-29 08:13:16 -05:00
Gary Lin
5d9984e5ad uefi: add a new option to specify the os name
fu_uefi_get_esp_path_for_os() generates the path to the OS directory
based on "ID" in /etc/os-release, and it may not work for some distros.

Take openSUSE as an example, the "ID" for openSUSE Leap is
"opensuse-leap" and that for openSUSE Tumbleweed is "opensuse-tumbleweed".
However, both of them use the same OS directory in the ESP, i.e.
"/EFI/opensuse".

This commit adds a new build option, efi_os_dir, to allow the packager to
specify the name of OS directory at build time instead of the runtime
detection.

Signed-off-by: Gary Lin <glin@suse.com>
2019-03-29 04:29:42 -04:00
Mario Limonciello
b7f494364b trivial: ata: fix a transposed character in the | for setting activation device
This doesn't appear to impact the actual setting of the device, but
maybe some other disks will be more finicky in the future.
2019-03-27 17:08:45 -05:00
Richard Hughes
0a57b90d75 uefi: More carefully check the output from tpm2_pcrlist
Otherwise we can get a PCR0 of 'getcapability:getpcrallocationstatuserror'...
2019-03-27 14:18:19 -04:00
Richard Hughes
77d97406f2 uefi: Don't overwrite CustomFlags if set from a quirk 2019-03-27 14:21:00 +00:00
Mario Limonciello
3cdd558fe4 ata: Correct activation functionality
No data is actually exchanged in the activation flow.

The commands need to be sent in the direction `SG_DXFER_NONE` to
avoid ATA errors.
2019-03-27 09:51:59 +00:00
Mario Limonciello
791b596d00 ata: send ATA standby immediate when activating firmware
This should flush all remaining writes and make the drive safe to
update.
2019-03-26 06:30:23 -04:00
Richard Hughes
07c1b2d0f4 superio: Add InstallDuration default value 2019-03-23 16:13:52 +00:00
Richard Hughes
38b357b131 superio: Add support for writing new e-flash contents 2019-03-23 12:04:18 +00:00
Richard Hughes
6c2cc7868f superio: Fix reading the attestation checksum
The 14th signature byte is 'hijacked' as the SPI to e-flash offset in the hw.
2019-03-23 12:04:18 +00:00
Richard Hughes
0573febb0b superio: Add support for reading the device checksum 2019-03-23 12:04:18 +00:00
Richard Hughes
4702dfe0a7 superio: Use the chipset ID in the device name 2019-03-23 12:04:18 +00:00
Richard Hughes
763483411d superio: Move the device flush before getting the register map 2019-03-23 12:04:18 +00:00
Richard Hughes
c5ef28ad5e superio: Move all the IT89xx code to a subclassed device object 2019-03-23 12:04:18 +00:00
Richard Hughes
ebedf62b15 superio: Move all the IT85xx code to a subclassed device object 2019-03-23 12:04:18 +00:00
Richard Hughes
ebd55e5d14 superio: Split and export fu_superio_device_ec_writeX() 2019-03-23 12:04:18 +00:00
Richard Hughes
08609f3920 superio: Remove the port from fu_superio_device_ec_read()
It's always going to be PM1_IOBAD0.
2019-03-23 12:04:18 +00:00