Commit Graph

1633 Commits

Author SHA1 Message Date
Richard Hughes
1283c2696d Do not skip attach() if the device is marked _WILL_DISAPPEAR
The idea here is that the device would not come back after it was restarted,
and skipping the attach in the engine was only working around the fact that the
ebitdo did not split out an ->attach() function.

We can't really blame it; we only decoupled the _IS_BOOTLOADER requirement
for ->attach() recently...
2020-04-16 08:43:45 -05:00
Richard Hughes
a1ef52e5f9 dell-dock: Port to using fu_device_get_proxy()
This also cleans up the memory handling to prevent a ref-cycle loop that
prevented the dock devices from being finalized if the dock was removed.
2020-04-15 20:34:31 +01:00
Richard Hughes
e95613f670 vli: Do not show the USB 2 recovery devices for USB 3 hubs
The USB 2.0 controller is used as a 'backup' in case the USB 3.0 firmware fails
to start. Set USB 3 hubs as a greater priority so that the USB 2 ones do not
not get added if the USB 3 firmware is working.
2020-04-15 14:11:06 +01:00
Richard Hughes
95c3bf2617 vli: Add metadata to identify which is the same physical device 2020-04-15 14:11:06 +01:00
Sam Morris
6a161aa1d1 uefi: correctly format firmware version of Dynabook (né Toshiba) X30, X40 and probably others
Fixes #1998
2020-04-15 13:00:26 +01:00
Richard Hughes
a86b08f27c synaptics-cxaudio: Use the ->attach() device vfunc
This allows us to test the device reset using fwupdtool.
2020-04-15 12:36:11 +01:00
Richard Hughes
f23a906cfb synaptics-cxaudio: Wait for the device to reboot after writing firmware
Fixes an error where we get:

    failed to reload device: USB error on device 17ef:a396 : No such device
2020-04-15 12:36:11 +01:00
Mario Limonciello
de60e04481 logitech_hidpp: decrease verbosity of messages that hid++ ID is missing
These are a regression of 9e755e2a5 when devices are asleep.
However due to the current kernel and daemon architecture, logitech devices
are not checked again at any time so if the device isn't awake when
fwupd is started or the unifying dongle is plugged in it won't be present.

This will be changed in the future when the kernel has change events
associated with devices waking up.

Fixes: #1973
2020-04-14 11:26:22 -05:00
Richard Hughes
cf0a7678b8 Allow removing device flags from quirk files
This also means we do the right thing when plugins call fu_device_add_flag()
directly, instead of just from a quirk file.

For instance, now `Flags = ~updatable` is a valid and useful thing to have and
allows us to remove the `Flags = None` hack.
2020-04-13 23:18:19 +01:00
Richard Hughes
fe11927eef Use black to format python source in a consistent manner
No code changes.
2020-04-13 23:06:30 +01:00
Richard Hughes
a8c6c02459 Do not conditionalize attach() and detach() on IS_BOOTLOADER
This is nice in theory, until you need to look at the bootloader status of the
parent, or of a different device entirely. Handle this in plugins for the few
cases we care about and stop setting or clearing IS_BOOTLOADER manually just to
get the vfuncs to be run.

Note: I do not think we want to use cleanup() for attaching devices not in
bootloader states -- as cleanup is only run at the end of the composite update.
2020-04-09 09:55:30 +01:00
Richard Hughes
508fb380d0 wacom-usb: Add more sanity checks in case the daemon goes crazy 2020-04-08 16:30:15 +01:00
Richard Hughes
385b3b29b4 wacom-usb: Use a per-device cleanup function
We never had this when the plugin was created and it makes bluetooth updates
without main firmware updates reboot the device correctly.
2020-04-08 16:30:15 +01:00
Richard Hughes
3fc550e9ed wacom-usb: Add a lot of missing metadata about the devices 2020-04-08 13:55:39 +01:00
Richard Hughes
46eefe72c1 wacom-usb: Hide a lot of debugging behind FWUPD_WACOM_VERBOSE 2020-04-08 13:55:39 +01:00
Richard Hughes
cddf5b5b89 Only auto-add counterpart GUIDs when required
Doing this unconditionally means we accidentally 'bleed' one device mode into
another in a non-obvious way. For instance, a device might have two operating
modes with different GUIDs. If firmware is supplied for both modes in the same
cabinet archive then we might accidentally match the 'wrong' firmware when
the daemon has observed a mode switch and added the counterpart GUIDs.

We only really need the counterpart GUIDs when switching between Jabra, 8bitdo
and DFU devices where the DFU bootloader VID:PID is not manually tagged with
`CounterpartGuid` in a quirk file. In the general case lets keep it simple to
avoid difficult to find bugs.
2020-04-08 13:55:39 +01:00
Ryan Lee
ac58360be7 ccgx: remove update message 2020-04-08 13:27:37 +01:00
Ryan Lee
d3fe478168 ccgx: add parent guid for hybrid dock 2020-04-08 09:09:54 +01:00
Richard Hughes
d38baba712 ccgx: Use a smaller timeout for i2c read and write operations 2020-04-07 19:50:43 +01:00
Richard Hughes
ebaa488b64 ccgx: Retry the register read and write with a i2c reset
Based on a patch by Ryan Lee <ryle@cypress.com>, many thanks.
2020-04-07 19:50:43 +01:00
Richard Hughes
2e0954f5c9 ccgx: Fix buffer overflow when reading out i2c status
Based on a patch by Ryan Lee <ryle@cypress.com>, many thanks.
2020-04-07 19:50:43 +01:00
Richard Hughes
1ae10f1016 Revert "ccgx: Reset the i2c bridge on status failure"
This reverts commit 49797d7de4.
2020-04-07 19:50:43 +01:00
Richard Hughes
5a7095dee4 ccgx: Retry the HID disconnect up to 5 times
Based on a patch by  Ryan Lee <ryle@cypress.com>, many thanks.
2020-04-07 19:50:43 +01:00
Richard Hughes
920713245d ccgx: Show a better error message on failure 2020-04-07 12:50:28 -05:00
Richard Hughes
481b01046b ccgx: Allow forcing firmware of the wrong app_type with fwupdtool
If we corrupt the flash, the app_type is 0x0 and we need to force this with a
known-good image to recover the hardware. Ask me how I know.
2020-04-07 18:43:31 +01:00
Ryan Lee
b9fecc4b9c ccgx: Fix critical warning on i2c write failure 2020-04-07 10:47:01 +01:00
Richard Hughes
9e755e2a5c logitech-hidpp: Do not add peripheral devices for receiver in BL mode
This should fix flashing firmware when there are >= 2 receivers plugged in.

Fixes https://github.com/fwupd/fwupd/issues/1951
2020-04-06 14:20:46 -05:00
Richard Hughes
ca03290a12 vli: Only reboot the USB hub once
The cleanup action for the FuVliUsbhubPdDevice is correct, but was not
conditionalized in the composite cleanup, which meant we would reboot twice
for a normal USB hub update.

Move the parent reboot into the right place, although this does mean we might
reboot twice in the rare event of scheduing a FuVliUsbhubPdDevice *and*
FuVliUsbhubDevice update in the same transaction -- but resetting the device
state between updates is arguably correct anyway...
2020-04-02 13:23:40 +01:00
Richard Hughes
2671aaceb2 synaptics-cxaudio: Only use the PATCH2 address when the patch level is 2 2020-04-02 13:23:16 +01:00
Ilya Guterman
257df03f58 add STM32F745 stm dfuse quirk 2020-04-02 13:22:53 +01:00
Richard Hughes
5af1dc69d4 dfu: Add a way to set the timeout from a quirk 2020-04-02 13:22:28 +01:00
Richard Hughes
b951a18fae ccgx: Do not add the HID device that will disconnect 2020-04-01 10:38:50 +01:00
ChangHee (Ryan) Lee
60103e2207 ccgx: Use Silicon ID and Application type to set flash parameters
Also remove unused instance id and fix application type matching as we now get
the image type from the quirk file.
2020-04-01 10:38:50 +01:00
Mario Limonciello
61f74077ed trivial: dfu: drop quirk to hide DW1820A
This can't actually damage the device, it was just showing the wrong flags.
The device is also EOL, so it won't even be seen on most modern machines.
2020-03-31 13:05:57 -05:00
Mario Limonciello
80d9b7450c logitech_hidpp: set the bootloader protocol 2020-03-31 13:05:42 -05:00
Richard Hughes
6fa43550fc vli: Wait for the VL103 to timeout to fix detach
The default re-enumeration delay is not sufficient.
2020-03-31 09:34:15 +01:00
Richard Hughes
61d9449d31 ccgx: Show the UpdateMessage in the correct device mode 2020-03-31 08:59:27 +01:00
Richard Hughes
be12af78f0 ccgx: Add extra instance IDs to match specific firmware
The VID:PID of the device in HPI mode is shared between multiple vendors, and
so we need to use both the silicon ID and the application ID to match specific
firmware updates.
2020-03-31 08:59:27 +01:00
Mario Limonciello
97acc2bf74 thunderbolt: Rather than hardcoding to PCI slot numbers, use domain in GUID
This allows the PCI topology to change, but assumes that thunderbolt host controllers
are enumerated in the same order every time.
It won't matter if the first controller jumped from bus 5 to 7 and consequently the
second from 65 to 71, but rather that the first was enumerated followed by the second.
2020-03-28 09:52:38 -05:00
Mario Limonciello
e6d76a594c Revert "thunderbolt: Create a unique GUID including Thunderbolt controller path"
This reverts commit 7e38dffdcb.
2020-03-28 09:52:38 -05:00
Richard Hughes
eb326f7546 dell-dock: Port to fu_device_retry() 2020-03-28 12:46:03 +00:00
Richard Hughes
461149e636 nitrokey: Convert to use FuHidDevice 2020-03-28 12:46:03 +00:00
Richard Hughes
355d5d545d nitrokey: Port to fu_device_retry() 2020-03-28 12:46:03 +00:00
Richard Hughes
a3740518b2 vli: Port to fu_device_retry() 2020-03-28 12:46:03 +00:00
Richard Hughes
49797d7de4 ccgx: Reset the i2c bridge on status failure 2020-03-28 12:46:03 +00:00
Richard Hughes
8e86b1ec4c trivial: Fix the ThinkPad USB-C Dock Gen2 audio device parent 2020-03-27 14:25:17 +00:00
Richard Hughes
5d787b5958 trivial: Set up the parent GUIDs for the Lenovo Gen2 Dock 2020-03-27 13:57:09 +00:00
Richard Hughes
81da69e73d ccgx: Implement writing firmware to flash
Correctly attach into the alternate mode after the update has completed.

The vendor was appending two files to make LVFS distribution 'easier' but I'd
much rather use the same deliverables as Windows. This also allows us to
simplify the firmware loading.
2020-03-27 13:25:40 +00:00
Changhee (Ryan) Lee
338f5a4083 ccgx: Add i2c status check when reading or writing registers
Signed-off-by: Richard Hughes <richard@hughsie.com>
2020-03-27 13:25:40 +00:00
Changhee (Ryan) Lee
064c5cce19 ccgx: Add 5ms delay between read registers to avoid an i2c error
Signed-off-by: Richard Hughes <richard@hughsie.com>
2020-03-27 13:25:40 +00:00
Richard Hughes
464eacdc53 libfwupdplugin: Use fu_device_locker_close() 2020-03-26 15:23:10 -05:00
Richard Hughes
d66a445ada synaptics-mst: Use fu_device_locker_close() 2020-03-26 15:23:10 -05:00
Richard Hughes
87d39d06a3 ccgx: Do not store the silicon ID in the image address
First, it's a hack; second we actually need to store the start address for
flashing FW2 on asymmetric hardware...
2020-03-24 21:16:08 +00:00
Richard Hughes
bf5481e358 ccgx: Add device quirks for the Lenovo Hybrid Dock 2020-03-24 21:16:08 +00:00
Richard Hughes
9278e265b4 ccgx: Switch HID mode to HPI mode at startup 2020-03-24 21:16:08 +00:00
Richard Hughes
dab6bda2be ccgx: Clear the event queue when in startup 2020-03-24 21:16:08 +00:00
Richard Hughes
fd7f13f905 ccgx: Wait for hardware to settle when coming out of reset 2020-03-24 21:16:08 +00:00
Richard Hughes
3990a71401 ccgx: Do not mark the device as updatable when in boot mode 2020-03-24 21:16:08 +00:00
Richard Hughes
c6147bf340 ccgx: Verify the firmware app type when preparing firmware 2020-03-24 21:16:08 +00:00
Richard Hughes
754d85e282 ccgx: Set the update message when running in backup firmware 2020-03-24 21:16:08 +00:00
Richard Hughes
de61d27259 ccgx: Read the FwAppType from the hardware 2020-03-24 21:16:08 +00:00
Richard Hughes
2b45362e25 ccgx: Set the HPI version number for the current firmware 2020-03-24 21:16:08 +00:00
Richard Hughes
c6a671be7e ccgx: Get the silicon ID to map the flash parameters 2020-03-24 21:16:08 +00:00
Richard Hughes
11fa0a1e90 ccgx: Read the HPI device mode at startup 2020-03-24 21:16:08 +00:00
Richard Hughes
0a37232ba1 ccgx: Set up the HPI I²C config at startup 2020-03-24 21:16:08 +00:00
Richard Hughes
69b761ce64 trivial: Export fu_device_add_instance_id_full() for plugins to use
Sometimes we only want to add the instance ID to get the quirk matches, and it
is confusing to see the "fake" IDs in the 'fwupdmgr get-devices' output.
2020-03-24 14:43:31 +00:00
Richard Hughes
cff23f798f trivial: Autodetect the HID interface to use 2020-03-24 08:34:16 -05:00
Richard Hughes
62aa46cb83 ccgx: Create devices when in HID and I2C modes 2020-03-23 20:02:17 +00:00
Richard Hughes
46963b1118 csr: Allow truncated HID reads
The device is allowed to return short buffers during read operation. This fixes
a regression introduced in c04f5a3.

Fixes https://github.com/fwupd/fwupd/issues/1893
2020-03-23 13:40:34 +00:00
Emily
5f3a2c0bc1 vli: Only consider the high nibble when building the sub-version 2020-03-23 08:11:14 +00:00
Richard Hughes
ded9fef4b6 csr: Parse the firmware as a DFU file
This was changed to Intel hex in 7afd7cba0d,
probbaly due to a copy-paste mistake. Change it back to DFU.

Fixes https://github.com/fwupd/fwupd/issues/1890
2020-03-22 11:46:40 -05:00
Richard Hughes
811e75db4b Add support for EP963x hardware 2020-03-22 15:48:04 +00:00
Richard Hughes
c04f5a3e15 Add FuHidDevice abstraction
Quite a few plugins use HID commands to communicate with the hardware. At the
mement we have ~6 implementations of SET_REPORT and are soon to add one more.

Move this into common code.
2020-03-19 17:02:07 +00:00
Richard Hughes
dd34e51711 trivial: Fix up some argument names with additional docs 2020-03-19 06:43:42 +00:00
Richard Hughes
ed07a17509 vli: Correctly attach VL103 after a firmware update
This works around a silicon errata which makes the existing 0xB0 chip reset
non-functional.

ALso, as VL10x and VL103 are so different now, use different `->attach()` and
`->detach()` implementations for code sanity.

Based on a patch by Sherlock Chu <SherlockChu@via-labs.com>, many thanks.
2020-03-19 06:43:42 +00:00
Richard Hughes
ac48c7f45a trivial: Add a GObject property for FuVliDevice::kind 2020-03-19 06:43:42 +00:00
Richard Hughes
48d9fb8f74 ccgx: Parse the metadata block in the firmware image 2020-03-18 18:57:06 +00:00
Richard Hughes
b258e514c5 ccgx: Add a firmare parser for cyacd files
These are visually similar to Intel hex files, but different enough to demand
their own parser. Multiple images can be stored in one firmware file, with the
`addr` set to the SiliconID and the `idx` set to the position in the file.
2020-03-18 18:57:06 +00:00
Mario Limonciello
c0f1f1c7e3 trivial: logitech-hidpp: decrease the verbosity of some debugging 2020-03-17 18:43:08 -05:00
Mario Limonciello
15cb61b34e trivial: logical-hidpp: fix some debugging messages not working 2020-03-17 18:43:08 -05:00
Mario Limonciello
c6ae0d998b logitech: Correctly set the protocol
Fixes updates on signed receivers.
2020-03-17 18:43:08 -05:00
Richard Hughes
252b0c704e vli: Remove a dock device from the whitelist that is never going to be updated
This is an old EOL dock that does not respond well to probing -- leading to an
occasional multi-second startup deadlock on startup.
2020-03-16 11:56:35 +00:00
Richard Hughes
3dadb99c6c vli: Add some trivial debugging to help track down a bug 2020-03-16 11:56:35 +00:00
Richard Hughes
bd5e6f00d2 vli: Never add USB hub devices that are not upgradable
There's almost no point; you can't interact with them in any meaningful way.
2020-03-16 11:56:35 +00:00
Mario Limonciello
7b866e5f92 uefi: Don't use shim for non-secure boot configurations
Since the entry is dynamically created this removes one area that
can potentially cause failures.
Helps: #1794
2020-03-16 06:55:05 -05:00
Richard Hughes
7825ae8dd1 dfu: Actually reload the DFU device after upgrade has completed
The m-stack DFU quirk also requires that we get the runtime status so that the
USB_DFU_SUCCESS_FUNC callback gets called. We were doing this by accident
before, and since switching to the FuDevice subclass this was dropped.

The dfu_device_refresh_and_clear() function is safe to call on a device which
does not have a working runtime interface.
2020-03-12 15:41:14 +00:00
Richard Hughes
fa41739ab0 dfu: Add one more m-stack device requiring a quirk 2020-03-11 16:10:10 +00:00
Richard Hughes
c3afed36d5 Allow waiting for the parent device when replugging
If a child device resets a parent device then we want to wait for the root
device, not the child.
2020-03-10 17:09:13 +00:00
Richard Hughes
4fb8693598 vli: Fix an error when detaching MSP430
The parent has to be opened and we need a longer delay before reading.
2020-03-10 15:12:09 +00:00
Richard Hughes
ff93d91f5a vli: Fix a critical warning when getting the USB speed 2020-03-10 15:09:43 +00:00
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