Commit Graph

236 Commits

Author SHA1 Message Date
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
Richard Hughes
a30d933ac4 Show a translated warning when the server is limiting downloads 2018-05-02 13:23:49 +01:00
Mario Limonciello
5a25653177 Improve the update report message (Closes: #437) 2018-04-23 10:30:27 -05:00
Mario Limonciello
a98df55d82 Disable -Wunused-function on clang builds (Closes #467)
GLib creates two static inline functions for paramaters that may
not be used that set off warnings in clang but not gcc.

Ignore these on clang builds everywhere that
G_DEFINE_AUTOPTR_CLEANUP_FUNC is used.
2018-04-17 10:10:43 +01:00
Mario Limonciello
5e13aecef8 trivial: fu-util fix mismanaged memory
Caught by clang:

../src/fu-util.c:473:17: warning: assigning to 'gchar *' (aka 'char *') from 'const gchar *' (aka 'const char *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
	warning_markup = fwupd_remote_get_agreement (remote);
2018-04-17 10:10:43 +01:00
Richard Hughes
1fd3ecf7a3 Export fwupd_remote_get_agreement()
We need to show this agreement text in every fwupd frontend and exporting a
helper function allows us to do two things:

 * Share the semi-complicated code (and fallback) to avoid copy and pasting

 * Easily change the code in the future, for instance allowing merging Metainfo
   and AppStream metadata without updating all the front ends with new logic.
2018-04-16 16:44:27 +01:00
Richard Hughes
64da68a33b trivial: Use the same get-remotes output as the daemon expects for modify-repo 2018-04-12 08:17:08 +01:00
Richard Hughes
972f6eaba5 Allow customising the warning shown when enabling the remote 2018-04-12 08:17:08 +01:00
Richard Hughes
9e7d69ccb1 Show a warning with interactive prompt when enabling a remote 2018-04-12 08:17:08 +01:00
Richard Hughes
dfd228a132 Add enable-remote and disable-remote commands to fwupdmgr
This makes it easier to enable the LVFS on distributions where it is disabled
by default.
2018-04-12 08:17:08 +01:00
Mario Limonciello
336158a355 If no remotes are enabled try to enable the LVFS
Signed-off-by: Richard Hughes <richard@hughsie.com>
2018-04-10 20:28:36 +01:00
Richard Hughes
1901093431 Reboot using logind, not directly using systemd
This allows us to use PolicyKit, which means we will get prompted for
authorization if logged in as a user without permissions.

Fixes https://github.com/hughsie/fwupd/issues/455
2018-04-09 15:01:34 -05:00
Mario Limonciello
5dbdd0b243 Allow exiting device prompt with a "0" device too
This makes it more obvious for people that don't know about ctrl-d
2018-03-01 10:28:48 -06:00
Mario Limonciello
80d1a294d1 Allow ctrl-d out of the prompt for devices
Currently this will segfault fwupdmgr

Choose a device:
1.	8a21cacfb0a8d2b30c5ee9290eb71db021619f8b (XPS 13 9370 System Firmware)
2.	cb52b4cd86255a70d1d9e6b09c6bf00b9f876b61 (XPS 9370 Thunderbolt Controller)
<ctrl-d>

Thread 1 "fwupdmgr" received signal SIGSEGV, Segmentation fault.
fu_util_prompt_for_device (priv=<optimized out>, error=<optimized out>) at ../src/fu-util.c:315
315		return g_object_ref (dev);
2018-03-01 09:27:29 -06:00
Mario Limonciello
9e965ada49 Allow all functions that take device arguments to be prompted
As part of this ignore extra string arguments other than the device
ID for these methods.

This has two benefits:
1) No more copying and pasting device ID's for any of these methods
2) Bash completion can now show nicer output for these methods
2018-03-01 09:27:29 -06:00
Mario Limonciello
a667bfb76e Fix a crash related to when passing device to downgrade in command line
(fwupdmgr:15071): Fwupd-CRITICAL **: 09:08:55.248: fwupd_client_get_device_by_id: assertion 'device_id != NULL' failed

Thread 1 "fwupdmgr" received signal SIGSEGV, Segmentation fault.
0x000055555555c5b1 in main (argc=<optimized out>, argv=<optimized out>) at ../src/fu-util.c:2401
2401				g_print ("%s\n", error->message);
2018-03-01 09:27:29 -06:00
Richard Hughes
3f0b3f8f24 Only send success and failure reports to the server
We were getting some composite reports with 'needs-reboot' which isn't useful.
2018-02-23 12:55:51 +00:00
Richard Hughes
271f68b740 trivial: Fix critical warning when reporting history against a broken server 2018-02-14 12:45:40 +00:00
Richard Hughes
29a9e4f105 trivial: Show the 'known issue' URI by searching the message
If the report replaces an existing report we'll get two messages.
2018-02-13 20:36:58 +00:00
Mario Limonciello
a076c81a07 uefi: Log the efivar library version too into the report 2018-02-13 19:19:11 +00:00
Mario Limonciello
335c30ebd2 fu-util: Add fwupdate version to --version output 2018-02-13 09:18:30 -06:00
Richard Hughes
c9cdf1dfc8 Show the user a URL when they report a known problem
Resolves half of https://github.com/hughsie/lvfs-website/issues/43
2018-02-12 16:08:43 +00:00
Richard Hughes
50a6f7095c Offer to reboot when processing an offline update
In real user tests this was a pain point where we had to manually explain that
they needed to reboot.
2018-02-03 12:12:15 +00:00