Commit Graph

1221 Commits

Author SHA1 Message Date
Richard Hughes
cce6a1cb5a Do not report transient failures
We don't need to report failures to do with AC or battery level to the LVFS.
2019-04-17 08:20:44 +08:00
Richard Hughes
456328072b Detect version number like RQR24.06_B0030 as 'plain'
Failing the semver checks we want to fall back to PLAIN, rather than UNKNOWN.

Fixes https://github.com/hughsie/fwupd/issues/1151
2019-04-16 11:32:03 -04:00
Mario Limonciello
6c0e9ce6b4 fu-engine: When removing activation flag match the correct version 2019-04-09 04:24:15 -04:00
Richard Hughes
ce3cea8cb4 Require --force to install a release with a different version format
If the user is trying to install version '20190104' on something with the
existing version '1.2.3' then something has gone wrong. Ensure the device
release version format matches the release version format and fail to apply the
update if this is not true.

In the common case setting the version with fu_device_set_version('1.2.3')
would set the version format to TRIPLET, and setting <release version='1.2.3'>
so no action is required. In cases where the version format could be ambiguous
then the format should be set both in a quirk and also in the metainfo file.
2019-04-09 04:16:32 -04:00
Richard Hughes
0b3e9fdb96 trivial: Allow detecting unsupported version formats in _from_string() 2019-04-09 04:16:32 -04:00
Richard Hughes
3d280caf4a Match the old or new version number when setting NEEDS_REBOOT
Some devices update then need a reboot, and other reboot to update.
2019-04-09 04:16:32 -04:00
Richard Hughes
8fc8985224 trivial: Add the missing 'pair' version format to the string helpers 2019-04-09 04:16:32 -04:00
Mario Limonciello
a90dba7ab2 trivial: Copy the version format from donor devices 2019-04-09 08:31:45 +01:00
Richard Hughes
5b715e1dc3 Make an error message clearer when there are no updates available
Fixes some of https://github.com/hughsie/fwupd/issues/767
2019-04-09 15:23:10 +08:00
Richard Hughes
b62c3a4fae Add support for the not-child extension from Logitech
This ensures that child devices are updated before the receiver as the update
protocol may be changed during the update.

Fixes https://github.com/hughsie/fwupd/issues/1139
2019-04-09 15:23:10 +08: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
Mario Limonciello
fe593944a9 fu-tool: Port get-history command to fwupdtool 2019-04-03 14:37:25 -05:00
Richard Hughes
dbeba37def Recreate the history database if migration failed
If the history database is corrupt or the daemon crashed during the migration
the history object fails to load, which in turn fails the daemon startup.

Rather than leaving the user with a broken system (which also shows UI to that
effect in gnome-software) delete the existing file and start afresh. Nothing
in the history database is that important anyway.
2019-04-03 14:01:21 -04:00
Aleksander Morgado
f9843b427e trivial: fix running tests with gnutls < 3.6 2019-04-01 14:36:25 -05:00
Richard Hughes
54e00a3939 Return the newest device when using fu_history_get_device_by_id()
Always return the newest-created device when there are multiple results.

Might fix https://github.com/hughsie/fwupd/issues/1118
2019-03-28 09:23:56 -05:00
Richard Hughes
f3dc1621bc Shut down the daemon if the on-disk binary is replaced
If we update fwupd 'live' rather than from an ostree or offline update then
kill the running instance unless a firmware update is ongoing.

When users update fwupd at runtime they often forget to restart the fwupd daemon
and say that the update didn't fix it when actually they using the the old code.
2019-03-27 09:54:06 -04:00
Mario Limonciello
4bae7a2fa8 Fix version comparisons after reboot for some formats
Otherwise comparison like this don't work out properly:
`13000000` -> `0.198.23872`
2019-03-27 09:51:44 +00: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
12a021d2d2 trivial: Add context to a translatable string
Different verb conjugations are needed for pt_BR.
2019-03-27 09:23:58 +00:00
Mario Limonciello
035818b274 fu-tool: save history from stuff installed with fwupdtool
This is a vestigate of `fwupdtool` originally only being used for
`install-blob`.  Now that it can do a local `update` command and
local `install` command, it's important to update the history
database from `fwupdtool` as well.
2019-03-26 11:46:58 -05:00
Richard Hughes
5e4bf9dc15 offline: Be more graceful when dealing with Plymouth failures
Older versions of Plymouth are more fragile and we can sometimes block the
offline process waiting for the splash to appear.

Use the new system-upgrade and reboot modes, falling back to older modes if
unavailable, showing text on stderr if Plymouth is either not installed or just
not working.
2019-03-25 14:18:30 -05:00
Richard Hughes
848cefdca9 trivial: Make the self test logs less verbose 2019-03-25 14:18:30 -05:00
Richard Hughes
bd6966b241 trivial: Move another self test -> slow() 2019-03-25 14:18:30 -05:00
Richard Hughes
994b4d9532 Save the new version in the history database for offline updates
This allows us to write the downgrade/upgrade text correctly in fwupdoffline.
2019-03-25 16:59:48 +00:00
Richard Hughes
f8e353ea5a trivial: Do not write the failure item just before we write the offline one
There's literally no point, it's going to get nuked when the new one is added.
2019-03-25 16:59:48 +00:00
Richard Hughes
81d7a5ce7c trivial: Split out a helper function
No logic changes
2019-03-25 16:59:48 +00:00
Richard Hughes
b9bbe4c00d trivial: Save the container checksum in the database correctly 2019-03-25 16:59:48 +00:00
Richard Hughes
ba28a58cb9 trivial: Allow downgrading in the offline updater
We've already done the permissions check in the scheduler, and allowing
downgrade allows the user to go back to a working version in the event of a
regression.
2019-03-24 21:27:00 +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
ce7562712e trivial: Return upgrades for devices that are only available offline
Logically, an OFFLINE update is just like a UEFI update, and we return those...
2019-03-24 12:21:34 +00:00
Richard Hughes
e6280655c4 Allow forcing an offline-only update on a live system using --force 2019-03-24 08:08:32 +00:00
Richard Hughes
e1762474ce Do not schedule an update on battery power if it requires AC power
This stops us scheduling an update that has FWUPD_DEVICE_FLAG_REQUIRE_AC when
on battery power, as we don't show messages when in the offline updates mode.

Of course, we still check for AC when we reboot, but the common case is where
we reboot into the offline mode just after we schedule the update without
changing the hardware configuration.
2019-03-23 18:06:52 +00:00
Richard Hughes
86923b95e9 trivial: Fix CI failure by using the correct enum type 2019-03-23 13:57:51 +00:00
Richard Hughes
1dfc367ba2 Update Plymouth when updating pending firmware
Some updates take some time to deploy, so we need to update the UI to avoid the
user thinking it's just hung.
2019-03-23 12:00:26 +00:00
Richard Hughes
809abea834 Ask to reboot after scheduling an offline firmware update 2019-03-23 11:14:44 +00:00
Richard Hughes
db69c81e86 trivial: Show the progressbar properly when scheduling complete 2019-03-23 10:52:47 +00:00
Richard Hughes
484ee298da Do not fail when scheduling more than one update to be run offline 2019-03-23 10:52:14 +00:00
Richard Hughes
f517c9aa09 Allow running offline updates when in system-update.target 2019-03-23 10:45:52 +00:00
Richard Hughes
42a1b9aea3 trivial: Make testing the offline update easier by allowing reinstalls
Only refuse to schedule an offline update if the device is already pending.
2019-03-21 20:58:42 +00:00
Richard Hughes
8356a83c4a trivial: Fix potential critical when converting empty object to GVariant 2019-03-21 17:15:43 +00:00
Richard Hughes
2da42d3cd4 trivial: Add fu_device_set_firmware_size()
This allows us to set the value where the blob has to be a specific size.
2019-03-21 10:31:35 +00:00
Richard Hughes
2aad104473 trivial: Add fu_common_bytes_compare() 2019-03-21 10:28:20 +00:00
Richard Hughes
4c6d61dc3a trivial: Add fu_device_get_firmware_size_min() 2019-03-21 10:27:08 +00:00
Richard Hughes
36999464c7 trivial: Move a useful function out of libdfu 2019-03-19 21:17:48 +00:00
Richard Hughes
c9223be26c Add optional vfuncs to allow detaching and attaching verify()
Some devices (e.g. Wacom, DFU and SuperIO) require the device to be in
'bootloader' mode before the device checksums can be populated.

Rather than each plugin handle both the open()->detach()->detach()->close()
sequence handle this in the plugin loader. It's not super-easy to do the right
thing for the failure case, and having two new dedicated vfuncs makes it a lot
simpler.
2019-03-19 20:25:26 +00:00
Richard Hughes
6109652f5a trivial: Remove some dead code
Found using Coverity.
2019-03-18 16:36:30 +00:00
Richard Hughes
1568449e69 Add a verify-update command to fwupdtool
This is useful for debugging to just read the checksum from the device.
2019-03-18 10:08:58 +00:00
Richard Hughes
11f612c1d3 trivial: Ensure the parent dir exists before saving the verify silo 2019-03-18 10:08:58 +00:00