Commit Graph

5410 Commits

Author SHA1 Message Date
Richard Hughes
1981c63d58 Remove FuFirmwareImage and just use FuFirmware instead
This allows us to 'nest' firmware formats, and removes a ton of duplication.

The aim here is to deprecate FuFirmwareImage -- it's almost always acting
as a 'child' FuFirmware instance, and even copies most of the vfuncs to allow
custom types. If I'm struggling to work out what should be a FuFirmware and
what should be a FuFirmwareImage then a plugin author has no hope.

For simple payloads we were adding bytes into an image and then the image into
a firmware. This gets really messy when most plugins are treating the FuFirmware
*as* the binary firmware file.

The GBytes saved in the FuFirmware would be considered the payload with the
aim of not using FuFirmwareImage in the single-image case.
2021-03-09 21:14:12 +00:00
Richard Hughes
2d84386034 Remove unused, unsafe and deprecated functions from libfwupdplugin
Keeping *internal* API and ABI compatibility makes working with an already
complex codebase more mentally demanding than it needs to be.

Remember: plugins should be in-tree and upstream! If your out of tree plugin
stops working then it should be upstream.

The public-facing libfwupd will remain API and ABI stable for obvious reasons.
2021-03-09 15:47:56 +00:00
Richard Hughes
aaf74006da trivial: Fix up the Since tags for FuIfd
This was not included in the 1_5_X branch.
2021-03-09 15:35:29 +00:00
Richard Hughes
2e629313bf trivial: post branch version bump 2021-03-09 15:35:29 +00:00
Mario Limonciello
dfbb549f1e trivial: dell-dock: Save the base type in private structure
This may be used in the future for other expansion and determination.
2021-03-09 09:09:57 +00:00
Gary Lin
b283395049 uefi-capsule: Specify the section flags for .sbat
When using "objcopy -O binary" to generate AArch64 EFI images, it
silently drops the sections without "alloc" or "load" or the sections
with "unload", and this caused the content of .sbat was skipped in the
final EFI image.

This commit sets the common read-only data section flags to .sbat to
make sure the content will be copied.

Signed-off-by: Gary Lin <glin@suse.com>
2021-03-09 09:09:24 +00:00
Richard Hughes
f2849d24cc Add missing uint64 read and write helpers 2021-03-05 19:34:54 +00:00
Richard Hughes
c8d0afe33d logitech-hidpp: Use fu_device_set_battery_level() 2021-03-05 12:27:10 +00:00
Richard Hughes
a76a0da7aa Add fu_device_set_battery_level()
We want to make it as easy as possible for devices to refuse to update on low
battery, as this will likely be one of the WWCB requirements.

Ideally devices will check the battery level inside the firmware, but by also
providing the battery level to fwupd we can give the user a warning *before*
the update has started and without switching the device into bootloader mode.
2021-03-05 12:27:10 +00:00
Sean-StarLabs
2bd7b62ee9
Correct L3 GUID (#2979) 2021-03-05 11:49:29 +00:00
Richard Hughes
9024112549 ccgx: Allow ignoring CCGX firmware checksum failures
This much improves fuzzing performance.
2021-03-05 11:37:46 +00:00
JimmyYu
6d45136c25 pixart: Filter the wrong report ID 2021-03-05 12:19:33 +01:00
Richard Hughes
e19ebe7177 Add an Intel Flash Descriptor parser 2021-03-05 10:51:34 +00:00
Richard Hughes
56af6f21e9 elantp: Write the firmware in a slightly safer way 2021-03-05 09:47:38 +00:00
Richard Hughes
dd5f6247bc trivial: Remove unused source file 2021-03-05 09:42:27 +00:00
Richard Hughes
32ffdb2677 Add helper API to write in a safer way 2021-03-05 09:34:18 +00:00
Sean Rhodes
247f29ad47 Updated StarLabs guids 2021-03-04 17:56:43 +00:00
Mario Limonciello
5a832194f4 trivial: ci: fix windows build 2021-03-04 10:45:10 -06:00
Norbert Kamiński
6c8417b5af libxmlb.wrap: Bump revision
Newer revision of the libxmlb solves wrong
MIME type problem at FreeBSD.

Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
2021-03-04 09:10:16 +00:00
Richard Hughes
a6784611e4 superio: Ensure quirks are set on the new devices
Fixes a regression in 79a217a2a6
2021-03-03 18:15:16 +00:00
David Chiu
5abbb85e58 synaptics-rmi: Fix firmware update of pointing device on Lenovo ThinkPad Nano 2021-03-03 16:07:05 +00:00
Richard Hughes
2659ba596e elantp: Require a reboot for i2c recovery write
ChromeOS reboots the i2c adapter but it's probably safer to just reboot:
648c32ee9b/etphidiap/scripts/chromeos-etphidiap-touch-firmware-update-legacy.sh (198)
2021-03-03 15:56:18 +00:00
Richard Hughes
78a1b18a93 elantp: Verify the firmware signature before flashing 2021-03-03 15:56:18 +00:00
Richard Hughes
0772c46e9f elantp: Only call ->detach() when writing a firmware blob
The detach is actually destructive (!) and cannot be reattached unless actually
writing a new firmware image.
2021-03-03 15:56:18 +00:00
Richard Hughes
c9d6fecc5e pixart: Workaround a HIDIOCGFEATURE bug and/or regression
We're still in the process of hunting for the real cause.
2021-03-03 15:36:42 +00:00
Richard Hughes
bf3732f994 pixart: Use the bluetooth UUID to set the logical ID
This means you can have more than one device attached to the same controller.
2021-03-03 15:36:42 +00:00
Richard Hughes
88d9ace4a3 pixart: Include the missing ->to_string() parent class 2021-03-03 15:36:42 +00:00
Richard Hughes
21c44d1f8a Fix the HSI plugin 'Disabled' state
I broke this when adding test_ble.

Fixes https://github.com/fwupd/fwupd/discussions/2963
2021-03-03 14:29:45 +00:00
Richard Hughes
5f4c651d03 ccgx: Align the CCGX DMC firmware to 64 byte chunks
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31608
2021-03-03 14:29:29 +00:00
Richard Hughes
2ad99bb402 Relax fu_common_bytes_pad() to return the blob if longer than the pad size
This means the caller does not have to do this each time.
2021-03-03 14:29:29 +00:00
Richard Hughes
6db5522eaf elantp: Fix a regression when recovering the device in i2c mode
This was broken in 6188be1dd4, again mea culpa.
2021-03-03 13:24:52 +00:00
Richard Hughes
9f250fb511 elantp: Fix a regression in the defined IAP start address
This was accidentally changed in ae3ad6771, mea culpa.
2021-03-03 12:41:59 +00:00
Richard Hughes
c81b755872 Be more strict for custom quirk keys
Rather than trying to guess typos, force each plugin to register the quirk
keys it supports, so we can show a sensible warning if required at startup on
the console.
2021-03-03 08:30:34 +00:00
Richard Hughes
7d132b728c Simplify the quirk file format
The best way of not getting something wrong is to not require it in the first
place...

All plugins now use DeviceInstanceId-style quirk matches and we can just drop
the prefix in all files. We were treating HwId=, Guid= and DeviceInstanceId= in
exactly the same way -- they're just converted to GUIDs when building the silo!
2021-03-03 08:30:34 +00:00
Richard Hughes
79a217a2a6 superio: Use DeviceInstanceIDs to merge chip quirk metadata
This means we can use the standard ->set_quirk_kv() vfunc rather than using
FuQuirks directly with a custom group.
2021-03-03 08:30:34 +00:00
Richard Hughes
54c683c009 dfu: Use DeviceInstanceIDs to merge AVR quirk metadata
This means we can use the standard ->set_quirk_kv() vfunc rather than using
FuQuirks directly with a custom group.
2021-03-03 08:30:34 +00:00
Richard Hughes
f878a7bcba synaptics-mst: Use DeviceInstanceIDs to merge quirk metadata
This means we can use the standard ->set_quirk_kv() vfunc rather than using
FuQuirks directly with a custom group. Also use a plugin prefix for quirk keys.
2021-03-03 08:30:34 +00:00
Richard Hughes
24232d1d63 pci-bcr: Use a plugin prefix for quirk keys 2021-03-03 08:30:34 +00:00
Richard Hughes
2bae97c6c2 vli: Use a plugin prefix for quirk keys 2021-03-03 08:30:34 +00:00
Richard Hughes
707331e90b synaptics-cxaudio: Use a plugin prefix for quirk keys 2021-03-03 08:30:34 +00:00
Richard Hughes
98c592fe51 ccgx: Use a plugin prefix for quirk keys 2021-03-03 08:30:34 +00:00
Mario Limonciello
3df7dd3708 libfwupdplugin: don't allow device updates while needing activation 2021-03-03 07:32:35 +00:00
Mario Limonciello
2994338c63 trivial: thunderbolt: set the version for Titan Ridge devices in FW 2021-03-03 07:32:35 +00:00
Richard Hughes
42f43fe8a3 trivial: Actually disable plugins with _REQUIRE_HWID 2021-03-02 18:29:27 +00:00
Richard Hughes
d94286b9de Allow enabling plugins only matching a specific HwId
At the moment plugins are doing this a few different ways; either looping
through the HwIds manually (e.g. flashrom) or setting a custom flag that is
checked in fu_plugin_setup (e.g. uefi-recovery).

Define a standard 'Plugin' HwId quirk to simplify plugins.
2021-03-02 18:19:45 +00:00
Richard Hughes
05217338b3 uefi: Do not use fu_plugin_has_custom_flag() in _init()
This means we can defer loading the quirks until all the plugins have loaded.
2021-03-02 06:33:46 +00:00
Richard Hughes
6122034a19 Show a warning when parsing invalid quirk files
I just wasted more than two hours of my life over `DeviceID`.
2021-03-02 06:31:55 +00:00
Richard Hughes
bb87a45af3 logitech_hidpp: Wait a few ms for the hardware to settle after detach
I guess the hidraw stack is a bit faster than it was 5 years ago...
2021-03-01 17:05:01 +00:00
Richard Hughes
f6ee6043c5 dfu: Correctly erase STM32 devices when transfer size is less than sector size 2021-03-01 17:04:34 +00:00
Richard Hughes
f32e4c0666 dfu: Do not use a heuristic to set the device status
This breaks on all STM32 devices and should be unnecessary now.
2021-03-01 17:04:34 +00:00