Commit Graph

189 Commits

Author SHA1 Message Date
Richard Hughes
11075b4abf Allow setting the package user agent before the client has connected
This fixes a regression introduced in https://github.com/fwupd/fwupd/pull/5528
where we added a critical warning if setting the package user agent before we
retrieved the fwupd daemon version.

If we rebuild the user agent whenever we get new information it does not matter
in which order these are set.
2023-02-24 14:13:59 +00:00
Richard Hughes
cd9c81c106 trivial: Add the closure user_data to the introspection 2023-02-21 08:15:47 +00:00
Richard Hughes
11cd52f58d trivial: Ensure the progressbar gets to exactly 100% when downloading 2023-02-15 17:16:28 +00:00
Richard Hughes
34743ff6f4 Allow downloading files in fwupdtool
The useragent was being set as 'fwupdtool/1.8.11 fwupd/(NULL)' which the LVFS
did not like. As we're using fwupdtool without a daemon proxy just set the
fwupd version manually.

Fixes https://github.com/fwupd/fwupd/issues/5519
2023-02-13 21:17:03 +00:00
Richard Hughes
be45a3a773 Show the 4XX download failure in the error output 2023-02-13 21:17:03 +00:00
Richard Hughes
64ebbd2f9d trivial: Fix the gtk-doc header to reflect reality 2023-02-13 16:13:10 +00:00
Richard Hughes
8290e4d1ef trivial: Fix warning: declared with a const-qualified typedef 2023-02-13 12:34:46 +00:00
Richard Hughes
5dbc91e769 trivial: Fix warning: repeated branch in conditional chain 2023-02-13 12:34:46 +00:00
Richard Hughes
670e5b9750 trivial: Remove the unused deprecated header files 2023-02-13 12:34:46 +00:00
Richard Hughes
ac5f9412e0 Add support for emulating and recording devices
Based on patches from Frédéric Danis <frederic.danis@collabora.com>
2023-02-10 14:43:25 +00:00
Richard Hughes
4257d5f451 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-07 11:00:53 +00:00
Richard Hughes
a6deceda32 Allow desktop software to inhibit the system to prevent all updates
On edge hardware a process may want to disable firmware updates as it might be
a bad time to allow an upgrade.
2023-01-23 13:14:23 +00:00
Richard Hughes
63f4038328 Fix some trivial null-correctness spotted by Tartan 2022-12-15 17:27:22 +00:00
Mario Limonciello
25789ef2e7 trivial: fwupd-client: prefix some windows error messages 2022-08-30 12:06:16 -05:00
Mario Limonciello
b7b0ce533d trivial: Unify ambiguity between bios-attrs and bios-settings
These are currently used interchangeably since there was indecisiveness
which to use as the feature was being developed.

As outward facing it will be named with "settings", change all uses
in the code to match this.
2022-08-24 07:20:01 -05:00
Mario Limonciello
826983b8a7 Add support to set BIOS settings using a JSON payload
The JSON payload is ideally generated from `fwupdmgr get-bios-settings --json`
with all attributes expected to be included as additional arguments.
2022-08-24 09:51:46 +01:00
Mario Limonciello
5ded4f44fe Add support for reading and writing firmware attributes
This support is comprehensive:
 * Client library support
 * Daemon support
 * plugin support
 * Client tool support (with new commands)
2022-07-28 17:30:57 -05:00
Richard Hughes
1e6d75a47e Add the HostVendor to the D-Bus interface
This allows us to show it in the same places as the host product.
2022-07-06 16:10:43 +01:00
Richard Hughes
3e0a4dc1c3 Be smarter and include less header files per source file 2022-06-14 14:36:52 -05:00
Richard Hughes
ac03f02f4c trivial: gi-docgenize some of the function comments 2022-06-11 21:26:46 +01:00
Richard Hughes
c9dd8cb256 trivial: Make the FwupdClient host properties RW
We'll need this for future functionality when using client in fwupdtool.
2022-05-18 15:03:00 -05:00
Richard Hughes
91f23d67ab Export the system battery levels on the D-Bus interface 2022-05-18 07:16:07 +01:00
Richard Hughes
7b806dbb2a Pass the socket address when setting up the daemon 2022-05-14 20:47:50 +01:00
Richard Hughes
a489ec13bb trivial: Automatically set the socket address on Windows 2022-05-11 10:11:06 -05:00
Richard Hughes
418d883ea7 Allow specifying a non-file D-Bus transport
e.g. on Windows you can do:

    FWUPD_DBUS_SOCKET=tcp:host=localhost,port=12345
2022-05-11 10:11:06 -05:00
Richard Hughes
c56e0ba4cc Use the native CA store on Windows when possible 2022-05-10 13:09:44 +01:00
Richard Hughes
47f887f100 trivial: Do not connect the daemon to download files
There's nothing we need as all the useragent data is client-side.
2022-05-10 12:56:43 +01:00
Richard Hughes
31907e6863 Add a sanity check when trying to refresh a non-download remote 2022-04-25 15:47:20 +01:00
Richard Hughes
3b0d1a6c6b trivial: Ignore the return value of curl_easy_setopt() in most cases
This makes Coverity happy.
2022-04-13 15:08:12 +01:00
Richard Hughes
dd3fc46786 trivial: Add some missing g_return_val_if_fail() calls 2022-03-29 20:04:26 +01:00
Richard Hughes
ce762c1d08 trivial: Use the correct struct offset for device requests 2022-03-28 15:08:16 +01:00
Richard Hughes
d3cba9a679 Add fwupd_client_disconnect() for future usage 2022-03-11 13:28:00 +00:00
Crag Wang
a2b46e15cf Add daemon configuration 'OnlyTrusted' to D-Bus properties 2022-03-10 09:46:54 +00:00
Richard Hughes
4ce9972ce5 trivial: Don't leak the string even on critical failure
Not totally sure this is worthwhile, but it triggered a failure in the
RHEL tests we do - and it's less work to fix it than argue.
2022-03-08 16:01:16 +00:00
Richard Hughes
bb1bcce863 Allow fwupd to operate without a D-Bus daemon
This adds support for optionally using a UNIX domain socket where a
D-Bus daemon may not be running.

To use this, launch the daemon and clients with something like
`FWUPD_DBUS_SOCKET=/var/run/fwupd.sock fwupdmgr get-devices`
2022-01-31 14:05:23 +00:00
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
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
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
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
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
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
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
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
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00