Commit Graph

56 Commits

Author SHA1 Message Date
Richard Hughes
0abba6cbb0 ata: A OUI quirk for Kingston
Fixes https://github.com/fwupd/fwupd/issues/2121
2020-05-21 11:16:08 +01:00
HROMANO
7180536c69 Add two OUI quirks
Two OUI quirks outputed by 'fwupdtool get-updates' on my computer.
2020-05-14 15:19:54 -05:00
Michael
9d07b7c23c ata: Add WD OUI quirk 000cca 2020-05-14 13:21:20 -05:00
Subhendu Ghosh
d1d83c083e ata: Add OUI quirk for Western Digital 2020-05-11 08:15:43 +01:00
Jakob
f4b843db43 Add OUI quirk for SanDisk 2020-05-02 08:51:53 +01:00
jf049
f0a3bf0436 trivial: Add OUI quirk for ADATA 2020-04-23 06:47:19 +01:00
Daniel Peukert
3cebd5aa89 trivial: Add OUI quirk for LITE-ON 2020-04-22 12:43:39 -05:00
Daniel Peukert
8a4b32f699 trivial: Reorder OUI quirks by OUI ID 2020-04-22 12:43:39 -05:00
Richard Hughes
cacf14e54f trivial: Add OUI quirk for Toshiba 2020-04-17 18:48:35 +01: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
Tilmann Meyer
9f137339e9 ata: Add OUI quirk for Western Digital and Intel 2020-03-04 19:29:36 +00:00
Richard Hughes
9e54fc595a ata: Add trivial OUI quirk for Micron 2020-03-02 13:58:38 +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
1afe177696 trivial: add an OUI quirk for a seagate disk 2020-02-24 17:16:20 +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
0cc22a5ff6 trivial: Document the use of vendor-id in each plugin 2019-12-11 18:10:44 +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
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
Mario Limonciello
6b0e66354b Convert libfwupdprivate to a shared library libfwupdplugin 2019-11-27 11:32:43 +00: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
8a3ab68fcb ata: Support delayed activation
This will allow us to switch to the new firmware version during shutdown when
the filesystems have been remounted readonly.

Activating manually means we don't have to get the user to shutdown and then
do a fresh power-on, rather than the more usual restart.
2019-02-27 09:04:54 +00:00
Richard Hughes
bfd946e463 Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
Mario Limonciello
eb8b38f158 trivial: storage: Update minimum Dell component ID length to 6
Dell storage team confirmed that nothing shorter than 6 will ever
be used and so this heuristic can be stronger.
2019-02-08 16:06:14 +00:00
Richard Hughes
6b78d64987 Add fwupd_guid_from_string() to drop dep on uuid
This also allows us to write mixed-endian structures and adds tests. As part of
this commit we've also changed the API of something that's not yet been in any
tarball release, so no pitchforks please.
2019-02-06 14:48:04 +00:00
Richard Hughes
1bc432316a Defer the InstanceID->GUID hashing until after setup
This allows hardware from OEMs to *not* match generic firmware supplied by the
device manufacturer. The idea being, that the OEM will supply firmware that
will actually work on the device.

Based on a patch from Mario Limonciello, many thanks.
2019-02-06 08:02:16 +00:00
Mario Limonciello
2472e45ac6 ata: Check for USB enclosures as well
I noticed that a SATA drive connected to an USB2.x to ATA bridge was
recognized as internal otherwise.
2019-02-05 20:29:26 +00:00
Richard Hughes
b8c30b8732 Do not use efivar just to print a mixed endian GUID 2019-02-04 15:19:57 +00:00