Commit Graph

6159 Commits

Author SHA1 Message Date
Ricardo Cañuelo
e47de909c0 logitech-hidpp: adhere more closely to the specs
The restart message is supposed to be HIDPP_REPORT_ID_LONG according to
the specs, but it works just as well if we use
HIDPP_REPORT_ID_SHORT. We better stick to the specs, though.
2021-09-20 10:21:44 +02:00
Ricardo Cañuelo
ab5c38b679 trivial: logitech-hidpp: fix request message setting 2021-09-20 10:21:44 +02:00
Ricardo Cañuelo
297653f728 logitech-hidpp: remove user action message from Bolt receiver update 2021-09-20 10:21:44 +02:00
Ricardo Cañuelo
c198055a54 logitech-hidpp: remove unnecessary 'bolt-peripheral' private flag 2021-09-20 10:21:44 +02:00
Mario Limonciello
cc8eb5ca8c trivial: Merge python steps from contrib/setup into helper script
This avoids having to hardcode profile targets in multiple places
and also fixes the confusing entry points into scripts both by
arguments and environment variables.

It also makes the setup script a lot more debuggable and scalable.

OS detection is a lot more robust, where it will try to use pip to
set up the distro python package, and if pip is missing try to install
it.

If OS detection fails now, a user can use --os on contrib/setup for
specifying it.
2021-09-17 10:59:35 -05:00
Mario Limonciello
349975bb70 trivial: setup: drop the special case for python3-venv
Install it via dependencies.xml like the rest
2021-09-17 10:59:35 -05:00
Richard Hughes
1ff96eb4b3 Restore the ABI for fu_device_detach() and provide new symbols
Quite a few plugins are using a FuDeviceLocker to detach then attach in
the error path, and finding them isn't easy as we explicitly cast to a
FuDeviceLockerFunc.

For sanity, just provide both symbols so we can do the right thing in
both cases. It seems like a sensible thing to allow.

Fixes https://github.com/fwupd/fwupd/issues/3771
2021-09-17 16:35:21 +01:00
Richard Hughes
3162c8540d Add new API for splitting an untrusted string
Using fu_common_strnsplit() has the drawback that a malicious user (or
a fuzzer!) could create a file with 5,000,000 newlines, and then pass
that into any parser that tokenizes into lines. This causes millions of
tiny allocations and quickly dirties hundreds of megabytes of RSS due
to heap overheads.

Rather than splitting a huge array and then processing each line, set
up a callback to process each line and only allocate the next string if
the token was parsed correctly. This means that we don't even dup the
buffer before we start parsing, rather than allocating everything and
then failing at the first hurdle.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38696
2021-09-17 14:46:45 +01:00
Richard Hughes
e50d911a59 logitech-hidpp: Use accurate FuProgress steps 2021-09-17 14:45:39 +01:00
Norbert Kamiński
d0af777b14 main.yml: Install protobuf-c as fwupd dependency in the FreeBSD job
Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
2021-09-16 18:24:21 -05:00
Norbert Kamiński
30700d52e1 main.yml: Bump GitHub Action freebsd-vm
Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
2021-09-16 18:24:21 -05:00
Norbert Kamiński
b6fac03b57 Revert "trivial: Disable FreeBSD CI again"
This reverts commit 14dab4da6d.
2021-09-16 18:24:21 -05:00
Mario Limonciello
c0f242258b Fix probing the Dell TPM (Fixes: #3759)
Since commit 078beaf, device de-duplication between plugins doesn't
work anymore.  Both the TPM and Dell plugin create a device with an
identical physical ID and no logical ID.  This makes the device list
think whichever plugin probes second is just updating the first.

To avoid this problem, set a logical ID in the Dell plugin, ensuring
that the device ID built from physical + logical is different from the
TPM plugin.

The side effect of this is that both devices will export into the device
list, but the TPM plugin's devices will not be upgradable.
2021-09-16 13:52:44 -05:00
Richard Hughes
9d37e447a1 Convert the device test script to a fwupdmgr subcommand
This allows us to do a few things:

 * Remove the runtime dep on Python 3, which is tricky for ChromeOS
 * Test composite devices more efficiently, only writing once per test
 * Automatically upload signed reports for successful device tests.
2021-09-16 15:01:36 +01:00
Mario Limonciello
ab65ea5db7 trivial: uefi-recovery: only run the plugin if efivar is available
This will cause it to disable on systems that are definitely not
relevant.
2021-09-16 06:44:27 -05:00
Mario Limonciello
7258f972ac trivial: fu-tool: for get-plugins load engine with HWINFO
Checking whether some plugins are enabled or not will require smbios
to be available.  Information may be wrongly displayed unless this
has been checked.
2021-09-16 06:44:27 -05:00
Mario Limonciello
35f62e1c84 trivial: msr: only run if /dev/cpu is present
I'm finding errors in a crostini container that the MSR plugin tries
to run and fails later.  The plugin just shouldn't be passing startup
if /dev/cpu isn't present.
2021-09-16 06:44:11 -05:00
Mario Limonciello
24970acf4a trivial: generate_dependencies: add variant to OS strings that are generated 2021-09-16 06:43:55 -05:00
Mario Limonciello
de2774846f trivial: contrib/setup: use distro.id() 2021-09-16 06:43:55 -05:00
Mario Limonciello
15f0029624 trivial: generate_dependencies: fallback to "like" distros
This should cause linuxmint to run the Ubuntu dependency resolution.
2021-09-16 06:43:55 -05:00
Mario Limonciello
0c77e34c73 trivial: drop the flatpak target
We don't use it for dependency building at all.
2021-09-16 06:43:55 -05:00
Mario Limonciello
05a3ee1fc8 trivial: generate_dependencies: use distro.id() to better find defaults 2021-09-16 06:43:55 -05:00
Richard Hughes
28494902f5 trivial: Remove the double warning when reinstalling composite firmware
Typo? Merge artifact? Who knows.
2021-09-16 09:15:35 +01:00
Richard Hughes
320f8d7d90 Update the child composite ID if the parent changes
Typically, this can be triggered with:

 * create parent
 * set parent physical ID
 * add new child to parent
 * set parent logical ID
2021-09-16 07:44:44 +01:00
Richard Hughes
c5dd4d4d4a pixart-rf: Use the correct method to add an instance ID
We actually check for fu_device_add_guid() not being an actual GUID,
but in the future we'll be warning if we do this magic fallback as it
hides not-quite-GUID typos.

No behaviour change.
2021-09-15 19:40:14 +01:00
Ricardo Cañuelo
26a1ddf49d logitech-hidpp: fix logical id for radio devices 2021-09-15 10:19:37 +02:00
Ricardo Cañuelo
5675e16274 logitech-hidpp: fix logical ids for BLE and paired devices 2021-09-15 10:19:37 +02:00
dkwo
d6645e1447 update void linux ci target 2021-09-14 16:07:10 -05:00
Simon Ho
5e67108ab8
plugins: add new plugin for Synaptics CAPE devices (#3746)
CAPE family is Audio DSP for a board range of applications in IOT, PC
and mobile can be interfaced via I2C, UART or USB interface. This patch
is only for CX31993 and CX31988 chips, there is not immediate plans is
to add support to other CAPE devices.

CX31993 have two separate firmware .hid file for for each partition. It
need to convert two .hid files into a .fw file for fwupd tool to
consume.

Currently, this patch is only support for EPOS headsets with basic
firmware update feature. Either new code singing or manifest.xml are
unsupported yet.

The code has been tested with CX31993 EVK board.

A test firmware file is put at 'src/fuzzing/firmware/synaptics-cape.fw'

synaptics-cape: Port to new FuProgress API and style fixups

synaptics-cape: Fix compile errors and add missing test fw file

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Fix fuzzer test

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Fix progress bar number

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Mark the fuzzing target

trivial: Use a stable GLib branch for fuzzing

synaptics-cape: Fix progress bar number

Signed-off-by: Simon Ho <simon.ho@synaptics.com>

synaptics-cape: Fix readme

synaptics-cape: Style fixups

synaptics-cape: Fix progress bar percentage

synaptics-cape: Style fixups
2021-09-15 03:42:07 +08:00
Richard Hughes
6817648c6b wacom-usb: Fix a false positive in real world firmware
Some files have a newline inbetween the AB sections.
2021-09-14 14:04:51 +01:00
Sean Rhodes
5d4e70e9cc
plugins/superio: Fix detection of IT5570 for StarBook Mk V (#3747) 2021-09-14 10:41:24 +01:00
Richard Hughes
d8d26e1f97 superio: Make the ports and timeouts specific to the DMI model
The chipset doesn't define the port like I guessed, as Tuxedo and Star
Labs both want to use a 0x5570 with different values.
2021-09-13 17:42:32 +01:00
Richard Hughes
9ed7eac949 trivial: Add translations for more device categories 2021-09-13 15:08:32 +01:00
Richard Hughes
9a2a4a211a synaptics-cxaudio: Use accurate FuProgress steps 2021-09-13 14:28:15 +01:00
Richard Hughes
40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00
Sean Rhodes
f959b198d2 plugins/flashrom: Fix logic in reset cmos
ioperm returns -1 for an error and 0 for success
2021-09-13 12:09:37 +01:00
Ricardo Cañuelo
15a39b94ee logitech-hidpp: Add support for updating Bolt peripheral firmware
Also simplify the Instance IDs added by the Bolt hardware.
2021-09-13 11:28:55 +01:00
Sean Rhodes
8cc158bda4 plugins/flashrom: Add reset-cmos flag to Star Labs laptops 2021-09-11 07:47:14 -05:00
Richard Hughes
30ee6064f9 trivial: Fix a small memory leak when processing recommends 2021-09-10 21:12:53 +01:00
Richard Hughes
2bcb19ac4b trivial: Fix a small memory leak in the self tests 2021-09-10 21:12:53 +01:00
Richard Hughes
8a9aea267c wacom-usb: Abort on invalid SREC files early to avoid a fuzzing timeout
Half a million new-lines was taking a long time to parse.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38381
2021-09-10 18:56:02 +01:00
Sean Rhodes
af9d9b3ffd plugins/flashrom: Add private flag to reset CMOS
Reset the CMOS based on a private flag. Tested on coreboot using an
offset of 123. Required when a CMOS layout or default option has
changed as the resulting flash will have 0's for the modified option.
2021-09-10 16:25:32 +01:00
Richard Hughes
b3824c94fa Fix a regression in flashing the Dell dock
This fixes a regression caused by 15b668c, we should have been more careful.

Fixes https://github.com/fwupd/fwupd/issues/3732
2021-09-10 15:50:52 +01:00
Richard Hughes
9e32b7325a trivial: Do not use deprecated GLib API 2021-09-10 15:02:46 +01:00
Sean Rhodes
bcf6253134 plguins/flashrom: Add GUID for StarBook coreboot 2021-09-09 22:31:56 +01:00
Sean Rhodes
33e850dea5 plugins/{superio,flashrom}: Add GUIDs for StarBook Mk V 2021-09-09 14:26:36 -05:00
Richard Hughes
75eae41a86 dell-dock: Use the correct data file for the device test 2021-09-09 17:59:20 +01:00
Richard Hughes
75221f2e07 cxaudio: Use the correct data file for the device test 2021-09-09 17:59:20 +01:00
Richard Hughes
83962339ba trivial: Do not update the progressbar title for the device child 2021-09-08 18:51:30 +01:00
Richard Hughes
3489b43700 wacom-usb: Also set the context for FuWacModuleTouch 2021-09-08 15:49:19 +01:00