Commit Graph

503 Commits

Author SHA1 Message Date
Crag Wang
ae422989f3 trivial: case insensitive while explorering cabinet files
The cabinet file's extension name disregards uppercase or lowercase
2020-03-05 11:59:51 -06:00
Daniel Campello
b5ae60cc8b Do not fail loading in /etc/machine-id is not available
In Chrome OS /etc/machine-id is not available on the sandbox
environment. Chrome OS specifically rotate it constantly and is
considered PII.

Change-Id: Ia4113affa68c5973b36d196a35278a3f6cee2898
Signed-off-by: Daniel Campello <campello@chromium.org>
2020-02-28 10:54:01 -06:00
Richard Hughes
c6eb416fd5 Create FuCabinet and untangle a lot of legacy code
Replace fu_common_cab_build_silo() with an actual GObject that can hold parsing
state. This cleans up the code a lot, and means we can add additional
functionality in the future without breaking ABI or API.

The long term plan is to verify the metadata and payload signatures when
parsing FuCabinet, rather than much later in _check_requirements().
This of course requires passing in a keyring context (which we don't yet have)
and would mean we can stop setting the various confusing 'fwupd::ReleaseBlob'
XbNode extra data.

No logic changes for now, just a lot of moving things into sane places.
2020-02-27 18:06:26 +00:00
Richard Hughes
b097603800 Allow server metadata to set the version format on some devices
It appears just choosing 'if Dell then QUAD else TRIPLET' isn't good enough.
2020-02-26 15:45:40 +00:00
Mario Limonciello
8bcdfaa7e7 fu-engine: Copy the version and format from donor device in get-details 2020-02-26 08:47:43 -06:00
Mario Limonciello
f675c21827 fu-engine: Use unknown for version format by default on get-details 2020-02-26 08:47:43 -06:00
Richard Hughes
f50ff2c27e Decouple the version format from the version itself
If we say that the version format should be the same for the `version_lowest`
and the `version_bootloader` then it does not always make sense to set it at
the same time.

Moving the `version_format` to a standalone first-class property also means it
can be typically be set in the custom device `_init()` function, which means we
don't need to worry about *changing* ther version format as set by the USB and
UDev superclass helpers.
2020-02-25 14:00:09 +00:00
Richard Hughes
f43381f4a7 Allow server metadata to set the device name on some devices
This does 'bleed' the metadata contents into areas previously covered by quirks,
but in this case may be pragmatic and more up to date than a build-time
generated quirk file, which increases the user-friendliness of fwupdmgr.
2020-02-24 14:15:34 +00:00
Richard Hughes
a1f95352f5 trivial: Downgrade a warning to a debug
This cleans up the output when running fwupdtool with --plugin-whitelist...
2020-02-21 08:14:54 +00:00
Richard Hughes
d8ea8da902 Do not allow devices that have no vendor ID to be UPDATABLE 2020-02-20 16:02:44 +00:00
Richard Hughes
9a68084dbc Always check for PLAIN when doing vercmp() operations
In 1de7cc we checked the version format when checking for update, but there are
many other places that are doing verfmt-insensitive comparisons. For instance,
the predicates in <requires> all fail if the device version format is plain.
his breaks updating some NVMe drives where the `ne` requirements are not
semantic versions.

To avoid trying to catch all the bugs in different places, and in case we have
a future verfmt that should be treated another way, refactor this out in to a
common function and deprecate the old function.
2020-02-20 15:49:27 +00:00
Richard Hughes
293a64dab5 Fix a critical warning when installing some firmware
If the device replugs, then we were doing `g_set_object(&device, device_tmp)`
which worked, but had the unfortunate effect of not unwinding properly as
`device` was a function parameter rather than a local variable.

The observed effect using `watch ((GObject*)$1)->ref_count` was the refcount was
double-decremented and thus we got a critical warning on the final valid unref.
Fix this by copying the function parameter to a local variable which we can
then change if the device replugs.
2020-02-14 13:31:10 +00:00
Mario Limonciello
793099201b src: fu-engine: check version was updated by checking version
In case a plugin decides to make a version 5.3.10 instead of 5.3.010
these should match.
2020-01-22 16:23:18 -06:00
Richard Hughes
64d868a77b Correctly import PKCS-7 remote metadata
The PEM data is larger than 2kB, which was a crazy-small max size for a
signature. Make this a more respectable 1Mb so that we can load PKCS-7
signatures with full certificate info included.

This wasn't being tested in the self tests as it only affects data read from
the remote file descriptor.
2020-01-17 17:45:46 +00:00
Richard Hughes
be5b019ae5 trivial: Split up fu_engine_update_metadata() for future use 2020-01-17 16:33:07 +00:00
Mario Limonciello
d81ea2e3fc Move MOTD population into the daemon
This allows it to be refreshed anytime the daemon updates rather
than once a day by a systemd job.

As part of this change, remove the logging from `fwupdmgr` which
was only used for motd purposes.
2020-01-16 10:33:43 -06:00
Mario Limonciello
8ad4ac0de3 trivial: fu-engine: fix an assertion when system has no product ID 2020-01-15 11:32:20 -06:00
Mario Limonciello
33b40edc5f trivial: fu-engine: correct missing protocol message 2020-01-08 15:49:38 -06:00
Richard Hughes
af14073522 Allow applying all releases to get to a target version
Some hardware does not handle upgrading from version 1.2.2 to 1.2.4 and instead
needs to be upgraded from 1.2.2->1.2.3->1.2.4 so that on-device metadata can be
migrated correctly.

Add a new per-device flag `install-all-releases` which causes the daemon to not
skip directly to the newest release. This is designed to be set from a quirk
file.

This can obviously only be used for devices that can apply firmware "live" and
thus do not need a reboot or system shutdown to actually apply the firmware.
This also needs the cabinet archive to ship multiple versions of the firmware,
and for the metainfo.xml file to refer to multiple release objects.
2020-01-07 15:33:12 +00:00
Richard Hughes
4bd2e041bd Split up fu_engine_install() into two halves
No logic changes, just reshuffling.
2020-01-07 15:33:12 +00:00
Richard Hughes
7f765005e2 Add a runtime warning when adding a device without an vendor-id or protocol set
Also, allow setting the protocol in the quirk file if required.
2020-01-06 14:48:32 +00:00
Mario Limonciello
c23e61296b fu-engine: don't expose bootloader version errors to users
These messages are useful for debugging but not to users.  Many issues
get filed because they're cryptic and users can't do anything about them.

Downgrade the actual messages to debugging in the engine, and just send
back a generic message for clients.

Fixes: #1659
Fixes: #1261
2019-12-13 12:46:34 -06:00
Richard Hughes
d1808aae67 Split out the remote loading from FuConfig
It's confusing to have FuConfig load both the daemon.conf file and also keep
track of the enabled remotes. It's also wasteful of memory to keep the GKeyFile
alive the entire time.

Logically these are different pools of information and should be managed by
different objects. This allows us to implement reload() in a sane way and be
less reliant on the inotify event.
2019-12-10 21:40:31 +00:00
Mario Limonciello
7e4949c4f8 Clarify error messages when no upgrades available 2019-12-09 10:45:49 -06:00
Richard Hughes
3885789156 trivial: Don't handle a vendor-id requirement error that cannot happen
The vendor ID comparison is either 'eq' or 'regex' and 'ge' just doesn't makes
sense in this context.
2019-12-09 12:57:46 +00:00
Richard Hughes
12843af7e2 Only check the vendor ID if the device has one set
This means we don't get a weird error if the metadata sets a vendor-id, but the
device does not.
2019-12-09 12:57:46 +00:00
Richard Hughes
dad3597e76 Allow other plugins to contribute report metadata 2019-12-06 15:05:16 +00:00
Richard Hughes
45a00738d8 Allow building on Windows with MinGW
Add various fixes to enable us to build a selection of useful USB plugins.
Also, skip tests that don't make sense on WIN32 or that will not work.

With much help from Mario Limonciello <mario.limonciello@dell.com> -- Thanks!
2019-12-03 16:33:43 +00:00
Mario Limonciello
6b0e66354b Convert libfwupdprivate to a shared library libfwupdplugin 2019-11-27 11:32:43 +00:00
Richard Hughes
9e5675e1b4 trivial: Allow compiling without <glib-unix.h> 2019-11-26 17:15:45 +00:00
Richard Hughes
f3880bce26 trivial: Add some optional debugging when hotplugging devices 2019-11-26 14:14:48 +00:00
Richard Hughes
019a1bc2b0 trivial: Untangle FuHistory from FuPlugin
This will allow us to export FuPlugin in the future without dragging in the
private fu-history.h too.
2019-11-26 14:14:27 +00:00
Richard Hughes
5c508de173 trivial: Allow compiling without <fnmatch.h>
This also allows us to add a Win32 implementation if required in the future.
2019-11-26 13:13:31 +00:00
Richard Hughes
1665837e78 Make gudev a compile-time option
This should make it nearly possible to build fwupd on FreeBSD.
2019-11-25 09:29:46 +00:00
Richard Hughes
00d6f4734f trivial: Don't assume that plugins end in .so 2019-11-24 08:14:48 +00:00
Richard Hughes
fc1e267d33 trivial: Allow compiling without <sys/utsname.h> 2019-11-23 17:07:53 +00:00
Mario Limonciello
52e75ba2b6 fwupdtool: don't show a warning when calling get-plugins
The plugins are not opened for this function so of course they
won't set their build hashes.

Fixes errors like this:
`uefi should call fu_plugin_set_build_hash()`
2019-11-22 13:55:30 -06:00
Richard Hughes
f7006d2baa Add support for matching <firmware> requirements on device parents
For composite devices you might want to restrict the child device in respect
to the parent, for instance requiring the parent to have greater than a specific
firmware version number.

The other useful thing to use this for is checking if the parent has a specific
GUID (of any version) which allows us to match against the common VID&PID
instance IDs. This would allow us to restrict a generic child device update to
a specific OEM vendor parent.

This is specified as <firmware depth="1" ...> to match the parent device and
<firmware depth="2" ...> to match the grandparent device.
2019-11-14 16:25:58 +00:00
Mario Limonciello
e2b8a2797e Skip cleanup after device is done updating if will-disappear is set (Fixes: #1529)
This fixes a regression introduced by 2031ce3bf6
that leads to:
```
USB error on device 2dc8:5750 : No such device (it may have been disconnected) [-4]
```
2019-11-14 08:06:17 -06:00
Mario Limonciello
f5605532e5 trivial: fu-plugin: only show an error once
"failed to open plugin" was being prefixed twice
2019-11-05 15:36:55 -06:00
Mario Limonciello
2e06dcd5e3 trivial: 8bitdo: set a transient failure while waiting for user action 2019-11-01 14:31:03 +00:00
Richard Hughes
0bbef29d3e Always report the update-error correctly for multiple updates
The root of this problem is that we were trying to use pending.db as both a
pending report store and also a record of history, so you could see updates for
device foo 1.2.3->1.2.4 and then 1.2.4->1.2.5.
This sort-of half worked, but it meant in some cases we matched on the old
device version, sometimes on the new release version and sometimes matching on
either.

The problem was that in various places we were using the device ID as *the*
primary key, and so we had various functions like fu_history_get_device_by_id()
that expected to return just one device, not several.

The device ID also changes if the device is moved from USB plug to another, and
so it got even more complicated again trying to de-dupe the devices.

The sanest thing to do is to decide that pending.db only contains the latest
attempt to go from one version to another using device-id as the primary key.
This makes reporting work reliably now, although has the effect you can't
report a 1.2.3->1.2.4 and 1.2.4->1.2.5 at the same time. Note, if you tried to
do the latter before, the update-error (if set) would be wrong on the second
report...

For the 1.3.3 release make it all simpler and so the reporting works reliably.
Longer term we can design a better database schema that uses unique ID to
represent the *transaction* itself, that isn't tied to the device ID in any way.
This might mean extending the DBus API to cope with multiple devices being
returned with the same device-id set.
2019-11-01 08:16:18 -05:00
Richard Hughes
ec14e4bdd0 trivial: Do not emit a warning if a child has no version number 2019-11-01 08:16:18 -05:00
Richard Hughes
45a1815587 trivial: Use the new possible_plugin support for USB devices too
This matches the UDEV device add, and was missed from the original commit due
to a failed rebase.

Fixes https://github.com/fwupd/fwupd/issues/1512
2019-10-30 10:49:00 -05:00
Richard Hughes
2031ce3bf6 Ensure the device is open when doing the subclassed prepare() and cleanup()
It's not usual to open the device from inside the device, otherwise there is a
possibility of a deadlock. For devices without the ->prepare() virtual function
the ->open() should either be a NOP or very fast indeed.
2019-10-30 09:44:52 -05:00
Richard Hughes
a58510b246 Allow verifying the device image itself from fwupdtool
To debug flashing failures it's sometimes requried to get a SPI dump of the
hardware to analysis.

Add a debug-only command that lets us dump the device from the engine.
2019-10-30 13:55:55 +00:00
Richard Hughes
51a869a01d Use XMLb to query quirks
During startup we do 1898 persistent allocations to load the quirk files, which
equates to ~90kb of RSS. Use libxmlb to create a mmap'able store we can query
with XPath queries at runtime.
2019-10-30 08:29:58 -05:00
Mario Limonciello
44b9e46d37 uefi: rework ESP path detection and lifecycle
This makes the daemon less destructive at startup, especially if the ESP
is not mounted.

It's stored in 3 different places right now, so move it into one point of truth.

Now the ESP is detected when needed including all point of time safety checks and
dynamically mounted and unmounted if necessary.
2019-10-24 15:22:01 -05:00
Richard Hughes
95c98a95b6 Allow fwupdtool to dump details of common firmware formats
To do this, the plugins have to register the GType(s) they are using for
firmware, along with a short 'id' that can be used in CLI scripts.
2019-10-22 12:36:15 -05:00
Richard Hughes
8fb2e6a881 trivial: Do not do system coldplug when using FU_ENGINE_LOAD_FLAG_NO_ENUMERATE 2019-10-22 12:36:15 -05:00
Mario Limonciello
0e500321d7 fu-engine: Check multiple plugins if quirks match
`ata` and `emmc` both have block devices and so they both need to
be checked
2019-10-18 14:18:09 -05:00
Richard Hughes
791c91be1e trivial: Increase verbosity when actually updating devices
As the plugin is allowed to change print out the entire FuDevice before
performing each step when in verbose mode.

Note, these are only show during update if run with --verbose, not at startup.
2019-10-17 14:06:27 +01:00
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
Richard Hughes
11f612c1d3 trivial: Ensure the parent dir exists before saving the verify silo 2019-03-18 10:08:58 +00:00
Richard Hughes
68db74b006 Correctly get the check the new version for devices that replug
There are a lot of failures in the LVFS with 'device version not updated on
success' and this is because we were looking at the original FuDevice, rather
than the FuDevice that came back after the bootloader replug phase.

Before doing the check get the new FuDevice to prevent failing the check with
a false positive.
2019-03-14 08:50:06 -05:00
Richard Hughes
f3c7d42289 Ensure the PKCS-7 client certificate exists at startup
This ensures the certificate is always present even before the user has
generated a report or manually signed test data.

Also, if the GnuTLS version is too old just log a message and continue.
2019-03-12 08:25:22 -05:00
Richard Hughes
3d60762bed Add a D-Bus method to generate a signature using the self-signed client certificate 2019-03-11 13:57:39 +00:00
Richard Hughes
f28abe7fda Allow signing and verifying data using a PKCS-7 self-signed client certificate
This is a per-client certificate and private key that can be used to sign
metadata sent to remote servers, for instance success/failure reports.
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
88dc0f4bf0 Do not recreate XbSilo caches when running on a readonly filesystem
For my future self, to debug the fwupd.shutdown activation failure, you can do:

    mount /dev/sdc1 /mnt
    /usr/libexec/fwupd/fwupdtool activate --verbose &> /mnt/log.txt
    umount /dev/sdc1

...where /dev/sdc1 is an attached FAT32-formatted USB drive.
2019-03-07 08:28:36 -06:00
Richard Hughes
5e7017b409 trivial: Add FuConfigLoadFlags argument to fu_config_load()
No functionality changes, but allows us to do something new in the future.
2019-03-07 08:28:36 -06:00
Richard Hughes
c8cc77c1c2 trivial: Add FuEngineLoadFlags argument to fu_engine_load()
No functionality changes, but allows us to do something new in the future.
2019-03-07 08:28:36 -06:00
Richard Hughes
8dd4c1c4dd Allow restricting firmware updates for enterprise use 2019-03-05 19:05:07 +00:00
Richard Hughes
8e0cc802fe Show the upgrade and downgrade flags when getting releases for a device
This allows us to one day implement 'reinstall', allows us to have a more useful
`get-releases` command and also means we can add other reasons for blocking the
release in the future.
2019-03-04 15:11:36 +00:00
Richard Hughes
245885ca1f Rename FwupdRelease:trust-flags to FwupdRelease:flags
In the future we'll want to use this flag to signify if the release is an
upgrade, downgrade, below the version-lowest, or if it is locked in some way.
2019-03-04 13:55:31 +00: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
Richard Hughes
592baedfff Export some of the GUID functionality 2019-02-04 15:19:57 +00:00
Richard Hughes
5297678d3c Allow a plugin to set _ANOTHER_WRITE_REQUIRED to run more than one plugin
For this to work with different plugins the device IDs must match.
2019-02-04 14:54:54 +00:00
Richard Hughes
03df0d5379 trivial: Break apart fu_engine_install_blob() into sane chunks
This fixes a number of bugs, where the plugin changing was not always detected
properly. It also means we always record a error failure if _install_blob()
returns FALSE.
2019-02-04 14:54:54 +00:00
Richard Hughes
84af6e71f4 trivial: Move all the history database writing to fu_engine_install() 2019-02-04 14:54:54 +00:00
Richard Hughes
9fd7207f55 trivial: Move the update schedule to fu_engine_install() 2019-02-04 14:54:54 +00:00
Richard Hughes
afca203839 trivial: Move the history database writing to fu_engine_install() 2019-02-04 14:54:54 +00:00
Richard Hughes
c6c312f267 trivial: Move fu_plugin_runner_schedule_update() into the engine 2019-02-04 14:54:54 +00:00
Richard Hughes
2a77afcd5c trivial: Do not propagate UNKNOWN from FuDevice->FuEngine->FuMain 2019-01-30 06:10:36 -06:00
Richard Hughes
96019e815c trivial: Allow reflashing the same device more than once without restarting
Set the device status back to the default when completed flashing so that we
don't ignore the status change for the subsequent flash.
2019-01-30 06:10:36 -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
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
Richard Hughes
7185828163 Add support for a per-release source and details URL
The source URL allows us to comply with our various obligations when shipping
firmware built from GPL licensed sources. The details URL allows vendors to
include a link to a full HTML details page about the specific release.
2019-01-28 12:59:39 +00: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
Aleksander Morgado
37b985c156 Check if plugin changed after the device attaches or detaches
If the device is rebooted into a different shape, the plugin managing
the device may also be different.

This would be the case for plugins that just subclass the update_detach()
method, and leave to other plugins the actual required update procedure.
2019-01-20 20:01:40 +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
a958e1c32f trivial: Fix a potential type-check warning when setting SUPPORTED
We can't use the superclassed FuDevice as this was created as a FwupdDevice.
2019-01-17 16:35:34 +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
baa5af4504 trivial: fu-engine: Clarify the message when no releases are available 2019-01-11 12:59:00 +00:00
Richard Hughes
319dbcba5c trivial: Don't show 'Update Duration: 49710 days'
Use the correct 'value not found' constant for xb_node_get_attr_as_uint().
2018-12-18 17:59:09 +00:00
Richard Hughes
45bbfc9cae Check the device checksum as well as the content checksum during verify
Some firmware has a different on-device checksum to the hash of the firmware
file itself. This may be because:

 * The content is not a binary file, e.g. Intel HEX or SREC
 * Only part of the firmware is flashed, e.g. ignoring the bootloader section
 * The device checksum is calculated using another method entirely, e.g. PCR0

It's also made complicated as there may be more than one 'correct' device
checksum in some cases, but nothing that a union query can't solve.
2018-12-14 19:23:04 +00:00
Richard Hughes
4e886a4dfa Include the device checksum and update protocol in the historydb 2018-12-14 19:23:04 +00:00
Richard Hughes
adeb2b1b4d Add new API to get the release protocol from the metadata 2018-12-14 18:15:01 +00:00
Richard Hughes
d583bafb6f Only run attach and detach if the device is in the wrong mode 2018-12-06 08:22:00 +00:00
Richard Hughes
a07a80ff28 Fix a regression when doing GetReleases on unsupported hardware
With an indexed string we can return INVALID_ARGUMENT before the query actually
runs if nothing matches.
2018-12-03 15:02:48 +00:00
Richard Hughes
1af48b13bd Correctly parse format the version numbers correctly using old metadata
The LVFS has always sent components with the old-style '<metadata>' section
rather than the new-style '<custom>' section, and when using appstream-glib
we just accepted either element name. Although the LVFS has just been fixed to
use the new name, old metadata might be present on the system already.

When all clients have downloaded new metadata we can revert this, perhaps in a
couple of weeks time. Until then, the belt-and-braces approach is probably a
good idea.

Fixes https://github.com/hughsie/fwupd/issues/874
2018-12-03 12:14:28 +00:00
Richard Hughes
ec6190c4bf trivial: Fix regression when switching to indexed strings
When we construct a local silo we need to build the index again.

This fixes 'fwupdmgr get-details foo.cab'
2018-11-25 12:19:39 +00:00
Richard Hughes
328b00eec3 Remove DaemonVersionFormat=quad
This metadata key is now unnecessary, as firmwares are expected to set the
version format in the metadata.

If the metadata is missing, the LVFS allows a per-vendor default for non-semver
release versions which is now unconditionally set in metadata.
2018-11-21 19:06:51 +00:00
Richard Hughes
75b965d01d Shut down the daemon after 2h of inactivity
Plugins are allowed to 'opt-out' of this behaviour using _RULE_INHIBITS_IDLE.
This should be used where waking up the hardware to coldplug is expensive,
either from a power consumption point of view, or if other artifacts are going
to be seem -- for instance if the screen flickers when probing display devices.

This functionality is also inhibited when the actual upgrade is happening,
for obvious reasons.

Admins can turn off this auto-sleep behaviour by editing the daemon.conf file.

Fixes https://github.com/hughsie/fwupd/issues/417
2018-11-21 18:54:44 +00:00
Richard Hughes
634da03730 Create a silo index to speed up GUID queries
This speeds up matching for GUIDs by about 90%, taking the query from 3.17ms to
about 0.33ms on my Thinkpad. This is more important for slow ARM hardware,
where strcmp() is more expensive than on x64.
2018-11-21 18:51:07 +00:00
Richard Hughes
d76ed3de28 Fix flashing the 8bitdo SF30
We have to check for the SUPPORTED flag _after_ the FuDeviceList has added the
missing GUIDs from the device when it was in runtime mode.
2018-11-15 15:43:43 +00:00
Richard Hughes
ab1bc89ea8 trivial: Do a single query when getting a component by a set of GUIDs 2018-11-15 15:43:43 +00:00
Richard Hughes
aabdc371c1 Query the XbSilo when calling fu_plugin_check_supported()
This means we don't have to have all the thousands of GUIDs as tiny allocated
strings being passed around to all plugins in a GPtrArray.

This also reduces our heap usage by about 6%.
2018-11-14 15:32:55 +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
d56ad5b440 trivial: Fix a possible critical warning when parsing invalid metadata 2018-11-12 14:18:28 +00:00
Richard Hughes
0393f6fa81 Be more explicit setting the update state
If the FuDevice is changed during a replug then the `UPDATE_STATE_SUCCESS` will
not be stored on the current FuDevice, which means we store an update-state of
`unknown` to the history database.

Which means we get no success or failure reports, which is bad.
2018-11-09 15:13:56 +00:00
Richard Hughes
3b743402f5 Include the os-release information in the release metadata
This means we are storing the distro that was used to perform the update,
rather than the distro that was used to do the upload.

Fixes https://github.com/hughsie/fwupd/issues/838
2018-11-09 15:13:56 +00:00
Richard Hughes
33171fd24d trivial: Store the AppStream component metadata correctly
We want the XML to look like:

  <custom>
    <value key="fwupd::RemoteId">lvfs</value>
  </custom>

not:

  <custom>
    <fwupd::RemoteId>lvfs</fwupd::RemoteId>
  </custom>

Also, fix the XPath query string to actually match the container checksum, and
actually save the custom node to the builder source.

This fixes a regression in 1.2.0 where no reports could be uploaded.
2018-11-09 15:13:56 +00:00
Richard Hughes
aaa60c60d9 trivial: Fix a typo in the verification store export 2018-11-07 11:05:50 +00:00
Richard Hughes
b095df6d4d trivial: Fix some NULL/FALSE confusion 2018-11-05 16:36:06 +00:00
Mario Limonciello
387f039bea trivial: fu-engine: Increase the priority on a device if it has children
This will cause devices with children to be displayed (and potentially
processed) before children devices.
2018-10-24 13:39:37 -05:00
Mario Limonciello
343095ddb5 trivial: fu-device-list: Return devices by priority 2018-10-24 13:39:37 -05: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
416ade7f30 trivial: Hardcode the AppStream-glib version
This is the version we've imported from, which allows cabinet files requiring a
specific version of this library to continue working.
2018-10-11 07:54:01 +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
Richard Hughes
d3d2c2c39f Don't use AppStream-glib for the GUID helpers
Long term we want to wean ourselves away from libappstream-glib.
2018-10-11 07:54:01 +01:00
Mario Limonciello
78599edcc9 trivial: correct a memory leak of the FuDevice when replugging 2018-10-10 11:24:27 -05:00
Richard Hughes
12c849966d Allow firmware files to depend on versions from other devices
At the moment firmware can declare that it has certain requirements, for
instance the existing firmware version, the bootloader version, or the
vendor ID of the device.

In some situations we actually want to check the firmware version of a
*different* device. Good examples here would be only allowing an EC upgrade if
a specific BIOS update has already been done, or only allowing a wireless
reciever to be updated if the attached wireless devices have been updated first.

To use this, you can do something like:

    <requires>
      <id compare="ge" version="1.1.3">org.freedesktop.fwupd</id>
      <firmware compare="ge" version="0.9.0">guid-of-other-device</firmware>
    </requires>
2018-10-02 06:53:52 -05:00
Mario Limonciello
769d768be9 trivial: fu-engine: downgrade couldn't find new device message to debug
I've found that this message comes up sometimes due to reprobing order
and it shouldn't be considered important enough to generate a warning.
2018-10-02 11:52:28 +01:00
Mario Limonciello
9cecbe1d1b fu-engine: Optionally wait for replug before updating a device
Plugins may have marked a device as needing to replug duing a
composite device preparation due to the order devices were plugged
in.
2018-09-27 09:18:31 -05:00
Richard Hughes
e671c05771 trivial: Do not use AsProfile
The profiling data is of limited use, and better data can be obtained using
kcachegrind and massif. Additionally, the profile samples were the cause of the
small RSS growth over time, when in reality the data would only be shown when
the verbose switch is used at daemon startup.
2018-09-18 06:23:25 -05:00
Mario Limonciello
fc139357e1 fu-engine: Don't show devices pending a reboot in GetUpgrades
Fixes part of http://gitlab.gnome.org/GNOME/gnome-software/issues/341
2018-09-13 10:37:29 -05:00
Richard Hughes
37d0943844 Add FuMutex helper to make various parts of the daemon thread-safe 2018-09-12 16:10:38 +01:00
Richard Hughes
5a9a6bd479 trivial: Return reference counted devices from FuDeviceList 2018-09-12 16:10:38 +01:00
Mario Limonciello
e6d2cf4dda trivial: Skip debugging messages for skipped releases
These are less interesting than which releases actually get added.
2018-09-11 18:59:05 +01:00
Richard Hughes
a1e82d3448 trivial: Add the components to the daemon store in one operation
This removes hundreds of lines of debugging spew.
2018-09-11 18:59:05 +01:00
Richard Hughes
17558acb35 trivial: Only show the number of loaded components at startup 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
7772dcfc91 trivial: Ensure the daemon sends IDLE when firmware is updated 2018-09-10 16:12:12 +01:00
Richard Hughes
ebae396d0a udev: Do not add devices after a small delay
Now devices can have multiple GUIDs and do not share platform IDs there is
really no point waiting to add the device.

This allows us to remove a whole lot of code for this now-unused functionality.
2018-09-09 16:24:30 +01:00
Mario Limonciello
b6fa47381e trivial: Refresh the list of devices sent to composite_cleanup()
If one of the devices went into replug during update the FuDevice instance will
have changed.
2018-09-07 15:16:14 +01:00
Richard Hughes
405baebbf2 trivial: Don't allow plugins to call fu_udev_device_emit_changed() 2018-09-06 16:22:46 +01:00
Richard Hughes
c125ec02ed Clarify what the platform ID actually is by renaming it
It wasn't hugely clear what the platform ID was actually meant to represent. In
some cases it was being used like a physical ID, in others it was a logical ID,
and in others it was both. In some cases it was even used as a sysfs path.

Clear up all the confusion by splitting the platform ID into two parts, an
optional *physical* ID to represent the electrical connection, and an optional
*logical* ID to disambiguate composite devices with the same physical ID.

Also create an explicit sysfs_path getter for FuUdevDevice to make this clear.

This allows WAIT_FOR_REPLUG to always work, rather than depending on the order
that the GUIDs were added, and that the kernel would always return the same
sysfs path (which it doesn't have to do, especially for hidraw devices).
2018-09-06 16:22:46 +01:00
Richard Hughes
037ce37fe6 trivial: Add some error prefixes to help debug a replug issue 2018-09-06 09:24:23 +01:00
Richard Hughes
828c039c00 trivial: Fix up some gtk-doc warnings 2018-09-04 08:22:39 -05:00
Richard Hughes
ff704414f6 Use superclassed versions of FuDevice when calling udev_added() and usb_added()
The daemon creates a baseclass of either FuUsbDevice or FuUdevDevice when the
devices are added or coldplugged to match the quirk database and to find out
what plugin to run.

This is proxied to plugins, but they are given the GUsbDevice or GUdevDevice and
the FuDevice is just thrown away. Most plugins either use a FuUsbDevice or
superclassed version like FuNvmeDevice and so we re-create the FuDevice, re-probe
the hardware, re-query the quirk database and then return this to the daemon.

In some cases, plugins actually probe the hardware three times (!) by creating
a FuUsbDevice to get the quirks, so that the plugin knows what kind of
superclass to create, which then itself probes the hardware again.

Passing the temporary FuDevice to the plugins means that the simplest ones can
just fu_plugin_device_add() the passed in object, or create a superclass and
incorporate the actual GUsbDevice and all the GUIDs.

This breaks internal plugin API but speeds up startup substantially and deletes
a lot of code.
2018-09-04 08:22:39 -05:00
Mario Limonciello
e260ead594 Notify all plugins of device removals through a new vfunc 2018-09-04 10:00:52 +01:00
Richard Hughes
3a8d532855 Allow the device list to take care of waiting for the device replug
This means that individual plugins do not have to manage thier own GUsbDevice
lifecycle and no longer have to call g_usb_context_wait_for_replug().
2018-08-31 16:41:40 +01:00
Richard Hughes
effcc7a7a7 trivial: Fix regression when enumerating udev subsystems 2018-08-31 14:34:01 +01:00
Richard Hughes
23170a8195 trivial: Set the plugin name when the GUID is added 2018-08-29 14:27:57 +01:00
Salud Lemus
980f2d9551 fu-engine: Don't fail get-details if compiled without GPG/PKCS7
Similar to commit 7d35278 regarding the install option with a daemon compiled without
GPG, but now, if you also have a daemon compiled without GPG, and if you have downloaded a
CAB file from LVFS and ran get-details, it would fail to display the contents
of the associated CAB file.

This allows it to still display the contents of the CAB file, and
a warning will be displayed in the logs.
2018-08-29 10:27:40 +01:00
Richard Hughes
6dec401a67 Store the DeviceInstanceId as a GUID in the quirk database
This allows us to match non-DeviceID GUIDs, and also GUIDs we don't know how to
generate.

To make this fully useful, search for device quirks when GUIDs are added.
2018-08-28 18:30:00 +01:00
Richard Hughes
73bf2337c1 trivial: Add fu_common_strtoull() as a shared function 2018-08-28 09:41:10 +01:00
Richard Hughes
9d6e0e743b Move the GUdevClient to the core daemon
Allowing plugins to 'register' for different udev subsystems in _init() allows
us to move the client to the engine, reducing the number of wakeups considerably
for each device event. It also will reduce the amount of boilerplate code in
each plugin that uses GUdev, much like we have done for GUsb.
2018-08-26 19:42:28 +01:00
Richard Hughes
bb764e99a0 trivial: Add fu_device_list_get_by_platform_id() 2018-08-26 19:38:58 +01:00
Mario Limonciello
e3b1a3f558 Plumb through support to set FwupdInstallFlags for update_prepare/update_cleanup
This will be used by other future commits.
2018-08-21 13:49:38 -05:00
Mario Limonciello
6463f311b8 fu-engine: emit signals when initializing
Some devices take a long time to initialize and tools like fu-tool
have no feedback during this time.

Show a status message to indicate what's going on.
2018-08-10 14:52:55 +01:00
Richard Hughes
ec85ebc760 trivial: Emit device-changed when the device status or percentage changes 2018-08-10 14:50:43 +01:00
Mario Limonciello
59cd4706f0 trivial: fu-engine: downgrade "Using Plugins %s" to debug
This isn't useful for most people and just takes up space in the logs.
When there is a problem it's typically specifically with a plugin
and at that time we ask them to run the daemon with verbose anyway.
2018-08-09 13:47:35 -05: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
Richard Hughes
81c427ca6d Allow different plugins to add the same device
In this instance, we define the 'same device' to be a FuDevice that has at
least one matching GUID. We allow the plugins to define which one is 'better'
than other plugins, and use this to only have one FuDevice for the physical
device.

Alternative to https://github.com/hughsie/fwupd/pull/604
2018-08-06 21:58:28 -05:00
Richard Hughes
881f624eba trivial: Fix getting details about firmware for unknown devices
Fix a logic error when testing requirements; what was supposed to happen was
that a the firmware requirements were only processed when we had a FuDevice set
in the FuInstallTask, but instead we were falling through to the handler for
'unknown requirement type'.
2018-08-06 11:03:08 +01:00
Richard Hughes
38c7c334f4 trivial: Remove duplicate requirement checks
The fu_engine_check_requirements() tests are already called from
fu_engine_get_result_from_app() using a NULL device.
2018-08-06 10:59:13 +01:00
Mario Limonciello
4afe7fb742 fu-engine: Add a timer for device update wrapping blob installation
This makes it a lot easier to benchmark performance relative to
other implementations, systems and buses.
2018-08-06 00:34:42 -05:00
Richard Hughes
2d37c3f64b trivial: Add a virtual provide of com.redhat.fwupdate
Some firmware depends on this component, which we absorbed in the last release.

See also: https://github.com/hughsie/fwupd/issues/614
2018-08-04 19:06:03 +01:00