Commit Graph

519 Commits

Author SHA1 Message Date
Richard Hughes
e9319699b4 trivial: Add fwupd_security_attr_copy() for future functionality 2021-10-29 13:09:45 +01:00
Richard Hughes
a085b4dd68 Add a 'created' property on the HSI security attribute 2021-10-28 17:25:40 +01:00
Richard Hughes
dbdd3740a3 Add support for loading the HSI result from a JSON blob
This is how we save it to the database, and we'll need to load old
records for future functionality.
2021-10-28 15:36:13 +01:00
Richard Hughes
95b82a1467 trivial: Add two missing _from_string() HSI helpers 2021-10-28 15:36:13 +01:00
Richard Hughes
164012b47b trivial: Ensure the plugin is loaded from the HSI attr variant 2021-10-28 15:36:13 +01:00
Richard Hughes
70f9124545 Show translated firmware release notes when provided
Send the users locale to the daemon so that it can be used to prefer
the localized update text over the default en_US version.

    $ LANG=fr_FR.UTF8 fwupdmgr get-details test.cab
    ...
    └─ACME Plan 9:
          Nouvelle version: 0.0.5
          Licence:          Propriétaire
          Urgence:          Faible
          Fournisseur:      ACME Ltd.
          Description:      Cette version stable corrige des bugs.

I decided to send the locale to the daemon rather than change the
`Description` to return GVariant to `a{ss}` as we also probably want
to support things like localized summary and URLs too in the future.
2021-10-24 18:59:15 +01:00
Richard Hughes
2d00cda464 Remove PLUGINBUILDDIR and use G_TEST_SRCDIR and G_TEST_BUILDDIR instead
This allows us to override the location we load data files from, which
allows us to do more kinds of installed tests in the future.

Also, move the global data/tests content into the place that it is used
as it was getting impossible to manage.
2021-10-21 18:36:22 +01:00
Richard Hughes
bc14f4c59c Support client-side abbreviated hashes
This allows the user to do something like `fwupdmgr get-releases a12d`
which is already supported daemon-side.
2021-10-18 11:16:45 +01:00
Gaël PORTAY
918006f8d5 trivial: Codespell fixes 2021-10-14 09:09:54 -05:00
Richard Hughes
d3706e0e0b Show the user a warning if updating may affect full-disk-encryption
Additionally, if the client does not set the feature flag `fde-warning`,
add an extra paragraph into the update description.

Fixes https://github.com/fwupd/fwupd/issues/3829
2021-10-09 08:09:38 +01:00
Richard Hughes
0fb485e434 Raise the client timeout value from 25 seconds
When coldplugging expensive servers with a huge number of Redfish
devices it takes about 30 seconds to start fwupd while we wait for the
BMC to return results.
2021-10-08 17:22:45 +01:00
Richard Hughes
478e44bc19 trivial: Do not use g_assert() in self test code
Note that g_assert() should not be used in unit tests, since it is a
no-op when compiling with G_DISABLE_ASSERT. Use g_assert() in production
code, and g_assert_true() in unit tests.

See https://github.com/fwupd/fwupd/issues/3790
2021-09-24 22:20:21 +01:00
Richard Hughes
494fd2736f Allow installing the LVFS remote, but disabled
This is a patch that I have to regenerate almost every rebase. Just
move it upstream as it's probably not RHEL specific.
2021-09-24 16:55:04 +01:00
Mario Limonciello
6ebccf1e1e Remove support for --ignore-power by frontends
This functionality broke a number of releases ago as part of
implementing device inhibition and was just noticed now.

Instead of fixing it, the preference seems to be to remove the
functionality as it exists today as inhibitions can happen for
a number of reasons.

To still allow people to override these power warnings (such as during
development) add a new daemon configuration item that can be used.

Fixes: #3778
2021-09-21 13:13:52 -05:00
Richard Hughes
63b52e9bf3 trivial: Add two missing properties in the JSON output 2021-09-04 13:53:12 +01:00
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