Commit Graph

2279 Commits

Author SHA1 Message Date
Gaël PORTAY
12279b5165 trivial: util: Fix trailing space 2022-05-22 04:02:32 -04:00
Richard Hughes
2db224627c Do not leave the daemon in 'decompressing' state
Always return to IDLE even in event of an auth error.

Fixes https://github.com/fwupd/fwupd/issues/4649
2022-05-20 14:19:13 +01:00
Richard Hughes
519e80b1ee Allow clients to opt-in to showing updates with user-solvable problems
When typing 'fwupdmgr get-updates' show the updates that *could* be
installed if the problem was resolved.

Do not unconditionally do this, as some clients such as gnome-software
assume that all updates returned by GetUpdates() are updatable with
Install() -- and in a GUI we only want to show the updates we can apply
*right now*. When the problem is removed (e.g. AC power is connected)
the GUI client will notify the user as required, unlike a CLI tool.

Fixes https://github.com/fwupd/fwupd/issues/4629
2022-05-20 13:20:33 +01:00
Richard Hughes
aadf8c07c7 trivial: Watch the FwupdDevice problems in the engine
This ensures we refresh the UI when problems are added or removed.
2022-05-20 10:54:34 +01:00
Richard Hughes
8ebad4ea75 Specify an enumerated problem when inhibiting devices
This allows us to make smarter policy decisions in the future on when
to show unavailable updates. It also means we can show translated
text in the frond-end clients.

Only problems the user can "fix" are enumerated. For example, opening
the laptop lid, or charging the device battery.
2022-05-19 13:09:03 -05:00
Richard Hughes
a4906010d6 Add a way to read the device firmware in fwupdtool
In most cases 'fwupdtool firmware-dump' and 'fwupdtool firmware-read'
are going to be the same. This isn't true in all cases, especially when
dealing with composite firmware like archives.

See https://github.com/fwupd/fwupd/pull/4623#issuecomment-1129227133
2022-05-19 09:29:44 +01:00
Richard Hughes
09c703638f trivial: Pass the FwupdClient to fu_util_device_to_string()
This will be useful for future code that needs the system state for
translated messages, e.g. system battery level.
2022-05-18 15:03:00 -05:00
Richard Hughes
714a87771d trivial: Use FwupdClient in fu_util_print_tree()
This allows us to print the tree title without generating it from the caller.
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
679628c091 Move the battery attributes down into libfwupd
This allows us to show the current value and the threshold on the CLI
and in tools like gnome-firmware.
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
065b2a33f4 Use StartServiceCtrlDispatcherA for the daemon on Windows 2022-05-14 20:47:50 +01:00
Richard Hughes
0f89c48556 Build a dummy event message file for Windows
This means we don't get the 'No description found, please repair'
message when viewing messages in the Windows Event Viewer.
2022-05-13 15:08:39 +01:00
Richard Hughes
e185475fd4 Log errors and warnings to the win32 eventlog 2022-05-12 14:13:43 -05:00
Richard Hughes
d23fd085f8 Split out daemon startup into two files
The Win32 StartServiceCtrlDispatcher service startup is very different
from the usual Linux exec() mechanism.

Split out the D-Bus daemon into a new object so we can consume it from
a different binary in the future.

This looks like a big change but it's 99% just moving code around.
2022-05-12 16:37:45 +01:00
Richard Hughes
a489ec13bb trivial: Automatically set the socket address on Windows 2022-05-11 10:11:06 -05:00
Richard Hughes
1c1f180d84 trivial: Set up the interactive console earlier in fwupdmgr 2022-05-11 10:11:06 -05:00
Richard Hughes
e138da23b7 trivial: Workaround Windows setting the codepage to 1252 2022-05-11 10:11:06 -05:00
Richard Hughes
0604ef4324 trivial: Print the custom socket address to the console 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
c0a668ab18 Allow the device to pause the polling when writing firmware 2022-05-10 18:51:17 +01:00
Richard Hughes
b149300a9f Download in-process when using fwupdtool
This also means we get progress completion.
2022-05-10 09:13:45 -05:00
Richard Hughes
7df86f9ca0 trivial: Create a FwupdClient in fwupdtool 2022-05-10 13:03:33 +01:00
Richard Hughes
d3d7cfa816 Add plugin quirk keys earlier in the startup process
This allows creating the silo when starting the engine with custom
plugin keys such as WacomI2cFlashBaseAddr.

If we move the plugin initialization earlier then we don't get the
HwID matches, so we really do have to split this into a 4-stage startup,
e.g. ->load(), ->init(), ->startup() and ->coldplug().
2022-05-09 11:13:52 +01:00
Richard Hughes
82ff7fdba6 trivial: Disconnect plugin signals to fix self test issue 2022-05-09 11:13:52 +01:00
Richard Hughes
b4e3e1fcc6 trivial: Fix two warnings when recovering a device from a failed update 2022-05-09 11:00:18 +01:00
Richard Hughes
7f73445af4 trivial: Fix a compile warning on win32 2022-05-06 13:55:51 +01:00
Mario Limonciello
b81ee54c13 trivia: check that memory monitor was found
on Win32 this isn't allocated and causes an assertion
2022-05-05 15:38:43 -05:00
Mario Limonciello
532dfd54b1 trivial: install fwupd.exe into bindir for Windows
In Windows we'll be placing everything in the same directory so that
libraries can be resolved.
2022-05-05 15:38:43 -05:00
Mario Limonciello
b092f9e80c trivial: fu-main: fix compilation on win32
This isn't an actual fix for daemon on win32, it just disables the fd
support on !unix.

baby steps
2022-05-05 11:51:22 -05:00
Mario Limonciello
11c0cbaefc trivial: fu-util: fix compilation on win32 2022-05-05 11:51:22 -05:00
Richard Hughes
ff66aecf54 trivial: Fix -Wunused warning when compiling on Windows 2022-05-02 12:36:28 +01:00
Richard Hughes
298377fab3 trivial: Restore 'fwupdmgr install http://...' behaviour
Fixes https://github.com/fwupd/fwupd/issues/4576
2022-04-29 12:31:31 -06:00
Wei-Luan Wang
a87b2c901a Install D-Bus introspection data even if introspection is disabled
According to the D-Bus API Design Guidelines, the D-Bus interface files
for public API should be installed so that other services can load them.
2022-04-24 18:39:29 +01:00
Richard Hughes
21529460ec trivial: Ignore the return value of g_unlink() in the self tests 2022-04-23 10:28:16 +01:00
Richard Hughes
ab0c750bb2 Only show the CLI time remaining for predictable status phases
Fixes https://github.com/fwupd/fwupd/issues/4540
2022-04-22 11:38:35 -05:00
Richard Hughes
0b937e7a6e trivial: Only set the profile value after the argv parse 2022-04-19 14:21:21 +01:00
Richard Hughes
2d5186622c Add FuProgress to ->prepare and ->cleanup
Some plugins were creating local versions (which were not attached to
the daemon progress in any way) as a workaround as they needed to do
actions that took a long time to complete.
2022-04-15 16:50:06 +01:00
Mario Limonciello
b3de9ffd21 Add support for a new TrustedUids key
This key is used to specify that a dedicated user runs the fwupd
client process and sensitive strings such as the serial number should
be shared with the calling process.

(Fixes: #4524)
2022-04-14 10:30:54 -05:00
Richard Hughes
01aaa97bcd trivial: Ignore the g_unlink() in the offline runner
There's not much we can do in this situation anyway...
2022-04-13 15:08:12 +01:00
Richard Hughes
0b7af7d54b trivial: Ignore the return value of setenv() in most cases
This makes Coverity happy.
2022-04-13 15:08:12 +01:00
Richard Hughes
03d166158d trivial: Remove some logically dead code 2022-04-13 15:08:12 +01:00
Sergii Dmytruk
500dd2c9c4 fu-util: pull device flags after unlocking
To allow unlocking operation change them.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2022-04-13 09:05:37 +01:00
Richard Hughes
63f2e9ee28 Allow 'fwupdmgr install' to install a specified firmware version
This also moves the 'local-install' action to a new verb, although we
fall back for compatibility.

Fixes https://github.com/fwupd/fwupd/issues/4514
2022-04-12 19:53:38 +01:00
Richard Hughes
55605a0d5e trivial: Split out CLI functionality for future use 2022-04-12 19:53:38 +01:00
Richard Hughes
f4fe33756a trivial: Use the FwupdRelease when sending reports 2022-04-12 19:53:38 +01:00
Richard Hughes
386fbb34c7 trivial: Connect the device signals in one place only 2022-04-12 19:53:38 +01:00
Mario Limonciello
7526d1b183 Add a new attribute for fused platform
Fused parts are unable to be tampered with.
2022-04-12 10:39:02 -05:00
Mario Limonciello
0e3e8ff610 trivial: change Intel debug attributes to generic
As other platforms have features with the same attribute, remove
the Intel generic one.
2022-04-12 10:39:02 -05:00
Mario Limonciello
9adb5380b3 Add a new HSI attributes for SPI protections 2022-04-12 10:39:02 -05:00