Commit Graph

4635 Commits

Author SHA1 Message Date
mendel5
75810207dc flag_require_ac: System requires external power source 2020-09-20 12:08:52 -05:00
mendel5
f75ff42613 flag_require_ac: System requires external power source 2020-09-20 12:08:52 -05:00
mendel5
923d01b840 flag_require_ac: System requires external power source 2020-09-20 12:08:52 -05:00
Richard Hughes
0d37a9a93a bios: Only warn about CSM when using i?86 or x86_64
We're telling people on PPC64 to switch to UEFI mode...
2020-09-18 13:57:36 +01:00
Richard Hughes
6da96cd04a Add FuFirmwareFlags to allow opt-in dedupe of added images
The function fu_firmware_add_image() has the comment text 'If an image with the
same ID is present it is replaced' which has not been true for some time.

This was removed, as the common case of adding two images with no ID would only
leave one. However, some plugins do actually want to dedupe on the ID or IDX,
so provide a flag they can set which enables this functionality without
introducing regressions into other plugins.
2020-09-17 20:49:01 +01:00
Mario Limonciello
fbd3508655 trivial: correct some documentation typos 2020-09-17 13:51:59 -05:00
Richard Hughes
0038b4a780 Allow plugins to match using the SUBSYS IDs
This is the same format specified by Microsoft in "Identifiers for PCI Devices"
https://docs.microsoft.com/en-us/windows-hardware/drivers/install/identifiers-for-pci-devices
2020-09-17 15:25:26 +01:00
Mario Limonciello
88f0d422ec uefi: correct a logic error in TPM PCR reading (Fixes: #2382)
069449e tried to avoid issues with all zero TPM PCR's, but caused
a problem with any byte was zero.
2020-09-15 14:38:52 -05:00
Mario Limonciello
7fc7da3999 thunderbolt: set install parent first flag for WD19TB
This is only applicable for kernel 5.9 or kernels that backported
the authenticate on disconnect patches.

For installation time this isn't very important since no device will
restart.  This also isn't relevant for the authenticate on disconnect
scenario.
However the manual activation scenario, it's important to activate the
WD19TB device first, followed by Thunderbolt.
2020-09-14 11:28:55 -05:00
Mario Limonciello
0f057d227b thunderbolt: if calling activate always use nvm_authenticate (#2374)
This will force the update to complete on logout or shutdown
2020-09-14 11:28:55 -05:00
Mario Limonciello
02085a0371 trivial: rework fwupdtool activate
Only use the history database to tell if activation should be run.
Instead query the connected devices to find the ones needing activation.

This should allow non-connected devices to not cause a failure (although
it might be a longer shutdown).

Also sort the devices, so that the order follows the defined order from
the daemon and they activate in the same order they install.
2020-09-14 11:28:55 -05:00
Richard Hughes
32173430d4 elantp: Only match the I2C adaptor on the correct laptop model
I2C doesn't have any specification for what is a probe and what is a more
destructive action. Sending tx_buf out on the i2c bus to a generic address
might not be safe in all cases.

To prevent this, use a HWID to check the machine DMI value during device
creation before ->probe() or ->setup() is called on the device.
2020-09-14 16:19:45 +01:00
Richard Hughes
ad32b0c17e elaptp: Allow recovery when the HID firmware fails to load 2020-09-14 16:19:45 +01:00
Richard Hughes
1d633a58fe trivial: Show the device GType when deduping
This allows us to make sense of the case where the same plugin has multiple
possible GTypes.
2020-09-14 16:19:45 +01:00
Richard Hughes
a06a480904 trivial: Allow using fu_udev_device_pread_full() at offset zero
Do not enforce the port is nonzero when reading and writing to a device.
2020-09-14 16:19:45 +01:00
Richard Hughes
13bae744be platform-integrity: Use the BCR values provided by the kernel class
This requires the new kernel driver by Daniel Gutson.
2020-09-14 16:18:12 +01:00
Richard Hughes
81f9552095 Correctly order devices when using logical parents
If the device parent is added using fu_device_add_parent_guid() or ParentGuid
from a quirk file then the child is not returned in fu_device_get_children() by
design as the physical ID will be likely different.

This means we cannot reliably 'depsolve' the order in FuDevice as we need the
full list of devices that might be parents. The existing algorithm had several
logical problems when dealing with more than a single parent and child.

The FuDeviceList object is the right place to do this as it knows about all
added devices on the system.

This means the addition of a logical device causes the root logical device
(and all it's children, and grandchildren) to be re-ordered. This allows
firmware on deeply nested composite devices like hubs to be installed in the
correct order.
2020-09-14 10:13:33 -05:00
Richard Hughes
b7fbb07dcb trivial: Convert the device order to an unsigned int
This allows us to set the parent of an existing parent without wrapping.
2020-09-14 10:13:33 -05:00
Richard Hughes
a1ebcbf743 trivial: Add back the hidden --plugin-whitelist option
It is essentially part of our 'CLI API' and we have to support people using the
old name.
2020-09-14 09:58:46 -05:00
Richard Hughes
5c82b94322 Do not show HSI obsoleted attributes by default
When one result is obsoleted by another, then do not show the old result by
default.

Additionally hide the HSI URLs as this was designed more for GUI clients like
gnome-firmware than CLI tools such as fwupdmgr.
2020-09-14 09:58:46 -05:00
Mario Limonciello
6a1a49eaef dell-dock: mirror updatable flag into thunderbolt
This makes sure that if an update is pending (as stored in the EC), Thunderbolt
won't show in a needing update state again.

Fixes: #2374
2020-09-11 14:08:32 -05:00
Mario Limonciello
258177472f trivial: debian/rules: disable flashrom for ia64 2020-09-11 13:58:11 -05:00
Mario Limonciello
76cc23c736 thunderbolt: make sure that authorized to add updatable flag
If the device is not authorized, it may cause a composite update that it's part
of to not behave properly.

If device is authorized at runtime, add updatable flag at runtime as well
See #2374 for more details
2020-09-11 13:15:51 -05:00
Mario Limonciello
c756405529 trivial: thunderbolt: fixup retimer setting physical ID twice
Only needs to be set once in probe.
2020-09-11 13:15:51 -05:00
Mario Limonciello
6d0c4897e1 fu-udev-device: call rescan on the device for change events
This allows calling the correct method, and instead doesn't have
all the plugins try to process the event when they're missing
vfuncs
2020-09-11 13:15:51 -05:00
Mario Limonciello
6d23514fb1 Revert "fu-plugin: add a new udev_device_changed function that calls rescan"
This reverts commit 096e3cfbb6.
2020-09-11 13:15:51 -05:00
Mario Limonciello
eb4472a479 trivial: debian: add udisks2 to recommends
(Closes: #970054)
2020-09-10 17:31:10 -05:00
Jochen Sprickerhof
25b78a6870 Check returned volumes before accessing them
Without udisks2 installed the list of volumes is empty and fwupdtool
esp-list segfaults.
2020-09-10 17:29:35 -05:00
Mario Limonciello
4550cf51f8 trivial: stop creating sysfs-path metadata
This isn't needed anymore, it was only for legacy thunderbolt3 controllers
that didn't support native enumeration.
2020-09-10 12:42:14 -05:00
Mario Limonciello
64f3857751 thunderbolt: ignore non-updatable host controller (Fixes: #2373)
nvm_version will not export in Intel USB4 host controller running in
SW CM, there is no point in fwupd displaying a device for it.
2020-09-10 12:42:14 -05:00
Richard Hughes
8541a874f0 synaptics-cxaudio: Fix the topology of the audio device on the TR dock
This ensures we perform the updates in this order:

* cxaudio
* vli
* thunderbolt

As any other order causes enumeration failures.

Fixes some of https://github.com/fwupd/fwupd/issues/2377
2020-09-10 17:14:08 +01:00
Daniel Campello
0b74e2c91a thunderbolt: Call fu_device_set_physical_id() during probe for retimer
Error will show up if (priv->physical_id == NULL) on
fu_device_ensure_id(). This method is called after probe but before
setup on fu_device_open.

Call fu_device_set_physical_id() on fu_thunderbolt_device_probe()
for the retimer case.

Fixes https://github.com/fwupd/fwupd/issues/2371

Change-Id: I0e462fff5e8abf6073318f6424b6736afc8259b8
2020-09-09 17:33:18 -05:00
Richard Hughes
8c200a9e41 cpu: Correct the BCR address for Atom Bay Trail 2020-09-09 20:18:32 +01:00
Richard Hughes
db344d5a40 trivial: Fix several small memory leaks discovered with valgrind 2020-09-09 14:16:49 -05:00
Richard Hughes
50ff31de56 Fix memory unsafety when using fu_engine_get_remotes()
When using fwupdtool that runs a mainloop we can get into the state where the
inotify watch fires on the remote directory as we're iterating on the list of
remotes.

This corrupts the list and we start reading freed objects. Return a deep copy
so we can safely update each remote.
2020-09-09 14:16:49 -05:00
Richard Hughes
fb6315f1c6 trivial: Show the failing remote when using 'fwupdtool refresh' 2020-09-09 14:16:49 -05:00
Richard Hughes
49b911f094 nvme: Do not dedupe NVMe devices
Fixes https://github.com/fwupd/fwupd/issues/2366
2020-09-09 16:27:16 +01:00
Richard Hughes
af53a4fc22 vli: Do not dedupe USB hub PD devices
This object derives from FuDevice rather than FuVliDevice and so does not
inherit the NO_GUID_MATCHING flag like other devices.

Fixes https://github.com/fwupd/fwupd/issues/2364
2020-09-09 16:27:16 +01:00
Mario Limonciello
110eb286bc Make TPM more optional (Fixes: #2360)
- Rename the `plugin_tpm` option to `tpm` and when it's disabled
remove TPM support from all plugins
- If enabled then require the TSS to be installed
2020-09-08 15:16:58 -05:00
Richard Hughes
d19aff3df1 mei: Do not attempt to parse HFSTS6 when using TXT
It seems the MEI parameters are not set for platforms such as Apollo Lake.
The only bit set was FPF_SOC_LOCK, with the others all cleared to zero.

Fixes https://github.com/fwupd/fwupd/issues/2335 for a peculiar definition of 'fix'.
2020-09-08 17:05:02 +01:00
Richard Hughes
45fbc50f8d mei: Document some more of HFSTS6 2020-09-08 17:05:02 +01:00
Richard Hughes
9b688d0b73 trivial: Set FWUPD_STATUS_DECOMPRESSING when preparing firmware
This avoids the plugins forgetting to do it themselves.
2020-09-08 14:18:46 +01:00
Richard Hughes
fbe3304420 trivial: Remove the anti-pattern where plugins check the firmware size
This is already done in fu_device_prepare_firmware() and so is completely
redundant.
2020-09-08 14:18:46 +01:00
Richard Hughes
581aa3c0be elantp: Support more hardware types
Read the pattern from the hardware rather than hardcoding and support bigger
page sizes for later hardware versions.
2020-09-07 20:46:52 +01:00
Jerry Zhang
ae7563d7d7 dfu: Allow device to attach to normal without a bus reset
As described in DFU protocol (7. Manifestation Phase), after the
firmware reprogramming is done, if bitWillDetach = 1, it doesn't
require the host to issue a USB bus reset, but the device can
generate a detach-attach sequence itself to go back to normal.

Add a quirk flag "no-bus-reset-attach" to skip the bus reset in
dfu_device_attach(), and increase the "RemoveDelay" as well.
2020-09-04 17:52:00 +01:00
Richard Hughes
2506dbff6f trivial: Use the same indent size when appending key values 2020-09-03 16:50:41 +01:00
Richard Hughes
9a07407401 Use the FuUdevDevice ->to_string() output
Print the sysfs path for devices deriving from FuUdevDevice, which also allows
us to use FU_UDEV_DEVICE_DEBUG without monkey-patching the plugins that also
define a device_class->to_string() vfunc.
2020-09-03 16:50:41 +01:00
Richard Hughes
ecb4d1416d trivial: Only use FU_UDEV_DEVICE_FLAG_VENDOR_FROM_PARENT as a fallback
If the device node actually provides a vendor string, always use that before
falling back. The flag was initially designed to fall back in the event the NVMe
device does not declare a valid sysfs vendor ID.
2020-09-03 16:50:41 +01:00
Richard Hughes
82f9a85201 Fall back from ID_VENDOR_FROM_DATABASE to ID_VENDOR for NVMe devices 2020-09-03 16:50:41 +01:00
Richard Hughes
7c8a830659 libfwupd: Add async versions of the library for GUI tools
Rather than force the GUI to interact with fwupd using threads, provide
async versions so thay can be run without blocking the UI thread.
2020-09-03 15:46:57 +01:00