Commit Graph

143 Commits

Author SHA1 Message Date
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
7a3df4bb07 fu-tool: Show UpdateMessage if applicable for install command
When calling with a CAB as an install argument, this needs to be
manually populated since the release won't be built.
2019-01-31 13:54:01 -06: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
1e35e4c22d fu-tool: Port the get-updates command over
Now that there is actually support to load non-static information
(at least from fwupd perspective) it makes sense to support this
command in both tools.
2019-01-29 09:21:54 -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
51ddf18faa When generating a CAB Silo use the prefix "components"
This makes fu_engine_get_details use a more standard prefix.
2019-01-28 09:52:37 +00: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
Mario Limonciello
46aaee8cec fu-tool: Add support for an 'update' command to fwupdtool
This will perform updates with all currently present metadata.

It is "intended" for usage with local metadata repositories referring
to local files.

fwupdtool however does also support fetching a file from the web
and if the metadata refers to the file on the web it should also work
for that.
2019-01-11 12:59:00 +00:00
Mario Limonciello
67b82af7f8 trivial: fu-tool: Try to stop systemd even if not compiled with systemd
This allows the flatpak (which is compiled without systemd) to be able
to stop the running system daemon.
2018-11-02 06:47:47 -05:00
Mario Limonciello
137de52927 trivial: fu-tool: use g_variant_unref instead of g_object_clear
For dbus call to stop unit.
2018-11-02 06:47:47 -05: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
Mario Limonciello
e61c94dd25 fu-tool: Stop any running daemon over dbus before loading engine
This helps to prevent conflicts of the daemon trying to claim devices
at the same time as the tool.
2018-10-16 13:06:23 -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
Mario Limonciello
fde4773294 fu-tool: Import debugging options from fu-debug like fu-main 2018-09-11 18:59:05 +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
2a679cd3b5 trivial: Open the device in fwupdtool before attaching and detaching 2018-09-05 15:32:38 +01:00
Richard Hughes
1d894f13cc trivial: Move the hwids debug functionality to fwupdtool 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
Mario Limonciello
cc50e1ab5b fu-tool: Fix a segfault caused by cleanup of USB plugins
This is the same problem that happened with 3f9a1c182a.
The USB plugins got closed but left a dangling reference to a device.
2018-08-15 06:33:37 +01:00
Mario Limonciello
e10cb70395 trivial: Remove now-unnecessary device-changed callback
In verbose mode this actually makes the progressbar not work as
well and is not needed since the device changed does come with the
progress bar.
2018-08-13 09:58:45 +01:00
Mario Limonciello
9eb66fe274 Show composite update titles in fu-tool too
Commit 171ec0dd95 added this information for 'update' and 'downgrade'
operations in fwupdmgr but forgot to add for the 'install' and 'install-blob'
operations of fwupdtool
2018-08-13 09:58:34 +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
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
dbd8c76eb8 Run a plugin vfunc before and after all the composite devices are updated
Now we can update multiple devices (in multiple plugins) using one firmware
archive we need a way to cleanup after all the plugins have been run.

Fixes https://github.com/hughsie/fwupd/issues/561
2018-06-18 16:06:15 +01:00
Mario Limonciello
b72aa8c813 fu-tool: Show errors if unable to access directory
When running in the sandbox this will make it more apparent why files
couldn't be opened.
2018-06-08 16:41:08 -05:00
Piotr Drąg
472fa59b5f trivial: Fix typo in “Watch for hardare changes” 2018-06-06 14:53:51 +01:00
Mario Limonciello
716ab27c17 Add get-details command to fwupdtool 2018-05-29 13:35:44 -05:00
Richard Hughes
0d1577e85e trivial: Fix 'fwupdtool get-topology' 2018-05-29 13:59:26 +01:00
Mario Limonciello
51308e648a Adjust all licensing to LGPL 2.1+ (Closes: #526) 2018-05-29 09:03:13 +01:00
Mario Limonciello
8949e8977a trivial: Initialize engine in fwupdtool install function 2018-05-25 14:08:29 +01:00
Mario Limonciello
b900c09ced trivial: add bash completion for get-plugins 2018-05-22 16:03:14 -05:00
Richard Hughes
c02ee4da46 Allow whitelisting plugins in fwupdtool
When developing code it's really convenient to only run the new plugin. This
means you don't have to wait for the other hardware to initialize and there
are no side-effects from other plugins when installing firmware.

You can specify multiple plugins as globs, for instance:

    fwupdtool get-devices \
        --plugin-whitelist wacom \
        --plugin-whitelist "thunderbolt*"
2018-05-22 16:03:14 -05:00
Richard Hughes
8c71a3f2e9 Add a get-plugins command to fwupdtool
This returns the list of currently enabled plugins.
2018-05-22 16:03:14 -05: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
460226a9a8 trivial: Allow setting install flags on the CLI for fwupdtool 2018-05-21 21:23:45 +01:00
Richard Hughes
a36c9cfee1 trivial: Add the 'install' command to fwupdtool 2018-05-21 21:23:45 +01:00
Richard Hughes
98ca99355f Allow fwupdtool to do common low-level operations without the daemon 2018-05-18 10:24:10 +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