Commit Graph

258 Commits

Author SHA1 Message Date
Richard Hughes
026d642e2b trivial: Automatically use the OFFLINE flag for devices that require it
We use the same flow for UEFI updates, and this allows it to just work...
2019-03-24 12:33:43 +00:00
Richard Hughes
809abea834 Ask to reboot after scheduling an offline firmware update 2019-03-23 11:14:44 +00:00
Richard Hughes
4ffc14f6ea Allow signing the fwupd report with the client certificate 2019-03-11 13:57:39 +00:00
Richard Hughes
2eee2582fd trivial: Fix several NULL/FALSE return mistakes 2019-03-11 13:17:55 +00:00
Richard Hughes
4499d19ba3 Move out the offline update functionality to a new binary
The offline updates environment is special, and we have to be careful to delete
the trigger before doing anything that can fail to avoid boot loops.

For this reason, split it out to a simple self-contained binary that is easy to
understand.
2019-03-08 09:45:30 -06:00
Richard Hughes
8dd4c1c4dd Allow restricting firmware updates for enterprise use 2019-03-05 19:05:07 +00:00
Richard Hughes
e1f44372ce trivial: Show the release flags when doing fwupdmgr get-releases 2019-03-04 15:11:36 +00:00
Richard Hughes
7120667ccd trivial: Move getting the SoupSession to common code 2019-03-01 10:07:50 -06:00
Richard Hughes
c77e111449 trivial: Move command line handling into common code
I'm about to use this a third time, so now is the time to refactor.
2019-03-01 10:07:50 -06:00
Mario Limonciello
96a0dd5606 Add a support for delayed activation
This is intended for devices that it is not safe to immediately activate
the firmware.  It may be called at a more convenient time instead.

Both fwupdmgr and fwupdtool support the feature.

- if called at runtime with fwupdmgr it uses the daemon
- during shutdown fwupdtool uses the pending.db to perform this feature.
2019-02-27 09:04:54 +00:00
Mario Limonciello
9b31e6f33a fu-progressbar: be more quiet when running non-interactive
If fwupdmgr or fwupdtool are scripted all the erasing of lines and
progressbars are much less useful.
2019-01-31 22:40:50 +00:00
Mario Limonciello
32241f4256 Add support for an UpdateMessage and display it in tools
The idea is that if the user should know something about the device update
"after" it's succesfully completed then the plugin can set `UpdateMessage`
for the device and a client can show it.

An example would be a device that doesn't reboot on its own and the user
needs to power cycle it manually.
2019-01-29 13:59:07 -06:00
Mario Limonciello
4f24d0bae3 When using directory remote type automatically generate metadata
The CAB files will be parsed upon `fwupd`/`fwupdtool` startup and
loaded into the daemon.
2019-01-29 09:21:54 -06:00
Mario Limonciello
706ab43898 libfwupd: Add support for new remote type "directory"
This remote will be used for automatically building metadata based
on files in a directory.
2019-01-29 09:21:54 -06:00
Mario Limonciello
3f243a9e9e fu-util/fu-tool: sync up reboot and shutdown behavior
It's currently a hodge podge of commands that can install files not
always invoking a reboot or shutdown.

Move the actual code into `fu-util-common.c` and make sure that all
`install` and `update` functions call it now.
2019-01-22 21:06:08 +00:00
Richard Hughes
f425d29a28 Show a console warning if loading an out-of-tree plugin
Fixes https://github.com/hughsie/fwupd/issues/950
2019-01-19 07:26:20 +00:00
Richard Hughes
f803964e37 Add _NEEDS_SHUTDOWN flag for devices
Some devices require the system to be powered down and back up, rather than
just being "warm" rebooted.
2019-01-17 16:35:34 +00:00
Richard Hughes
6e0c8f8742 Add per-release install duration values
These are set from the AppStream metadata and are specific to the firmware
release.

If not provided, the install duration falls back to the per-device duration
values which can be set in the quirk files.
2018-11-12 14:18:28 +00:00
Richard Hughes
ab8849aee1 Use HTTPS_PROXY if set
Apparently, most application support both the lower and upper case versions...

Fixes https://github.com/hughsie/fwupd/issues/815
2018-10-24 13:16:27 +01:00
Mario Limonciello
62f8486ffe fwupdmgr/fwupdtool: Move monitor command to fwupdtool
This command is used for monitoring events from the daemon and normally
used only by power users or developers.
2018-10-18 19:36:59 +01:00
Mario Limonciello
f6d01b16de fwupdmgr/fwupdtool: Move firmware builder from fwupdmgr to fwupdtool
This command is really a power user command and should live in
fwupdtool with similar debugging and development features.
2018-10-18 19:36:59 +01:00
Richard Hughes
481aa2a923 Port from libappstream-glib to libxmlb
The libxmlb library is much faster to query, and does not require the daemon
to parse the XML metadata at startup. It's a zero-copy mmap design that is more
modern and less clunky.

RSS has reduced from 3Mb (peak 3.61Mb) to 1Mb (peak 1.07Mb) and the startup
time has gone from 280ms to 250ms.
2018-10-17 14:41:13 +01:00
Richard Hughes
05cbb7245c Don't use AppStream-glib for version helpers
Refactor the imported version format code now we now longer need to stick to
the API mistakes of libappstream-glib.
2018-10-11 07:54:01 +01:00
Mario Limonciello
91353d48bd Stop showing the current release during updates in fwupdmgr
With handling composite CAB files this information isn't relayed to the
frontend on which release is being handled, but was rather guessed.

Avoid showing invalid information in this instance.
2018-10-10 11:24:27 -05:00
Mario Limonciello
2d4b7a5826 trivial: fu-util/fu-tool: Move --version into a common shared function
This is mostly for usage with the flatpak so it's easy to tell what
version of the flatpak is installed.
2018-09-14 18:22:38 +01:00
Richard Hughes
b08e7bc7aa trivial: Set a log domain for each file
This allows us to do something like:

G_MESSAGES_DEBUG=FuEngine ./src/fwupd
2018-09-11 18:59:05 +01:00
Richard Hughes
1d894f13cc trivial: Move the hwids debug functionality to fwupdtool 2018-08-31 16:39:09 +01:00
Richard Hughes
c440da9494 trivial: Allow running 'fwupdmgr hwids' with an optional DMI file 2018-08-31 16:39:09 +01:00
Richard Hughes
5b281e6f5e trivial: Make the 'Computer Information' match ComputerHardwareIds.exe
The BIOS release is specified in base 16, but seemingly displayed in base 10.
It's hashed with the former, so no HwIds need to change.
2018-08-31 16:39:09 +01:00
Richard Hughes
3d178befb1 Download firmware if the user specifies a URI 2018-08-31 06:07:46 +01:00
Richard Hughes
798cb062bf trivial: Refactor out functionality to get a user cachedir filename 2018-08-30 17:29:52 +01:00
Richard Hughes
898fc80fde Allow updating just one specific device from the command line 2018-08-21 12:21:50 +01:00
Mario Limonciello
f00ca2a8e0 fu-util: When processing "install" command don't try to show current_release
The frontend was never notified of the release (and didn't parse the CAB) so
it doesn't know at this time what the version of the release is and
so this shows a NULL assertion at the time.
2018-08-21 10:06:27 +01:00
Mario Limonciello
f78f66d479 trivial: Also show device title for 'install' command in fwupdmgr
Commit 171ec0d added support for 'update' and 'downgrade' operations
in fwupdmgr.  Since users can also install CAB files manually
show the titles for those too.
2018-08-13 10:03:49 +01:00
Richard Hughes
171ec0dd95 Show the correct title when updating multiple devices with one file
Multiple devices can be updated from one cabinet archive, and it would be quite
confusing just to print the first device title and then have the progressbar go
from 0..100 multiple times.

Use the existing device-changed signal to set the 'current device' and print a
new header if the device changes during the install phase.
2018-08-10 14:50:43 +01:00
Richard Hughes
02c90d8a03 Remove the unused Emacs indenting headers from all source files
Fixes https://github.com/hughsie/fwupd/issues/636
2018-08-09 12:48:04 +01:00
Mario Limonciello
ece90a4879 trivial: fu-util/fu-tool: Output a new line between devices for get-details
With composite CAB files it's difficult to see between devices when packed:
  Homepage:             http://support.dell.com/
  Vendor:               Dell Inc.
  TrustFlags:           none
Unknown Device
  Guid:                 558d18fa-5530-5fc8-9e4b-de3ee8a5eca7
  Homepage:             http://support.dell.com/
  Vendor:               Dell Inc.
  TrustFlags:           none
Unknown Device
2018-08-06 11:05:52 +01:00
Richard Hughes
a6b1d8d19c Don't potentially expose user passwords for remotes
Inspired by a patch by Mario Limonciello, many thanks.
2018-08-06 06:21:29 +01:00
Mario Limonciello
d1775bc026 uefi: Populate UpdateError with reasons that the plugin won't run
Previously if missing secure boot binaries, or invalid ESP was created the
plugin would just not load.

Now instead populate UpdateError and remove the updateble flag, but still show
the device in fwupdmgr and fwupdtool.
2018-07-17 14:30:27 +01:00
Richard Hughes
ebbb13c2b4 Remove the libfwup dependency from fwupd
In Fedora the only user of libfwupdate is fwupd and the fwupdate command line
tool. It makes sense to absorb the libfwupdate library interface into the
uefi plugin in fwupd. Benefits I can see include:

* fwupd and fwupdate are very similar names; a lot of OEMs are confused

* fwupd already depends on efivar for other things

* We are maintaining an artificial library interface

* The CI and translation hooks are already in place for fwupd

* We don't need to check for features or versions in fwupd, we can just develop
the feature (e.g. BGRT) all in one place.
2018-06-28 15:51:11 +01:00
Richard Hughes
8848675f9b trivial: Show supported device without using --show-all-devices
In the case of a device that is unlockable, but is not updatable we want to
show it by default.
2018-06-27 14:07:11 +01:00
Mario Limonciello
51308e648a Adjust all licensing to LGPL 2.1+ (Closes: #526) 2018-05-29 09:03:13 +01:00
Mario Limonciello
ba9e5b94ff Bring get-topology to fwupdtool
Also ammend the behavior of get-devices to match fwupdmgr
2018-05-22 05:44:52 +01:00
Richard Hughes
a7689dab33 trivial: Fix a compile warning when ConsoleKit and systemd are disabled 2018-05-21 14:18:52 +01:00
Richard Hughes
db7dfae566 trivial: Fix a build warning when building without ConsoleKit support 2018-05-21 14:18:48 +01:00
Richard Hughes
b597683113 Add a low-level firmware diagnostic tool
This is designed to be run as root accessing the hardware directly rather than
using the daemon. This would allow a snap or flatpak package to write firmware
even when the host fwupd daemon is too old.

Also, move the SMBIOS parsing code here as this is not needed in fwupdmgr.
2018-05-18 10:08:10 +01:00
Richard Hughes
f761640aa1 trivial: Split out some CLI functionality for future use 2018-05-18 10:08:10 +01:00
Richard Hughes
76e0f94c86 Allow the client tools to avoid writing the history database 2018-05-14 18:54:15 +01:00
Mario Limonciello
78956cc9ff fwupdmgr: Hide devices that aren't updatable by default
They are hidden from get-devices, get-updates, and get-topology
They can be viewed by adding '--show-all-devices' to command line
2018-05-07 14:08:39 -05:00
Richard Hughes
42728c4d5e Add 'fwupdmgr get-topology' to show logical device tree 2018-05-03 08:07:04 +01:00