Commit Graph

369 Commits

Author SHA1 Message Date
Richard Hughes
3d00522dd3 Check if the system is offline during install, rather than at startup
This splits out the systemd functionality to a new file, but makes no other
logic changes.
2019-05-18 08:02:29 -07:00
Richard Hughes
54e636e96d Prompt the user to shutdown if requried when installing by ID
This matches what is done in the update-all and install cases.
2019-05-18 14:07:23 +01:00
Richard Hughes
1877e8682c trivial: Allow using --force to use the wrong daemon version 2019-05-18 14:07:05 +01:00
Mario Limonciello
81d83c416c fu-util: Check the daemon version is at least the client version 2019-05-08 10:05:31 -05:00
Mario Limonciello
88f8b7f8e1 fu-util: Check that daemon is started by expected unit
Unexpected behaviors can happen if:
* a snapped daemon is running with a packaged frontend
* a packaged daemon is running with a snapped frontend

This should make sure that if the snap is installed on top of a
packaged frontend that people don't try to mix and match as much.
2019-05-08 10:05:31 -05:00
Richard Hughes
acfa4ef012 Display the remote warning on the console in an easy-to-read way
The lines are almost impossible to read as they are not wrapped and not
delimited from the normal script output. Add a box around to make them stand out:

    ╔══════════════════════════════════════════════════════════════════════════════╗
    ║ The LVFS is a free service that operates as an independent legal entity and  ║
    ║ has no connection with Fedora. Your distributor may not have verified any    ║
    ║ of the firmware updates for compatibility with your system or connected      ║
    ║ devices. All firmware is provided only by the original equipment             ║
    ║ manufacturer.                                                                ║
    ║                                                                              ║
    ║ Enabling this functionality is done at your own risk, which means you have   ║
    ║ to contact your original equipment manufacturer regarding any problems       ║
    ║ caused by these updates. Only problems with the update process itself        ║
    ║ should be filed at https://bugzilla.redhat.com/.                             ║
    ║                                                                              ║
    ╚══════════════════════════════════════════════════════════════════════════════╝

    Agree and enable the remote? [Y|n]:
2019-05-01 14:03:11 +01:00
Mario Limonciello
bfcf75b7a6 Allow fwupdmgr to modify the daemon config
This allows several things, for instance:

 * Adding or removing blacklisted plugins or devices
 * Changing the idle timeout where allowed

...without a user needing to manually modify a configuration file.
2019-04-17 12:12:13 -04:00
Richard Hughes
dce91204c9 Fix some typos spotted using codespell 2019-04-08 12:47:53 +01:00
Richard Hughes
02ac92c17c Add a component categories to express the firmware type
Some firmwares only update one part of the system, e.g. the EC or ME firmware.
Other updates include all the updates needed for the whole system, and vendors
have been doing different things with the component name due to this.

To fix, add an enumerated set of firmware 'categories' that can be set by the
uploader in the metainfo.xml file (or changed the LVFS) which automatically
set the name suffix.

Only append the translated version in the client when <categories> has
not been set, as the LVFS is still operating in compatibility mode and setting
the <name> with the prefix. Add the support to fwupd now so we can switch in
about 9 months time.
2019-04-04 17:35:02 -04:00
Richard Hughes
7eb1e92837 trivial: Use plural form for an ambiguous translatable string
In pt_BR there are plural form of both words firmware and approved.
2019-03-27 09:30:56 +00:00
Richard Hughes
0cbd149b7a Show the DeviceID when showing the updates list
This allows us to only update the device we want on the command line, rather
than having to run 'fwupdmgr get-devices' to get the specific ID.
2019-03-24 12:33:43 +00:00
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
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
Piotr Drąg
27cd91f559 Use ngettext for any strings with plurals 2018-01-26 10:09:06 +00:00
Richard Hughes
c269e64584 trivial: Make a string extractable with xgettext 2018-01-25 12:36:01 +00:00
Richard Hughes
f06ba475b1 Ask the user to refresh metadata when it is very old
Also allow skipping the questions for non-interactive scripts.
2018-01-17 20:22:18 +00:00
Richard Hughes
0d2320735d Nag the user to upload reports when doing common operations
This is supposed to be a gentle nag, rather than being obnoxious. To disable
this, simply remove the ReportURI key from the relevant remote.
2018-01-11 21:31:29 +00:00
Richard Hughes
0a7bc97317 Add a 'report-history' command to fwupdmgr
This shares your history with a reporting server, typically the LVFS.

NOTE: no data is sent without the user opting-in, and the data sent is shown to
the user before upload.
2018-01-11 21:31:29 +00:00
Richard Hughes
d29df0819f Allow specifying the reporting server in the remote key files 2018-01-11 20:20:00 +00:00
Richard Hughes
476363ac19 Add a D-Bus method to get the history information 2018-01-11 10:08:58 +00:00
Richard Hughes
af54a0778a trivial: Add a 'clear-history' command to fwupdmgr
This needs to be run as the root user to work.
2018-01-11 10:04:50 +00:00
Richard Hughes
bc3a4e1f57 Store firmware update success and failure to a local database
Rename FuPending to FuHistory to better represent what the object is now doing.
Also, while we're here, switch to using SQLite prepared statements to avoid a
possible invalid read on i386 hardware.
2018-01-11 09:59:34 +00:00
Richard Hughes
696e6fdcf3 trivial: Don't allow deleting the pending database
If we're going to use this for history we have to be a little more subtle.
2018-01-11 08:16:25 +00:00
Richard Hughes
718be2de6b trivial: Prefer https_proxy for metadata downloads 2018-01-11 08:16:18 +00:00
Richard Hughes
74fa2ca635 Fix firmware downloading using gnome-software compiled against fwupd 1.0.x
Always set the AppStream app properties on the FwupdRelease. In some cases we
were returning FwupdRelease objects with no name or summary which gnome-software
was ignoring.
2018-01-10 21:37:43 +00:00
Richard Hughes
d980ccb757 trivial: Do the fwupdmgr network setup in a new function
This is for future use by other commands.
2018-01-08 16:57:01 +00:00
Richard Hughes
054b68457d trivial: Use the shared FwupdClient when monitoring 2018-01-08 16:56:56 +00:00
Richard Hughes
8f89cf04fb Add more metadata to the user-agent string 2017-12-21 08:25:29 +00:00
Richard Hughes
86914c52da trivial: Fix whitespace issue 2017-11-28 14:14:36 +00:00
Richard Hughes
78c8411253 Use the correct remote-specified username and passord when using fwupdmgr
Spotted by clang, many thanks.
2017-11-09 12:17:24 +00:00
Richard Hughes
3b84753769 Use help2man to generate the man page at build time
The man pages are always old and out-of-sync with the actual tool, so just
generate them using the output of --help.

Fixes https://github.com/hughsie/fwupd/issues/285
2017-10-23 16:47:08 +01:00
Richard Hughes
7f6d78fb1b Add fwupd_remote_get_checksum() to use in client programs 2017-09-28 09:23:52 +01:00
Richard Hughes
b2fb80925c trivial: Remove fwupd_remote_get_filename()
The data for these was just being generated internally based on the ID and the
basename of the original URI, and that's easy for the calling application to do
itself.
2017-09-28 09:23:52 +01:00
Richard Hughes
80893e29fe trivial: Remove FwupdResult from libfwupd 2017-09-28 09:23:52 +01:00
Richard Hughes
b86ef97b36 trivial: Remove fwupd_remote_build_uri()
This also removes the long-deprecated fwupd_remote_get_uri() and fwupd_remote_get_uri_asc()
2017-09-28 09:23:52 +01:00
Richard Hughes
ba73c76d69 trivial: Remove the deprecated fwupd_client_update_metadata()
Also, rename fwupd_client_update_metadata_with_id() to it's now-removed counterpart.
2017-09-28 09:23:52 +01:00
Richard Hughes
07f963a52d trivial: Remove the deprecated fwupd_client_get_details()
Also, rename fwupd_client_get_details_local() to it's now-removed counterpart.
2017-09-28 09:23:52 +01:00
Richard Hughes
eb94c14022 trivial: Remove the deprecated fwupd_client_get_devices()
Also, rename fwupd_client_get_devices_simple() to it's now-removed counterpart.
2017-09-28 09:23:52 +01:00
Richard Hughes
820dac7fde trivial: Use a different SYSFSFIRMWAREDIR for self tests
This means we can drop some self-test specific code in fu_smbios_setup().
2017-09-16 17:46:41 +01:00
Richard Hughes
f11fa3caac trivial: Use the new fwupd_client_get_upgrades() in fwupdmgr 2017-09-15 14:12:18 +01:00
Richard Hughes
97284b1ad8 Move the downgrade calculation to the daemon 2017-09-15 14:12:18 +01:00
Richard Hughes
6ab53111db Never fallback to an offline update from client code
UEFI updates don't need to be retried since a785a1c. If the call to Install()
failed with NOT_SUPPORTED we can just show the error rather than doing the
little dance and involving the offline pending database for no reason.

Fixes some of https://github.com/hughsie/fwupd/issues/255
2017-09-15 09:35:27 +01:00
Richard Hughes
31bbd1691b Add a command 'clear-offline' to fwupdmgr
This allows us to 'unschedule' any offline updates.
2017-09-15 09:33:06 +01:00
Richard Hughes
ba15eebabb trivial: Show the RemoteID when printing available releases 2017-09-14 10:26:15 +01:00
Richard Hughes
a1aab517d1 Move the update state to FwupdDevice
It only remained on FwupdResult because I couldn't make up my mind about whether
it was a property of the device, or the firmware release. It's more logically
the former, and that's how plugins are using it.
2017-09-13 14:59:32 +01:00
Richard Hughes
48ad97fd61 Add a human-readable title for each remote
This allows us to show something useful in a GUI.
2017-09-10 09:08:32 +01:00
Richard Hughes
a6bd5580d3 Add ModifyRemote as an easy way to enable and disable remotes like the LVFS
For example:

    $ fwupdmgr modify-remote lvfs-testing Enabled true
2017-09-07 23:02:58 +01:00
Richard Hughes
49e5e05aa8 Parse the SMBIOS DMI table directly
The Linux DMI class still does not provide the information we need, and parsing
the blob directly also allows the Dell and Redfish plugins to get the raw data.
2017-09-05 18:10:36 +01:00
Richard Hughes
f315719851 trivial: Fix up a literal format string in fwupdmgr 2017-08-31 20:00:01 +01:00
Richard Hughes
1f92addd10 trivial: Remove unused function in fwupdmgr
Fixes 2nd half of https://github.com/hughsie/fwupd/issues/209
2017-08-30 10:51:51 +01:00
Richard Hughes
c6afb51e32 Add a FirmwareBaseURI parameter to the remote configs
This allows somebody to mirror the CDN without resigning the metadata files.

Fixes: https://github.com/hughsie/fwupd/issues/186
2017-08-23 14:22:12 +01:00
Richard Hughes
0dea1efb92 Use MetadataURI for both kinds of remote
I think this is clearer having one key for both types of remote.
2017-08-23 14:22:08 +01:00
Richard Hughes
9a7db9df7d Show a bouncing progress bar if the percentage remains at zero
Device actions like a Thunderbolt replug can take 25 seconds (!) and so it's a
good idea to show the user that the calling process is still alive.
2017-08-21 15:51:38 +01:00
Richard Hughes
99e621d388 Save the metadata signature in the local cache
This is useful if the admin wants to re-verify the metadata, or if a public
key is removed or expires.
2017-08-16 13:42:10 +01:00
Richard Hughes
7ee42feb83 trivial: Add common function for making required parent directories 2017-08-15 15:35:36 +01:00
Richard Hughes
7403dc505f Optionally use GnuTLS to verify PKCS7 certificates
We can use this as an alternative for GPG. No PKCS7 certificates are currently
installed by fwupd and it's expected that the LVFS will still only provide GPG
detached signatures.

If an OEM distributor wants to sign firmware with a PKCS7 and the corresponding
certificate is provided then the firmware will be marked as valid.

Only firmware shipping with a .p7b file will use the PKCS7 functionality,
similarly remote metadata validation will default to GPG unless Keyring=pkcs7
is specified in the config file.
2017-08-14 09:42:48 +01:00
Richard Hughes
0724d8bde0 trivial: Bump the appstream-glib requirement to 0.6.13 2017-08-09 17:21:48 +01:00
Richard Hughes
41cbe2aab3 Add a firmware builder
This runs a script inside the firmware archive to generate firmware specific to
the machine. This uses bubblewrap to protect the local machine.
2017-08-09 10:33:39 +01:00
Richard Hughes
2d95a71a0c Support embedded devices with local firmware metadata
In this mode, both the metadata and firmware is stored on the local filesystem
and distributed using a distribution system like OSTree.

Fixes https://github.com/hughsie/fwupd/issues/162
2017-07-28 17:41:24 +01:00
Richard Hughes
ba51279752 trivial: Fix two tiny leaks in fwupdmgr 2017-07-27 16:32:43 +01:00
Mario Limonciello
9ac53e28b1 Add information about compile-time dependency versions
Since the codebase looks at these versions for turning on and off
functionality it will be useful to use this for debugging
2017-07-24 15:30:28 -05:00
Mario Limonciello
dc8c985159 trivial: back the requirement on appstream-glib to 0.6.9
The items that 0.6.13 requires are now guarded by a version test.
This should allow running fwupd master on more distros that haven't
yet picked up appstream-glib 0.6.13.
2017-07-10 14:32:42 -05:00
Richard Hughes
b3dca14e90 trivial: Never compare a string against zero to avoid warnings 2017-07-06 18:28:01 +01:00
Mario Limonciello
b04c13e1cf Include optional git checkout information in --version
When users are running from git this should aide in
debugging if they have a fix included.
2017-07-05 17:49:50 -05:00
Richard Hughes
89483f1bb9 Add --version option to fwupdmgr
$ fwupdmgr --version
    client version:	0.9.6
    daemon version:	0.9.6

Fixes https://github.com/hughsie/fwupd/issues/153
2017-07-04 20:49:27 +01:00
Richard Hughes
b53ad36012 trivial: Fix up a number of FALSE/NULL return issues 2017-06-19 13:50:42 +01:00
Richard Hughes
feb8027ee3 Show the age of the remote metadata in 'fwupdmgr get-remotes'
Note: we have to transfer the mtime (not the age) when creating the GVariant,
as we want calls to fwupd_remote_get_age() to update the value without getting
the remote from the daemon each time.
2017-06-16 20:24:41 +01:00
Richard Hughes
0a87f6fb03 Store the metadata files rather than merging to one store
Now we have multiple remotes that can be enabled or changed at runtime we need
to do several things better:

* Only load components from remotes that are enabled

* Only load a component if a higher priority remote has not already added it

Rather than just appending all recieved metadata into one big XML file, save
the original metadata .xml.gz files in /var/lib/fwupd/remotes.d and only load
them in the correct priority order if the remote is known and enabled.

Remove the old /var/cache/app-info/xmls/fwupd.xml file, also noting it wasn't
really a cache file at all but actually something quite important.
2017-06-16 16:43:13 +01:00
Richard Hughes
4c36970445 Move the remotes parsing from the client to the server
This allows us to load the metadata stores in a more sensible way in the future.
2017-06-16 15:31:40 +01:00
Richard Hughes
f0bde3e4af Add a get-remotes command to fwupdmgr
This allows the user to show the configured remotes.
2017-06-16 14:31:20 +01:00
Richard Hughes
bbde1df44f Fix downgrades when version_lowest is set
Also, add some tests to test this with the dummy device.
2017-06-16 12:40:15 +01:00
Richard Hughes
8a870d0399 trivial: Ensure there are no updates after the update is applied 2017-06-16 12:40:10 +01:00
Richard Hughes
954de52612 trivial: Make --verbose work in fwupdmgr 2017-06-16 07:59:02 +01:00
Richard Hughes
40aeea4167 trivial: Show the release (not device) checksums in 'fwupdmgr get-updates' 2017-06-16 07:59:02 +01:00
Richard Hughes
c2a20d7fff trivial: Show the release (not device) checksums in 'fwupdmgr get-releases' 2017-06-15 20:19:03 +01:00
Richard Hughes
109526bf34 trivial: Fix a harmless warning when building RPMs 2017-06-15 11:07:00 +01:00
Richard Hughes
18b73a4bdd trivial: Return with exist code 0 when there is nothing to do 2017-06-14 15:16:06 +01:00
Richard Hughes
2899cb28d5 Show progress download when refreshing metadata 2017-06-13 16:31:18 +01:00
Richard Hughes
b86484a585 Export some more API for dealing with checksums 2017-06-09 10:11:58 +01:00
Piotr Drąg
748ae3154e trivial: Fix a typo in a translatable string (#132) 2017-06-07 16:59:40 -05:00