Commit Graph

9606 Commits

Author SHA1 Message Date
Mario Limonciello
eb7be16bf0 fu-util/fu-tool: Group devices in get-updates/update calls
Fixes: #1840
2020-07-03 11:58:34 -05:00
Richard Hughes
885faa4011 trivial: Require libjcat even when compiled with -Dbuild=library 2020-07-03 11:51:05 -05:00
Richard Hughes
57e9429ee9 trivial: Require libjcat even when compiled with -Dbuild=library 2020-07-03 15:48:24 +01:00
Richard Hughes
a852254d92 trivial: Hide the UEFI DBX parsing by default 2020-07-03 12:32:06 +01:00
Ryan Lee
62618bedb6 ccgx: add extra 45% removal time for worst case 2020-07-03 10:18:57 +01:00
Richard Hughes
6269a839eb Add a security attribute for BootGuard
This information is obtained from the MEI configuration space.
2020-07-02 20:25:48 +01:00
Richard Hughes
81a12a1b17 pci-mei: Split out the HFSTS registers
The register specifications have been taken as a superset of the coreboot
documentation as different flags were documented in more detail on various
different platforms.

Having this new data allows us to add future tests and make the current tests
much easier to understand.
2020-07-02 20:25:48 +01:00
Reto Kromer
2b0a329cf1 fix alignment (in the code) 2020-07-01 21:11:17 +01:00
Richard Hughes
b99df2ef93 Use the security attributes to construct a better name
Fixes https://github.com/fwupd/fwupd/issues/2184
2020-07-01 20:10:39 +01:00
Richard Hughes
1de98dcd72 mei: Add extra metadata to the security attributes 2020-07-01 20:10:39 +01:00
Richard Hughes
2adeb7688a mei: Store the family in the plugin data 2020-07-01 20:10:39 +01:00
Richard Hughes
7b57ce226b libfwupd: Allow storing metadata on the security attr 2020-07-01 20:10:39 +01:00
Richard Hughes
ec2a4b586f trivial: Move some code for future use 2020-07-01 20:10:39 +01:00
Richard Hughes
5c22406a18 libfwupd: Do not export non-introspectable symbols without a version
This is needed for future functionality.
2020-07-01 20:10:39 +01:00
Richard Hughes
dc805b41f1 trivial: Remove unused variables 2020-07-01 20:10:39 +01:00
Mario Limonciello
b1cf96abe1 trivial: acpi-dmar: lower missing DMAR table to debug
If the system is missing a DMAR table, users can find out from
`fwupdtool/fwupdmgr security`.  No need to actually warn in the logs
every single time.
2020-07-01 13:42:28 -05:00
Richard Hughes
d09cf101c3 Change all instances of master/slave to initiator/target
This makes perfect sense, because the 'initiator' starts the transaction and
the 'target' is the addressee of the transaction. Even the I²C spec defines the
'master' as 'initiating' the transaction.

This is the same nomenclature now used by the Glasgow project too.
2020-07-01 15:44:30 +01:00
Ryan Lee
7ebcd06ae4 ccgx: remove verify flag in plugin 2020-07-01 14:14:10 +01:00
Mario Limonciello
6a6029f132 uefi: disable plugin if efivar is not supported
Don't even try to coldplug the device.

Fixes: #2237
2020-06-30 13:55:33 -05:00
Mario Limonciello
89a11acdaa trivial: update various symbols to 1.4.5
See https://github.com/fwupd/fwupd/pull/2235 for details
2020-06-30 11:52:26 -05:00
Mario Limonciello
b3a22443d0 Add support for a delayed activation flow for Thunderbolt
This allows delaying the activation of Thunderbolt firmware until
shutdown/reboot or when the dock is unplugged.

This functionality requires features in the kernel:
https://lore.kernel.org/linux-usb/20200622143035.25327-1-mario.limonciello@dell.com/T/#t

Matrix of cases to support:

* Distro Old Linux kernel (doesn't support authenticate on disconnect)

  - WD19TB: Should have `skips-restart` flag set
    No flush or activate features called in `thunderbolt` plugin.
    `dell_dock` plugin will activate at end of composite update

  - All other devices: Shouldn't have flags set
    Should authenticate in Thunderbolt plugin.
    `1 > nvm_authenticate`

* Distro New Linux kernel (supports authenticate on disconnect)

  - WD19TB: Should have `usable-during-update` flag set but not `skips-restart`
    Should flush image to SPI in `thunderbolt` plugin
    `2 > nvm_authenticate_on_disconnect`
    Should configure TBT device for authenticate on disconnect
    `1 > nvm_authenticate_on_disconnect`
    `dell_dock` plugin will configure dock for authenticate on disconnect

  - All other devices: Shouldn't have flags set
    Should authenticate in `thunderbolt` plugin.
    `1 > nvm_authenticate`

* ChromeOS (supports authenticate on disconnect)

  - `thunerbolt.conf` will have `DelayedActivation=true`.

  - WD19TB: Should have `usable-during-update` flag set but not `skips-restart`
    Should flush image to SPI in `thunderbolt` plugin
    `2 > nvm_authenticate_on_disconnect`
    Should configure device for authenticate on disconnect
    `1 > nvm_authenticate_on_disconnect`
    `dell_dock` plugin will configure dock for authenticate on disconnect

  - All other devices: Should have both `usable-during-update` and `skips-restart` set
    Should flush image to SPI in `thunderbolt` plugin
    `2 > nvm_authenticate`
    Will activate upon logout/shutdown/reboot
    `1 > nvm_authenticate`
2020-06-30 11:52:14 -05:00
Mario Limonciello
6bd1c56294 Introduce a new flag skips-restart
This flag is used internally by plugins to indicate that they will
skip the phase of firmware installation that power cycles a device.

It is intended to be set by quirks or other environment settings.

Note: changed 1.5.0 introducing to 1.4.5.
2020-06-30 11:52:14 -05:00
Mario Limonciello
9d2a4900be trivial: thunderbolt: don't set update error for missing nvmem
Trying to explain why ICL thunderbolt isn't updatable doesn't help
people.  It just causes fwupdmgr and fwupdtool to show the device
front and center with a confusing message.

Instead don't populate the message and by the default device filter
it will be hidden.

See #2212 for background.
2020-06-30 11:52:14 -05:00
Mario Limonciello
4f1c6eec16 thunderbolt: Add a new subclassed thunderbolt firmware update type
Thunderbolt images brought in from the SPI don't have a FARB header.
Thunderbolt update images do.

So these two types of images need to be handled separately from the
firmware parser.
2020-06-30 11:52:14 -05:00
Mario Limonciello
9c6d5b86ea thunderbolt: Allow quirks to skip the authentication step
This will allow being able to PoC some future kernel work to split
up steps.
2020-06-30 11:52:14 -05:00
Mario Limonciello
0e411717b0 thunderbolt: drop support for force power
The kernel interface for force power doesn't support tracking the state
of the device, and so this had to be tracked by fwupd.

Unfortunately due to system and thunderbolt controller firmware behavior
on some systems the thunderbolt controller /still/ didn't return even
when force power state was accurately tracked.

The device model for the uevent related to the device removal being ignored
doesn't really fit into the current fwupd architecture anymore either.

Lastly this is a very legacy feature at this point.  Thunderbolt3 controllers
distributed in the last 3 years all operate in 'native' mode meaning that
they will always be powered and use runtime power management.

USB4 controllers won't have a concept of being force powered.
USB4 reimers will have this concept, but the state will be tracked by the
kernel and obfuscated from userspace.

So with all that said, tear out all of the force power related code.
2020-06-30 11:52:14 -05:00
Mario Limonciello
22092678fd Modernize the thunderbolt plugin.
Remove it's references to it's own GUdevclient and instead use
FuUdevDevice.

Some intentional casualties of the move:
* Plugin metadata around native and safe mode dropped.
  - These haven't been useful in debugging anything and aren't relevant
    on new hardware
* Extra GUID for 2 host controllers in same system dropped
  - Although this was normally static information BIOS operations like
    turning off PCI-E SD card reader or LAN controller changed things.
* The NVM version is parsed directly instead of through gudev to prevent
  cached data breaking change events.

Remaining TODO:
* Force power w/ thunderbolt-power doesn't work
2020-06-30 11:52:14 -05:00
Mario Limonciello
0089a1c20c Revert "thunderbolt/dell-dock: Delay activation for Thunderbolt updates"
This reverts commit 5bc92096d4.
2020-06-30 11:52:14 -05:00
Mario Limonciello
5955a1bbc1 fu-plugin: add a new udev_device_changed function that calls rescan 2020-06-30 11:52:14 -05:00
Mario Limonciello
2f50977cd9 trivial: libfwupdplugin: add a new method to write strings to sysfs files 2020-06-30 11:52:14 -05:00
Richard Hughes
e23adf321c Allow multi-byte FuUdevDevice preads and writes 2020-06-30 11:52:14 -05:00
Mario Limonciello
36c04a415a fu-udev-device: add fu_udev_device_get_parent_name
This will fetch the name from parent device

Note: updated for 1.4.5 when backporting
2020-06-30 11:52:14 -05:00
Mario Limonciello
7074a106aa fu-udev-device: Add support for reading arbitrary sysfs attributes
Some devices provide 'non-standard' attributes that are relevant
for use.

Note: updated for 1.4.5 when backporting
2020-06-30 11:52:14 -05:00
Richard Hughes
85226fd9d1 Remove potentially problematic language
Red Hat wants to drive an initiative in correcting problematic and potentially
divisive language in open source projects. These naming conventions and
descriptive phrases are hurtful and offensive to many of our colleagues across
the open source universe.

See https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language
2020-06-30 17:31:17 +01:00
Mario Limonciello
e359824e3a trivial: convert log warnings to ASCII
Fixes: #2234
2020-06-30 10:47:05 -05:00
Mario Limonciello
4b69830e1c trivial: minor optimization for no timestamp case 2020-06-30 10:46:49 -05:00
Mario Limonciello
eaf7f0b529 trivial: convert log warnings to ASCII
Fixes: #2234
2020-06-30 10:46:49 -05:00
Mario Limonciello
8c78c13446 trivial: fu-engine: return firmware gtypes in a sorted list
This makes the output in `firmware-parse` more predictable
2020-06-29 18:45:28 +01:00
Richard Hughes
f3c8fe926c Check all AppStream components when verifying
Additionally, ignore the 'not found' error codes so we drop down to the release
missing error.

Fixes https://github.com/fwupd/fwupd/issues/2196
2020-06-29 18:43:43 +01:00
Richard Hughes
6beb0d3f5e Disable the SQLite lookaside cache
This saves ~45Kb of RSS and has no measurable slowdown when reading from the
pending database.
2020-06-29 18:43:22 +01:00
Richard Hughes
77a9326ed7 vli: Set the i2c instance IDs in probe()
They do not need to query the device, so ->setup() is not required.
2020-06-29 18:42:49 +01:00
Richard Hughes
20b5b447d2 vli: Wait for the root device to be replugged when updating the MSP430
The MSP device is a virtual child of the USB hub.
2020-06-29 18:42:39 +01:00
Richard Hughes
d9f38e9641 vli: Do not use GUID matching for the MSP device
Not strictly required, but it makes the FuDeviceList operation much simpler.
2020-06-29 18:42:32 +01:00
Richard Hughes
5593346448 vli: Use the GPIOB reset for the MiniDock VL103 2020-06-29 18:42:15 +01:00
Richard Hughes
0bb0b8e087 vli: Set FuQuirks on the shared SPI object 2020-06-29 18:42:08 +01:00
Richard Hughes
3a0060c94b vli: Add the project ID shared SPI PD controllers
The Mini-Dock and Travel-Hub accidentally share the same VID:PID and this is the
only way to tell them apart.
2020-06-29 18:42:00 +01:00
Richard Hughes
1128d8b739 vli: Allow chained usb hub devices where the parent needs GPIOB reset
As both hub devices share a FuVliUsbhubDeviceClass instance we cannot 'hijack'
the vfuncs depending on object type. This allows the downstream hub to proxy to
the upstream hub where a GPIOB reset can be performed.
2020-06-29 18:41:50 +01:00
Richard Hughes
9890df352f vli: Do not modify the class vfuncs depending on device type
We can have multiple FuVliPdDevice objects registered with the daemon, but they
will all share the FuVliPdDeviceClass instance. If one device requries a
silicon workaround, do not 'hijack' the vfunc for all devices of this type.

This means we do the right thing when updating both the one that requires the
workaround, and the 'normal' one.
2020-06-29 18:41:43 +01:00
Richard Hughes
8510b014ca Add XB_QUERY_FLAG_FORCE_NODE_CACHE
Newer versions of libxmlb do not auto-cache XbNodes, and we have to opt-into
this beahviour for the _set_data() and _get_data() to work.

Although this is a behaviour change which also increases complexity, it lowers
our RSS usage by 200kB which is about a quarter of the total RSS used...
2020-06-29 18:37:26 +01:00
Richard Hughes
de3b0c1b17 Allow firmware to require specific features from front-end clients
At the moment we just blindly assume the capabilities of the front-end client
when installing firmware. We can somewhat work around by requiring a new enough
fwupd daemon version, but the client software may be older or just incomplete.

This would allow, for instance, the firmware to specify that it requries the
client to be able to show a detach image. This would not be set by a command
line tool using FwupdClient, but would be set by a GUI client that is capable
of downloading a URL and showing a PNG image.

Clients that do not register features are assumed to be dumb.
2020-06-29 18:32:45 +01:00