Commit Graph

542 Commits

Author SHA1 Message Date
Richard Hughes
c725e42e34 trivial: Fix various const issues 2022-01-03 22:46:23 +00:00
Richard Hughes
e17a107ce1 trivial: Cast the g_signal_connect() object to allow static analysis
This is useful when using https://gitlab.freedesktop.org/tartan/tartan
2022-01-03 22:46:23 +00:00
Richard Hughes
c4590f2f25 trivial: Add some missing g_return_val_if_fail() calls 2022-01-03 22:46:23 +00:00
Richard Hughes
2e99055d1e trivial: Add some more annotations for language bindings 2022-01-03 22:46:23 +00:00
Richard Hughes
3356d8a844 trivial: Add fwupd_device_get_root() for GUI use 2021-12-17 16:44:57 +00:00
Richard Hughes
cb110b55f8 trivial: Fix regression from 9f94dc9 on Ubuntu Focal 2021-12-17 12:19:39 +00:00
Richard Hughes
9f94dc97c4 trivial: Handle old JSON-Glib more gracefully
Fixes https://github.com/fwupd/fwupd/issues/4099
2021-12-16 19:29:49 +00:00
Mario Limonciello
27ac4f1fc2 trivial: libfwupd: correct building URI path
when run on Windows the following is emitted:

```
changing metadata URI from https://cdn.fwupd.org/downloads/firmware.xml.gz to
https://cdn.fwupd.org/downloads\firmware-02681-stable.xml.gz
```
2021-12-15 06:46:27 -06:00
Richard Hughes
3822422b1e trivial: Workaround two false 'unused' warnings from clang 2021-12-10 16:00:07 +00:00
Richard Hughes
beb29ff698 Add a sync-bkc subcommand to ensure a known set of firmware versions
Install or downgrade firmware on all devices to make the system match
a well known set. This allows two things:

 * Factory recovery where a device in the field has been upgraded
 * Ensuring a consistent set of tested firmware for a specific workload

A tag is assigned either during upload or added post-upload on the LVFS
which is included in the metadata. A single firmware can be marked with
multiple tags, and tags can be duplicated for different firmwares.
2021-11-29 15:16:14 +00:00
Richard Hughes
4fe8a36729 Add support for LVFS component tags
These allow us to tag components as being part of a set, e.g. a BKC.
2021-11-25 10:36:26 +00:00
Richard Hughes
6e651269ba Fix running the tests when fwupd is not installed
This probably regressed in 70f9124545 as
the callers actually expect an error in the GDBusError domain, rather
than one fixed up in the FwupdError domain.

Fixes https://github.com/fwupd/fwupd/issues/4014
2021-11-23 15:18:41 +00:00
Richard Hughes
5ebbfe7f7d Export the component release ID over DBus
This allows us to map a specific component on the LVFS without guessing
by using the generated checksum.
2021-11-19 06:55:53 +00:00
Gabriel Kerneis
3e8f09a0f7 Add HSI check that PCR registers 0-7 are not empty
Some BIOSes forget add measurements to PCR registers, which results in
all-zero checksums and breaks measured boot guarantees.

Fixes #3901
2021-11-17 16:21:52 +00:00
Richard Hughes
60612294f5 trivial: Use the device GType as the debugging root
We never show the fu_device_to_string() output to the user in normal
circumstances, and it's super useful for it to match the FuFirmware
format.
2021-11-15 14:59:52 +00:00
Richard Hughes
b87a909223 trivial: Do not show a critical warning is LANG is unset 2021-11-12 15:26:31 +00:00
Richard Hughes
4d63d4ad7c Use g_subprocess_communicate() to fix IPFS downloads
Since switching to a custom GMainContext we broke reading the stream of
the GSubprocess.
2021-11-09 09:22:18 +00:00
Richard Hughes
09b946cb40 trivial: Fix ctrl+c when downloading with IPFS 2021-11-09 09:22:18 +00:00
Richard Hughes
5e895b89c9 Use pre-computed namespace GUIDs to load 0.3% faster
This should also help memory fragmentation at startup too as we were
splitting a lot of very small strings.
2021-11-03 21:51:45 +00:00
Richard Hughes
81d0216d14 trivial: Make checking a GUID faster to speed up startup by 0.23%
We call this 570 times at startup, and it makes up a non-trivial amount
of the daemon startup time...
2021-11-03 21:51:45 +00:00
Richard Hughes
e3998eed5a trivial: Fix a tiny leak on request error path 2021-11-02 13:47:56 +00:00
Richard Hughes
a0cb743700 Show changes in HSI attributes when required
e.g. `fwupdmgr security --force` would display:

    Host Security Events
      2021-10-29 10:51:42:  ✘ Kernel lockdown disabled
      2021-10-29 10:51:42:  ✘ SecureBoot disabled
      2021-10-29 09:32:32:  ✔ IOMMU device protection enabled
      2021-10-29 09:28:52:  ✘ IOMMU device protection disabled
2021-11-01 06:58:44 +00:00
Richard Hughes
8120616c62 trivial: Add a fallback result for an HSI attribute
The fallback may represent the old state, or a state
that may be considered equivalent.
2021-11-01 06:58:44 +00:00
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