Commit Graph

301 Commits

Author SHA1 Message Date
Richard Hughes
802bb313c6 trivial: Allow plugins to use WAIT_FOR_REPLUG in prepare and cleanup 2019-10-17 14:06:27 +01:00
Mario Limonciello
2a0e20bfaa trivial: fu-engine: Don't compare device and content checksums
Use `FWUPD_DEVICE_FLAG_CAN_VERIFY_IMAGE` to register that a content
checksum should be used.
2019-10-14 12:41:09 -05:00
Mario Limonciello
91d36095e1 fu-engine: Read all releases and convert versions when comparing
Fixes matching ESRT version to metadata version for UEFI
2019-10-14 12:41:09 -05:00
Mario Limonciello
8fa0b382fa Add new flags can-verify and can-verify-image
These are used to indicate that the device can verify checksums or
can dump an image for checksumming.
2019-10-14 12:41:09 -05:00
Mario Limonciello
e1b4d8ebcd Add a new device flag for indicating device won't come back
Devices like this can't be verified that the version was updated
until they're manually put into the correct mode by the user.
2019-10-12 14:07:34 -05:00
Richard Hughes
731875af86 Remove FU_PLUGIN_RULE_REQUIRES_QUIRK as all the plugins now use it 2019-10-09 20:02:16 +01:00
Richard Hughes
d8a8d5e776 Set all FuUdevDevice plugins to use FU_QUIRKS_PLUGIN
This speeds up startup as we're only calling fu_plugin_udev_device_added() on
plugins that can actually handle the device.
2019-10-09 20:02:16 +01:00
Mario Limonciello
d70260692f trivial: fu-engine: fix never reporting remotes
```
Uploading firmware reports helps hardware vendors to quickly identify failing and successful updates on real devices.
Upload report now? (Requires internet connection):
0.	Do not upload reports at this time, but prompt again for future updates
1.	Do not upload reports, and never ask to upload reports for future updates
2.	Upload reports just this one time, but prompt again for future updates
3.	Upload reports this time and automatically upload reports after completing future updates
1
key ReportUri not supported
```
2019-10-07 05:36:22 -05:00
Mario Limonciello
34c366aab2 Add support for automatically uploading reports 2019-09-30 16:21:23 -05:00
Richard Hughes
868db4e1a8 Export the instructions for detaching the device
Somewhat embarrassingly we were not actually showing the 8bitdo manual detach
images because... we were not actually exporting them. I don't know how this
ever worked in GNOME Software, but it would also explain the low 'success' rate
of the 8bitdo firmware on the LVFS.

This will also be used by Logitech in the future for the C1 Unifying devices.

To work in gnome-softare, this also needs the matching functionality to call
gs_app_add_screenshot() with the new exported data.
2019-09-26 16:40:12 +01:00
Richard Hughes
e37575192d Do not enumerate physical devices when running the internal self tests
We don't need to enumerate USB and UDev devices in the self tests. In the case
where the probe fails (due to a permissions error, as not running as root) we
don't want the tests to fail.
2019-09-25 04:49:52 -05:00
Richard Hughes
0917fb6aec Export the salted machine ID as a daemon property 2019-09-23 17:34:47 +01:00
Richard Hughes
0ad59cbc03 Support <issues> in AppStream metadata
When the LVFS switches over to outputting <issues> rather than appending to the
update description we need to be in a position to display the new data.
2019-09-17 13:48:44 +01:00
Mario Limonciello
20cc9eebc5 Try to only show DMI product name once
* libfwupd: export new property HostProduct
* clients: Use this property for setting the title of trees

Before:
```
○
├─XPS 13 7390 TPM 2.0:
│     Device ID:           c56e9f77cfee65151bdef90310776f9d62827f5a
│     Summary:             Platform TPM device
│     Current version:     7.2.1.0
│     Vendor:              Dell Inc.
│     Update Error:        Updating disabled due to TPM ownership
│     Flags:               internal|require-ac|registered
└─XPS 13 7390 System Firmware:
      Device ID:           b6c08fb9e5384d9d101853cc1ca20cf0ce2df2e2
      Current version:     0.1.1.1
      Minimum Version:     0.1.1.1
      Vendor:              Dell Inc.
      Flags:               internal|updatable|require-ac|registered|needs-reboot

```

After:
```
XPS 13 7390
│
├─TPM 2.0:
│     Device ID:           c56e9f77cfee65151bdef90310776f9d62827f5a
│     Summary:             Platform TPM device
│     Current version:     7.2.1.0
│     Vendor:              Dell Inc.
│     Update Error:        Updating disabled due to TPM ownership
│     Flags:               internal|require-ac|registered
└─System Firmware:
      Device ID:           b6c08fb9e5384d9d101853cc1ca20cf0ce2df2e2
      Current version:     0.1.1.1
      Minimum Version:     0.1.1.1
      Vendor:              Dell Inc.
      Flags:               internal|updatable|require-ac|registered|needs-reboot
```
2019-09-05 11:22:39 -05:00
Richard Hughes
f679e5efa8 Include the kernel release as a runtime version
Although not always useful (due to patches being backported) being able to
depend on a specific kernel version might save our bacon in the future.
2019-08-28 15:52:50 +01:00
Mario Limonciello
6ff8a16390 trivial: Adjust daemon device sorting
This should output devices by priority followed by name instead now.
2019-08-27 15:39:29 +01:00
Richard Hughes
5e952ce35f Add a ->udev_device_changed plugin vfunc
This allows plugins to rescan hardware based on uevents of any device class
registered with fu_plugin_add_udev_subsystem().

Additionally, the events are rate limited to avoid causing lots of extra plugin
processing when replugging hardware.
2019-08-26 13:55:55 +01:00
Mario Limonciello
263cab99e9 fu-engine/fu-config: Reload metadata store when configuration changes
Emit a signal from FuConfig object that is caught by FuEngine to
reload the store.

This should fix problems with Fedora CI failing.
2019-08-21 22:05:24 +01:00
Richard Hughes
aaf0ce788f Allow specifying <firmware>GUID</firmware> to check any version exists
If the version is not specified then treat it as just 'exists'.
2019-07-16 18:27:52 +01:00
Richard Hughes
4266ac4765 Add a specific error code for the low battery case
Users are getting confused when they're being told that AC power is required
when they are already on AC power... but the battery is too low to perform the
update.
2019-07-11 09:31:34 -07:00
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
5cbb5cf908 Allow using --force to trigger a duplicate offline update 2019-05-07 14:30:07 +01:00
Mario Limonciello
12a016b939 trivial: Only apply SmbiosManufacturer to release version for internal
External devices may not use the same VersionFormat.
2019-04-30 09:27:08 +01:00
Richard Hughes
5079f26f0e Never guess the version format from the version string
This leads to madness, as some formats are supersets of the detected types,
e.g. 'intel-me' is detected as 'quad' and 'bcd' is detected as 'pair'.

Where the version format is defined in a specification or hardcoded in the
source use a hardcoded enum value, otherwise use a quirk override.

Additionally, warn if the version does not match the defined version format
2019-04-30 09:25:41 +01:00
Richard Hughes
c84b36c541 Export the version-format to clients
This allows a vendor to verify the VersionFormat of a device without running
the daemon in verbose mode.
2019-04-30 09:25:41 +01:00
Mario Limonciello
253b825e6b fu-engine: Check if VersionFormat is ambiguous when adding devices
Set `UpdateError` in this case, and prevent updates.

If the `VersionFormat` is not known, then the device will later have
problems installing firmware with errors like:
```
failed to get release version: version format unset and version 13000001 ambiguous
```

or

```
Firmware version formats were different, device was '(null)' and release is 'plain'

```

This generally should be corrected by quirking the device.
2019-04-25 10:26:02 -05:00
Richard Hughes
7886c086a1 Don't upload reports when the user has configured their system in a broken way
I'm getting a bit fed up with failed reports from arch users where they just
have a broken system. I don't think it's useful to upload to the LVFS or notify
the vendor about failures like this.
2019-04-18 22:06:01 +08:00
Mario Limonciello
38027e696b Allow setting the daemon verbose domains at runtime 2019-04-17 12:12:13 -04: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
2c40b3734f Use the device version format when converting the release version
This is arguably the more correct fix, regardless of the UEFI quirk use as each
release was reading and converting the exact same property from the component.

Fixes https://github.com/hughsie/fwupd/issues/1156
2019-04-17 12:11:45 -04:00
Richard Hughes
21ab7f588c Set the VersionFormat using the metadata or the UEFI quirk
This allows existing Dell firmware to not ship a LVFS::VersionFormat key and
instead use the existing SmbiosManufacturer quirk.
2019-04-17 12:11:45 -04:00
Richard Hughes
75449d9db1 trivial: Return the superclassed FuDevice from fu_engine_get_details()
This allows us to print the daemon-specific properties like VersionFormat when
debugging. The caller can continue to operate on the subclassed FwupdDevice
without changes.
2019-04-17 12:11:45 -04:00
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
Mario Limonciello
6c0e9ce6b4 fu-engine: When removing activation flag match the correct version 2019-04-09 04:24:15 -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
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
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
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
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
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
f517c9aa09 Allow running offline updates when in system-update.target 2019-03-23 10:45:52 +00:00
Richard Hughes
6109652f5a trivial: Remove some dead code
Found using Coverity.
2019-03-18 16:36:30 +00:00