Commit Graph

4304 Commits

Author SHA1 Message Date
Richard Hughes
b106542aef trivial: Fix a potential crash when using FuPlugin in the self tests 2019-08-15 16:50:44 +01: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
c521ab94be Do not use FuDevice metadata for the physical and logical IDs
This allows us to print it nicely in the ->to_string() vfunc.
2019-08-14 16:48: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
cea28dea96 Add a ->to_string() vfunc to FuFirmware
This allows firmware to add to the existing image output and will be used for
future firmware types.
2019-08-09 15:54:25 +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
747f570310 Allow filtering devices when using the command line tools 2019-08-06 20:59:28 +01:00
Richard Hughes
d59075bbf8 Be more accepting when trying to recover a failed database migration
Fixes https://github.com/hughsie/fwupd/issues/1196
2019-08-06 11:10:44 -05:00
Richard Hughes
011511e42f trivial: Add translation for X-ThunderboltController 2019-08-06 15:46:58 +01:00
Mario Limonciello
dc6577c8b8 trivial: fixup standalone installer
There were some logic failures in the handling of pre-installed version
that were reported on the mailing list.
2019-08-06 09:58:26 +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
Mario Limonciello
fd734856d2 fu-tool: Port ability to update a single device from fwupdmgr 2019-08-02 09:33:15 -05: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
4836cb360e Verify we don't break the ABI
This adds a script which can check for ABI breaks between two Git
revisions:

    $ ./contrib/ci/check-abi.sh

The CI is set up to run it automatically between the tip of the branch
being tested and the last release tag.

Based on the work by Mathieu Bridon <bochecha@daitauha.fr>, many thanks.
2019-08-01 10:47:49 -05: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
Richard Hughes
b4627629cd Relax the certificate time checks in the self tests for the legacy certificate
One test verifies a firmware with a signature from the old LVFS which was
hosted on secure-lvfs.rhcloud.com and used the original PKCS-7 key. This key
had a two year validity (expiring today, ohh the naivety...) rather than the
newer fwupd.org key which expires in the year 2058.

For this specific test only, disable the certificate time checks to fix CI.

Fixes https://github.com/hughsie/fwupd/issues/1264
2019-08-01 10:09:58 +01:00
Mario Limonciello
00aabbf78b trivial: add cache directory into systemd unit rw paths 2019-08-01 07:50:02 +01:00
Richard Hughes
7565baf3c0 Never show AppStream markup on the console 2019-07-31 16:34:02 +01:00
Richard Hughes
596d593cdd Do not segfault when trying to quit the downgrade selection 2019-07-31 16:05:58 +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
Richard Hughes
f5c15354e5 trivial: Allow a device to *clear* a firmware version
This can be used, for instance, when doing klass_usb_device->probe() to prevent
the bcdVersion from overwriting a previously set runtime version.
2019-07-30 16:16:14 +01:00
Mario Limonciello
09700bbce8 trivial: debian: For signed package fill out Built-Using (Closes: #932757) 2019-07-22 15:23:56 -05:00
Richard Hughes
aaf0ce788f Allow specifying <firmware>GUID</firmware> to check any version exists
If the version is not specified then treat it as just 'exists'.
2019-07-16 18:27:52 +01:00
Richard Hughes
7b32e5f01f trivial: post release version bump 2019-07-15 19:28:15 +01:00
Richard Hughes
80e02dfe21 Release fwupd 1.2.10 2019-07-15 19:25:54 +01:00
Richard Hughes
762a36a515 Disable the flashrom plugin by default
When upstream libflashrom contains all the required API upstream we can build
this by default.
2019-07-15 10:37:34 -07: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
Mario Limonciello
05c5c101ec fu-util: When unlocking prompt for reboot if applicable 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
55d46a6f4a fu-util: Show devices with an UpdateError in get-devices output 2019-07-11 09:33:23 -07:00
Mario Limonciello
e219a994dd trivial: uefi: use UEFI-dummy for device ID instead of just uefi 2019-07-11 09:33:23 -07:00