Commit Graph

504 Commits

Author SHA1 Message Date
Richard Hughes
f56878ff88 Allow adding GUIDs to each HSI security attr
This indicates the GUID in some way contributed to the result decided.

It also allows us to match the submitted HSI results back to a firmware
stream on the LVFS, which allows us to allow vendors to see a subset of
results for uploaded devices.
2021-09-03 22:03:28 +01:00
Richard Hughes
5c60beae29 Show HSiLevel=0 attributes in JSON security output
Don't assume zero always means 'skip'.
2021-09-02 21:41:11 +01:00
Richard Hughes
bd52573b11 Add support for an 'unreachable' device flag
This is for devices that are still registered with a receiver but are
no longer in range or in a high power state.
2021-08-31 17:08:05 +01:00
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Mario Limonciello
d3983674f4 trivial: don't use same variable definition as config.h in code
If config.h is included by a file then which one is used may end up
be confusing.  Be explicit to use the values that are declared by
libraries.
2021-08-24 11:18:40 -05:00
Richard Hughes
f12068d2e9 Allow devices to only accept version upgrades
See https://github.com/fwupd/fwupd/issues/3554 for details.
2021-07-31 20:41:21 +01:00
Richard Hughes
ac56353f05 trivial: Use the correct enum name
No functional change
2021-07-30 16:35:24 +01:00
Richard Hughes
08caad4ed2 trivial: Skip the Fwupd.Client.connect() method for introspection
In hindsight connect() was a poor choice of name as this is hardcoded
as the GObject parent method for signal attachment. It's not actually
required when using the sync API in Python as it's called when required.
2021-07-30 07:24:17 +01:00
Richard Hughes
cb5912c941 trivial: Do not set URIs of zero length 2021-07-28 18:25:50 +01:00
Richard Hughes
3d6a48fad3 Do not save invalid files on LVFS server error
In the event of a 429 response libcurl does not fail curl_easy_perform()
and instead saves the 'Too Many Requests' string as the payload.
This obviously fails the cabinet checksum specified in the metadata.

Move the response code checks to the success branch and also add checks
for the other 4xx and 5xx errors.

Fixes the fwupd half of https://github.com/fwupd/firmware-lenovo-thinkpad/issues/137
2021-07-27 15:59:17 +01:00
Richard Hughes
25c93aa7ca redfish: Identify hardware that needs to be updated to the same version
For instance, the EFI driver for a given network card cannot be
different for identical hardware.
2021-07-23 13:16:47 +01:00
Mario Limonciello
798d1ed3ee trivial: update markdown for pre-commit style 2021-07-18 14:42:47 -05:00
Richard Hughes
f1f0180433 trivial: Add notify::update-error support 2021-07-16 21:11:53 +01:00
Richard Hughes
a122098eb8 Allow returning the remote list in JSON format 2021-07-15 20:34:07 +01:00
Richard Hughes
9829103be9 trivial: Add some generic helpers for building JSON 2021-07-15 20:34:07 +01:00
Richard Hughes
942802063e trivial: Remove the unused parent instance from the private struct
I assume at some point we forgot to remove it when converting an object
from FINAL to DERIVABLE and the anti-pattern just got copied around the
codebase...
2021-07-15 16:20:19 +01:00
Richard Hughes
a65f5759ef trivial: Fix a typo of fwupd itself 2021-07-15 09:33:25 +01:00
Richard Hughes
19abf996c7 Allow the daemon to request interactive action from the end user
The "return error and hope the client resubmits the firmware again"
pattern is clunky. There are two plugins doing this now, and about to
be one more.

This adds FwupdRequest which provides a structured way of asking the
user to perform an action, e.g. to replug the device or to press a
special key or button.

This replaces much of the UpdateMessage and UpdateImage API although
it is still used internally. Clients capable of processing the new
DeviceRequest signal should add REQUESTS to their feature flags.

Also, this allows us go back to the old meaning of _NEEDS_BOOTLOADER,
which was "needs rebooting into a bootloader mode" rather than the
slightly weird "user needs to do something and resubmit request".
2021-07-14 17:03:50 +01:00
Richard Hughes
f7a23d7c88 Allow the client to watch for more property changes 2021-07-13 14:56:01 +01:00
Richard Hughes
f34c5d4eb6 trivial: Print the GUIDs in the order they were added
This fixes the self tests on old GLib versions as the order of the
GHashTableIter is not guaranteed to be stable.
2021-07-09 15:43:45 +01:00
Richard Hughes
5343a4a083 Export the build timestamp from plugins 2021-07-08 16:31:07 +01:00
Richard Hughes
ef73701aa1 trivial: Provide FWUPD_PLUGIN_FLAG_AUTH_REQUIRED for future usage 2021-07-06 20:12:17 +01:00
Richard Hughes
121cffe7d8 trivial: Export fwupd_device_has_icon()
This is useful in self tests.
2021-07-06 16:47:50 +01:00
Richard Hughes
dfaae2e837 Move amdgpu safety check into the plugin
There are now multiple plugins using drm_dp_aux_dev interface which
may potentially be combined with an amdgpu. Prevent exercising this
interface with any plugin using DP aux unless a new enough kernel is
installed.
2021-07-04 17:49:36 +01:00
Richard Hughes
7b209bb2c1 Watch for children added or removed after setup has been completed
Some devices may 'discover' child devices during poll, rather than the
more usual case of adding them as children during setup.
2021-07-02 13:27:10 +01:00
Richard Hughes
50d1892e10 trivial: Remove duplicate #define to stop a gtk-doc warning 2021-06-18 09:20:10 +01:00
Richard Hughes
eb8e43d942 libfwupd: Show unconverted GUIDs when debugging
Add a suffix to any GUIDs that are currently unconverted InstanceIDs.

This makes plugin development much easier as you can now see why GUID
quirks in the subclassed ->setup() are not matching.
2021-06-17 16:22:06 +01:00
Mario Limonciello
4d7585f8ee trivial: promote fwupd_checksum_format_for_display into ABI
This symbol is used by one plugin and so it should be properly
exported.
2021-06-16 08:37:34 +01:00
Richard Hughes
8b0031fad3 trivial: Codespell fixes 2021-06-15 21:45:15 +01:00
Richard Hughes
a02c1073f2 trivial: Fix up some of the developer docs
And add some missing content as requried.
2021-06-11 09:39:03 +01:00
Mario Limonciello
1e17457b16 Allow building the documentation with gi-docgen and gtk-doc
Until gi-docgen is declared stable support either of them.
This effectively means that hand builds and CI builds will use
gi-docgen, but distro builds use gtk-doc-tools.
2021-06-09 22:21:53 +01:00
Mario Limonciello
3f016787ee trivial: add gtkdoc for more of the defines 2021-06-04 13:21:41 -05:00
Richard Hughes
66482687f7 trivial: Move the sys/mman.h include to the right #ifdef 2021-05-26 16:00:32 +01:00
Sergii Dmytruk
d01603c2f9 Don't fail if memfd_create() is not available
Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2021-05-21 17:29:17 +01:00
Richard Hughes
2a5122b4a0 trivial: Fix a warning when compiling on Windows
Move the function prototype out of the GUnixInputStream-using ones.
2021-05-18 13:08:04 +01:00
Richard Hughes
6bc2d155a9 trivial: Remove a build warning by including Json properly 2021-05-17 09:27:54 +01:00
Richard Hughes
0aaf060105 Follow HTTP 3XX redirects when downloading files
This allows us to punt some smaller files onto the CDN.
2021-05-14 18:48:47 +01:00
Richard Hughes
dd415ab396 Add fwupd_remote_setup() to split out the 'parsing' from the 'validation' 2021-05-14 06:02:56 +01:00
Richard Hughes
2e6fee186e trivial: Fix several potential leaks when parsing remotes
This fixes several issues when calling fwupd_remote_load_from_filename()
multiple times on the same FwupdRemote.
2021-05-14 06:02:56 +01:00
Richard Hughes
6c706c74d6 trivial: Export fwupd_remote_set_filename_source() for possible future usage 2021-05-14 06:02:56 +01:00
Richard Hughes
769cbbf8af Add support for the PHAT table
On Alterlake and newer hardware the Platform Health Assessment Record
data can be used by the IHV to debug why a specific capsule update
failed. Any custom firmware loaded by the OEM can be identified and
used to further debug the root cause.
2021-05-12 12:02:33 +01:00
Richard Hughes
cb5aa1a254 trivial: Convert FwupdRelease to use @self 2021-05-10 14:35:10 +01:00
Richard Hughes
3f0340c3a7 trivial: Convert FwupdPlugin to use @self 2021-05-10 14:35:10 +01:00
Richard Hughes
8246e43174 trivial: Convert FwupdDevice to use @self 2021-05-10 14:35:10 +01:00
Richard Hughes
20ef071b3c trivial: Style fixes to lots of gtk-doc 2021-05-10 14:35:10 +01:00
Richard Hughes
5e95cae0c4 trivial: Fix CI by including the version symbols 2021-04-30 16:07:10 +01:00
Richard Hughes
c77b4f03a2 Check the versions of libfwupd and libfwupdplugin at startup
This prevents super-hard-to-debug crashes like we saw in #3197 where the user
was mixing PPAs and official versions.
2021-04-30 15:00:04 +01:00
Richard Hughes
76cafb29b7 Fix a critical warning when downloading files
The call to g_proxy_resolver_get_default() is (transfer none) and so unref'ing
it causes GLib to get very upset. Also, move it to be per-FwupdClient rather
than per-request as it can be expensive to call in the PAC-runner case.
2021-04-30 11:19:09 +01:00
Richard Hughes
89d45a0d91 trivial: Standardize on introspection for @error and @cancellable
Also standarize on `Returns:` for the result.
2021-04-28 16:19:50 +01:00
Richard Hughes
fdd507957a Switch from libproxy to GProxyResolver
GProxyResolver will use libproxy only when required. TIL.
2021-04-28 15:52:45 +01:00