Commit Graph

9606 Commits

Author SHA1 Message Date
Richard Hughes
67f7db8f6d trivial: Add a clang-tidy template 2023-02-23 13:04:12 -06:00
Richard Hughes
2077861dea trivial: Fix warning: function has a definition with different parameter names 2023-02-23 13:04:12 -06:00
Richard Hughes
21e08ff483 trivial: Fix warning: return after continue 2023-02-23 13:04:12 -06:00
Richard Hughes
9defbce2c7 trivial: Fix warning: parameter is const-qualified in the function declaration 2023-02-23 13:04:12 -06:00
Richard Hughes
648e0c6858 trivial: Fix warning: declared with a const-qualified typedef 2023-02-23 13:04:12 -06:00
Richard Hughes
be04e8e034 trivial: Fix warning: pointer parameter 'buf' can be pointer to const 2023-02-23 13:04:11 -06:00
Richard Hughes
65b158a7cc trivial: Fix warning: repeated branch in conditional chain 2023-02-23 13:04:11 -06:00
Richard Hughes
caa6568262 trivial: Fix warning: do not use 'else' after 'return' 2023-02-23 13:04:11 -06:00
Richard Hughes
953b74a26f trivial: Fix warning: redundant return statement at the end of a function with a void return type 2023-02-23 13:04:11 -06:00
Richard Hughes
72c8574f04 trivial: Remove an unused source file 2023-02-23 13:04:11 -06:00
Richard Hughes
2f679bf2e2 trivial: Remove an unused self-test file 2023-02-23 13:04:11 -06:00
Richard Hughes
4ea2e43b13 Actually store the SHA384 TPM measurements if found 2023-02-23 13:04:11 -06:00
Richard Hughes
53c88b8949 trivial: Fix a typo that was missed in review 2023-02-23 13:04:11 -06:00
Richard Hughes
b908b1c1df trivial: Test for the correct thing in the tests 2023-02-23 13:04:11 -06:00
Richard Hughes
a5dd069b43 trivial: Include the correct headers to make clang-tidy happy 2023-02-23 13:04:11 -06:00
Richard Hughes
34bd4d6766 trivial: Remove the unused deprecated header files 2023-02-23 13:04:11 -06:00
Richard Hughes
93307ed27d trivial: Never show profiling steps when using fwupdtool install 2023-02-23 13:04:11 -06:00
Richard Hughes
c0ababf2cf trivial: Add some additional docs about CCGX factory mode 2023-02-23 13:04:11 -06:00
Richard Hughes
b59c82e1bd Add support for emulating and recording devices
Based on patches from Frédéric Danis <frederic.danis@collabora.com>
2023-02-23 13:04:11 -06:00
Richard Hughes
8bcb66745a Update the MOTD after 5s idle
If we're doing multiple updates in a composite device then we don't need to
update the MOTD in between each sub-component update. Similarly, if we're
emulating lots of devices.

This speeds up emulating all the devices by two orders of magnitude.
2023-02-23 13:04:11 -06:00
Richard Hughes
2d2d59591a ccgx: Auto-set the remove-delay now we parse the devx components
This is one less thing for vendors to work out.
2023-02-23 13:04:11 -06:00
Mario Limonciello
d0e880ca4c trivial: thunderbolt: show integrated USB4 host controllers in tree
USB4 host controllers that can't be updated come from the CPU.
Show them properly in the tree view.
2023-02-23 13:04:11 -06:00
Mario Limonciello
21d185ef13 trivial: Add relationship for GPIO controller
The GPIO controllers AMDI0030 and AMDI0031 come from the SOC.
Show them appropriately in the tree view.
2023-02-23 13:04:11 -06:00
Richard Hughes
d1bf305d79 trivial: Use g_string_replace() from GLib when available 2023-02-23 13:04:11 -06:00
Richard Hughes
e5cb6dc653 Fix SMBIOS struct parsing when there are three NULs in a row
We need to be careful detecting the end of a string section when the struct
ends with NUL NUL NUL.

Fixes https://github.com/fwupd/fwupd/issues/5509
2023-02-23 13:04:11 -06:00
Valentin David
c17935acf7 snap: allow fwupdmgr to shutdown
When installing a capsule, optional reboot is done by fwupdmgr instead
of fwupd. This means fwupdmgr needs the permission to do that.
2023-02-23 13:04:11 -06:00
Richard Hughes
8aef37fd57 cros-ec: Fix an uninitialized buffer warning from valgrind 2023-02-23 13:04:11 -06:00
Richard Hughes
8e25ec00e2 analogix: Do not check the endpoints before selecting an interface
My Analogix USB device has a Billboard interface, with bNumEndpoints=0.

When emulating the interface is NULL, and in runtime the array can *never* be
NULL, so I think this check was added in error.
2023-02-23 13:04:11 -06:00
Richard Hughes
2b60028a97 ti-tps6598x: Fix a small memory leak when flashing new firmware 2023-02-23 13:04:11 -06:00
Richard Hughes
d064cc740e wacom-usb: Use the device proxy functionality
The wacom-usb plugin was created in a simpler time, before we had the concept
of `FuDevice.proxy`. Switch to the shared code to modernize the code, and also
because setting the proxy conveys other semantics that we need to emulate the
device successfully in the future.
2023-02-23 13:04:11 -06:00
Richard Hughes
7a2207fb28 trivial: Remove the now-unused FWUPD_WAC_EMULATE check 2023-02-23 13:04:11 -06:00
Richard Hughes
63a2bd859f Ensure composite devices all share the same acquiesce delay
We go to great pains to set the parent to the MAX of the child delays, but we
don't actually set the children to have the new parent value.

This means if you update the child device without the parent in the transaction
we don't always wait for all the USB devices to come back -- which is what the
acquiesce delay is designed to do.

Fixes an intermittant device test for the Wacom USB tablet.
2023-02-23 13:04:11 -06:00
Richard Hughes
62c743008f trivial: Ignore device requests when emulated 2023-02-23 13:04:11 -06:00
Richard Hughes
e8e6908246 ccgx: Add support for the CalDigit Element Hub 2023-02-23 13:04:11 -06:00
Richard Hughes
1aac6646f0 ccgx: Detect factory mode and set a non-zero version
The Element Hub (and several other docks that use the CCGX5 DMC reference
design) is in "factory mode" out of the box, displaying a version of `0.0.0.0`

Detect factory mode and set a non-zero version -- using the "real" version if
possible by matching the CCG5 devx base firmware firmware.
2023-02-23 13:04:11 -06:00
Mario Limonciello
47f0732590 trivial: Disable the automatic snap stable promotion
The snap is converted into a confined version, but we need to make
sure that the snapd has promoted into a stable release so that fwupd
snap also works.

We should revert this after that happens.
2023-02-23 13:04:11 -06:00
Richard Hughes
be33aaaf94 Fix fwupdtool firmware-convert to work with image-less formats
Converting 'simple' non-nested formats like Intel Hex into nested formats like
DfuSe needs us to create a binary child firmware to avoid missing data.

Fixes https://github.com/fwupd/fwupd/issues/5493
2023-02-23 13:04:11 -06:00
Richard Hughes
2da924d8bc trivial: Do not return the internal libxmlb error back to the user 2023-02-23 13:04:11 -06:00
Richard Hughes
738f7d3f9b Print errors as JSON objects when using --json
For example:

	$ fwupdmgr local-install --json foo.zip
	{
	  "Error" : {
	    "Domain" : "FwupdError",
	    "Code" : 7,
	    "Message" : "failed to open foo.zip"
	  }
	}

Fixes https://github.com/fwupd/fwupd/issues/5499
2023-02-23 13:04:11 -06:00
Valentin David
37a28e5e1d snap: read the host os-release instead of base snap
This should fix #5485. Depends on https://github.com/snapcore/snapd/pull/12545
2023-02-23 13:04:11 -06:00
Richard Hughes
3a7fa73d0a Optimise getting the list of upgrades using the legacy API
We use GetReleases for all the *possible* releases that could be installed
(although the device might be in UPDATABLE_HIDDEN), and the legacy GetUpgrades
API just wants to know what can be done right now.
2023-02-23 13:04:11 -06:00
Richard Hughes
47f17cfe55 Speed up regenerating the MOTD
This is regenerated on every device hotplug event, and although infrequent
there is no point doing all that CPU-heavy requirement checking for no reason.
2023-02-23 13:04:11 -06:00
Richard Hughes
5374e5a379 wistron-dock: Use only-wait-for-replug to speed up device replug
Also, set the progress steps correctly.
2023-02-23 13:04:11 -06:00
Richard Hughes
7f50cffc2b wistron-dock: Fix critical warning during update 2023-02-23 13:04:11 -06:00
Richard Hughes
e2be6072e5 trivial: Only use clang-format on C source files 2023-02-23 13:04:11 -06:00
Richard Hughes
2fa46d3823 Add support for Quit() in fwupdmgr
This allows us to only shut down the P2P daemon in the installed tests.
The easy fix would have been to use something like:

    gdbus call --address unix:path=/run/fwupd.sock --object-path / --method org.freedesktop.fwupd.Quit'

...but the daemon does not implement an ObjectManager, which gdbus requires.

This worked correctly for so long because the p2p tests were being run after
the bus tests, so shutting down the system daemon had no effect.

Fedora 37 seems to have flipped the order for some reason -- and now it
*sometimes* matters that we were doing the worng thing...
2023-02-23 13:04:11 -06:00
Richard Hughes
ab65987a58 trivial: Fix Fedora CI when it cannot autostart udisks 2023-02-23 13:04:11 -06:00
Richard Hughes
f6d977c354 cros-ec: Clear the bulk transfer buffer to zero before using
This allow us to emulate the device as the buffer contents are now 100%
predictable and replayable.
2023-02-23 13:04:11 -06:00
Richard Hughes
6a75c28bfc trivial: Fix a tiny coverity-spotted memory leak on error 2023-02-23 13:04:11 -06:00
Richard Hughes
8f719cb6b0 Move the Fedora CI job to F37 2023-02-23 13:04:11 -06:00