Commit Graph

224 Commits

Author SHA1 Message Date
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
Richard Hughes
f307775675 Add release information for locked devices 2018-06-28 15:51:11 +01:00
Richard Hughes
87fb9ff447 Change the quirk file structure to be more efficient
This pivots the data storage so that the group is used as the preconditon
and the key name is used as the parameter to change. This allows a more natural
data flow, where a new device needs one new group and a few few keys, rather
than multiple groups, each with one key.

This also allows us to remove the key globbing when matching the version format
which is often a source of confusion.

Whilst changing all the quirk files, change the key prefixes to be more familiar
to Windows users (e.g. Hwid -> Smbios, and FuUsbDevice -> DeviceInstanceId)
who have to use the same IDs in Windows Update.

This also allows us to pre-match the desired plugin, rather than calling the
probe() function on each plugin.
2018-06-28 13:32:30 +01:00
Richard Hughes
a39d6a52b5 trivial: Skip plugins that require the 'Plugin' quirk is set 2018-06-28 12:17:15 +01:00
Richard Hughes
6dbe8fef34 Allow devices to assign a plugin from the quirk subsystem
Not calling dozens of ->probe() functions is dramatically more efficient when
there are a large number of USB devices attached.

This requires plugins to 'opt-in' to the new behaviour, and also to supply
quirks that match all devices.
2018-06-28 12:16:31 +01:00
Richard Hughes
83cd57f095 Fix downgrading older releases to devices
The requirement filter needs to be relaxed when getting the available releases
for a device when not used to install the firmware.
2018-06-27 14:07:23 +01:00
Richard Hughes
e48351e260 Set the alternate device ID, not the object itself
If the daemon either de-duplicates or replaces the object passed emitted from
device-added then the object set as the alternate may not be the same instance
as the daemon version. This causes weird things to happen.

To make this less fragile, specify the *ID* of the object that should be the
alternate device, which allows the daemon to do clever things, and then assign
the object from the ID as the last step.

Although fixing no bug, this makes implementing future functionality easier.
2018-06-22 13:28:27 +01:00
Richard Hughes
dbd8c76eb8 Run a plugin vfunc before and after all the composite devices are updated
Now we can update multiple devices (in multiple plugins) using one firmware
archive we need a way to cleanup after all the plugins have been run.

Fixes https://github.com/hughsie/fwupd/issues/561
2018-06-18 16:06:15 +01:00
Richard Hughes
61ac08d6d5 trivial: Allow firmware files to select a quad version format
This can be used to select the AA.BB.CC.DD format rather than the default
AA.BB.CCDD format for firmware versions. This allows us to support new vendor
requirements without adding more complicated rules to the quirk file.
2018-06-14 14:56:47 +01:00
Mario Limonciello
cf63aecdaf fu-engine: Don't hardcode /etc/pki/fwupd-metadata 2018-06-11 14:22:08 -05:00
Mario Limonciello
3f9a1c182a Clean up plugins as the last step of engine cleanup (Closes: #550)
Fixes a segfault that occurs during cleanup of USB plugins.

When g_module_close was called memory allocated by the plugin would
get freed leading to the finalize method for object class pointing
to garbage.
2018-06-06 14:39:03 -05:00
Richard Hughes
4be17d1364 Add support for relocating various runtime paths
This allows a snap package to be easily built.

With much help from Mario Limonciello <mario.limonciello@dell.com>, many thanks.
2018-05-31 16:25:22 +01:00
Richard Hughes
fe221dc13d trivial: Fix up some NULL/FALSE confusion 2018-05-29 09:33:44 +01:00
Mario Limonciello
51308e648a Adjust all licensing to LGPL 2.1+ (Closes: #526) 2018-05-29 09:03:13 +01:00
Richard Hughes
c02ee4da46 Allow whitelisting plugins in fwupdtool
When developing code it's really convenient to only run the new plugin. This
means you don't have to wait for the other hardware to initialize and there
are no side-effects from other plugins when installing firmware.

You can specify multiple plugins as globs, for instance:

    fwupdtool get-devices \
        --plugin-whitelist wacom \
        --plugin-whitelist "thunderbolt*"
2018-05-22 16:03:14 -05:00
Richard Hughes
8c71a3f2e9 Add a get-plugins command to fwupdtool
This returns the list of currently enabled plugins.
2018-05-22 16:03:14 -05:00
Richard Hughes
1d1f5cf098 trivial: Refactor the requirement tests to use a FuInstallTask 2018-05-21 21:23:45 +01:00
Richard Hughes
5b5f655e0b trivial: Allow the daemon to run without any idle sources
We need this if we want to run plugins without a daemon process.
2018-05-18 10:22:39 +01:00
Richard Hughes
c2de52a5b8 trivial: Only allow installing without history if the version is supplied 2018-05-18 10:14:36 +01:00
Richard Hughes
6e7419db0a trivial: Split up fu_engine_install()
This should allow the low-level tool to write unpackaged firmware.
2018-05-18 10:13:21 +01:00
Richard Hughes
76e0f94c86 Allow the client tools to avoid writing the history database 2018-05-14 18:54:15 +01:00
Richard Hughes
12040b51fe trivial: Fix fu_engine_get_device() to use the device list
This only worked when the device ID was already in the history database, and
was probably a copy-paste issue.
2018-05-14 13:38:58 +01:00
Richard Hughes
1e456bcd39 Do not call fu_plugin_init() on blacklisted plugins
Fixes https://github.com/hughsie/fwupd/issues/503
2018-05-11 07:26:17 -05:00
Richard Hughes
7e77bf3116 trivial: Be consistent with 'name [id]' in debug output
Based on a patch by Mario Limonciello <mario.limonciello@dell.com>, many thanks.
2018-05-10 09:26:07 +01:00
Richard Hughes
4ad41f027c Allow installing more than one firmware using 'fwupdmgr install'
When using failed to open firmware.cab we pass in a device ID of '*' which
tells the daemon to update anything that matches. The current implementation
will fail in two ways:

* If duplicate hardware is installed (for instance two Unifying receivers) then
  only the first matching device will be updated.

* If the firmware archive contains two different images then we only try and
  upgrade the first device that matches. This means we're unable to update
  composite devices using one firmware file.

To fix both issues, carefully build a list of tasks that can be processed using
the given firmware and installed devices, request authentication using all the
different action IDs, then upgrade all the devices one-at-a-time.

Based on a patch by Mario Limonciello <mario.limonciello@dell.com>, many thanks.
2018-05-10 09:26:07 +01:00
Richard Hughes
27bf9ecfbb trivial: Fix up all apps when building the store 2018-05-10 09:26:07 +01:00
Richard Hughes
7383ce263b trivial: Split out some common keyring functionality 2018-05-10 09:26:07 +01:00
Richard Hughes
5e447293fa Add the concept of logical mappings between different devices
This allows us to find out the logical parent device, for instance in composite
devices with more than one firmware image for a single device.

We also allow lazily specifying the device parent using a GUID and the engine
then automatically sets the parent object when the GUIDs match, which allows
children and parents to exist in different plugins.
2018-05-03 08:07:04 +01:00
Richard Hughes
3d71c16ed3 Allow specifying hwids with OR relationships
We don't want to use the version= attribute as the HWIDs are not versions, and
thinkgs like globbing just doesn't make sense given they are from hashes.

Fixes the client side part of https://github.com/hughsie/lvfs-website/issues/110
2018-05-01 14:33:23 +01:00
Richard Hughes
34e0dab1f1 Add fu_plugin_add_compile_version()
This allows plugins to set and explicit build-time version. It also uses the
same AppStream component-ID scheme rather than the home-grown 'FooVersion' key.

Also, use the new runtime and compile-time versions in the report metadata.
Due to the key change we'll also need to update some LVFS rules.
2018-04-20 20:45:08 +01:00
Richard Hughes
0eb123b986 Allow requiring specific versions of libraries for firmware updates
In some cases firmware can only be installed with an up to date GUsb (e.g. with
some STM-DFU hardware) or with a new version of fwupdate (e.g. any UEFI
UpdateCapsule without a capsule header).

We should be able to match against other software versions like we can the
fwupd version, e.g.

    <requires>
      <id compare="ge" version="0.9.2">org.freedesktop.fwupd</id>
      <id compare="ge" version="11">com.redhat.fwupdate</id>
    </requires>

Also, rather than checking each requirement we know about on the component,
check each requirement on the component about things we know. This ensures we
don't allow firmware to be installs that requires for instance fwupdate 22 when
the runtime version is only being added in fwupdate 12 and up.

This means the following is now an error that will fail to allow the firmware
to be installed:

    <requires>
      <firmware>doesnotexist</firmware>
      <some_future_tag>also_unknown</some_future_tag>
    </requires>

Also add a lot of self tests to test the various new failure modes.

Fixes https://github.com/hughsie/fwupd/issues/463
2018-04-20 16:19:05 +01:00
Mario Limonciello
ce2a8231ea Bump appstream-glib minimum version to 0.7.4
Ubuntu's LTS and Fedora's newest releases have it.  All CI targets
have it.
2018-04-20 09:05:17 -05:00
Richard Hughes
e598fc3447 trivial: Show the VID and PID when failing to add a USB device
Fixes https://github.com/hughsie/fwupd/issues/476
2018-04-19 20:15:09 +01:00
Mario Limonciello
ed1ac2a74b Enable CentOS 7 for CI
There are a lot of hacks here;
 * Pulling newer libappstream-glib from Fedora
 * Pulling a systemd backport
 * Manually installing pillow and pygobject
 * PKCS7 is turned off (gnutls is too old)
2018-04-18 10:25:22 -05:00
Richard Hughes
34e48634af trivial: Fix a critical warning when checking component requirements 2018-02-23 15:26:15 +00:00
Richard Hughes
849914e642 trivial: Don't keep asking the user if they want to report firmware
Don't optimize the device flag away. We need to be able to set the flag on all
devices that match the device ID, not just the one that happens to match now.
2018-02-14 19:57:27 +00:00
Mario Limonciello
44ebdb82d4 fu-engine: Clarify which devices don't have upgrades (Fixes #397) 2018-02-12 16:26:01 -06:00
Richard Hughes
4082d3367b Correctly mark updates as successful even if the device version number is wrong
If the device firmware was set incorrectly make then set it to the release
version so the database update works correctly. We can't do any kind of vercmp
in the database, so use a daemon warning so we can either fix the plugin or
the XML.

This fixes up the issue that the hardware reports '28.00' and the AppStream
release specifies '28.0'.

Fixes: https://github.com/hughsie/fwupd/issues/387
2018-02-09 16:55:09 +00:00
Richard Hughes
c0cd023d31 Be more careful deleting and modifying device history
If this happens:

1.2.3 -> 1.2.4 = failure
1.2.3 -> 1.2.5 = success

...we want to preserve both in the history database so they can both be shared
with the LVFS. Use the device ID and the new and old firmware versions when
modifying and deleting entries.

This fix is made slightly more tricky as we have to drop the PRIMARY KEY
attribute on the device_id, and due to a limitation in SQLite, it means copying
the old history into a new table.
2018-02-07 10:20:19 +00:00
Richard Hughes
65e44cac96 Always return useful information when calling GetResults()
Previous to having the history database we could only notify about firmware that
as installed using the uefi plugin, as that had a few system-wide API calls to
say 'this update failed' or 'this was the error'.

Now we have the local history database not only can we report more details about
the UEFI update (e.g. the old version number) but we can also offer the same
functionality for all other plugins.

Although this does rework how the data for GetResults() is populated, it does
make the FuEngine object quite a lot less confused.

It also fixes a warning in the fwupd plugin for gnome-software, which was
expecting the FwupdRelease to be populated for the FwupdDevice.
2018-02-07 10:20:19 +00:00
Richard Hughes
ee7e764603 trivial: Do not return failure if a device flag is already set
If we have multiple versions of upgrades/downgrades we'll be setting the
REPORTED flags for multiple history entries at once.
2018-02-01 14:01:58 +00:00
Richard Hughes
ad54f65f05 Add FWUPD_DEVICE_FLAG_NOTIFIED
This allows us to record whether we've shown the user a notification (either in
the terminal or in a GUI) that an update failed or was successful.

This can't be done in the session otherwise we'd get a notification for every
different user on the system. Notifying also isn't the same as reporting,
although one can certainly follow on from the latter.
2018-02-01 14:01:18 +00:00
Richard Hughes
534255cff3 Set the RemoteId when using GetDetails
This searches for the release container checksum in any enabled remote and
also sets the SUPPORTED flag if the local file matches.
2018-01-28 20:24:21 +00:00
Richard Hughes
2de8f13b2c Allow each plugin to opt-in to the recoldplug action
Recoldplug is really not required for the USB based plugins, and we should
restrict this action to plugins that have inter-dependencies on each other.
2018-01-17 20:19:58 +00:00
Richard Hughes
4012754569 trivial: Rename some FuDeviceList methods
The convention we're using is that find() returns the FuDeviceItem and get()
returns the FuDevice, so be consistent.

No code flow changes.
2018-01-16 13:48:51 +00:00
Richard Hughes
7e070c9bd7 Record an error if any NEEDS_REBOOT transaction fails to be applied
In the case of failing to even set up UpdateCapsule, the uefi plugin would
dutifully return SUCCESS as it was referring to the 2nd-to-last update that
actually worked.
2018-01-12 16:50:24 +00:00
Richard Hughes
7984310a65 trivial: Ensure a historical error message is cleared on success 2018-01-12 16:50:24 +00:00
Richard Hughes
d949d961e8 trivial: Pass the device-id to the fu_history_set_X() methods
This allows us to use a FwupdDevice or just use a string for testing.
2018-01-12 16:50:24 +00:00
Richard Hughes
0b9d996d4d trivial: Rename some methods in FuHistory to reflect the device-centric nature 2018-01-12 16:50:24 +00:00
Richard Hughes
f271142c47 trivial: Do not recover the pending update if the boot time is unchanged
This ensures we can restart the fwupd service without marking updates that need
a reboot as failed.
2018-01-12 16:17:27 +00:00
Richard Hughes
59c2ebe5cd Add in the kernel boot time to the uploaded report 2018-01-12 16:17:22 +00:00
Richard Hughes
a899713863 Rescan supported flags when refreshing metadata
The SUPPORTED flag is used when a device appears in the AppStream metadata of
any enabled remote, so when we rescan the modified store also ensure the flag
state is still correct.

Fixes https://github.com/hughsie/fwupd/issues/363
2018-01-12 15:04:21 +00:00
Richard Hughes
80b79bb9aa trivial: Allow plugins to add metadata to the uploaded reports 2018-01-11 21:28:22 +00:00
Richard Hughes
473c520e38 Add in extra metadata to the uploaded reports
Save the dependency versions, architecture and the kernel versions in the
history database as metadata as it may be different to the time of upload.
2018-01-11 21:28:22 +00:00
Richard Hughes
611f1a9cbf Set the remote-id on devices returned by GetHistory 2018-01-11 20:19:41 +00:00
Richard Hughes
3eb2a00d10 trivial: Fix up the version check for offline firmware reporting 2018-01-11 20:19:16 +00:00
Richard Hughes
6b22295cf0 Add a D-Bus method to modify a historical device
This allows us to set specific flags on the device stored in the database.
2018-01-11 10:20:48 +00:00
Richard Hughes
a2f8e45c0f trivial: Set the update state for any updates that need a reboot
This has to be done at each engine startup, as this will happen on the *next*
OS boot.
2018-01-11 10:11:17 +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
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
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
eafba48905 trivial: Namespace the ignored cleanup error better 2018-01-08 21:59:08 +00:00
Richard Hughes
9939f1c85c trivial: Fix tiny memory leak when getting GUIDs from an invalid archive 2018-01-08 16:56:19 +00:00
Richard Hughes
c7bbbc246b Allow specifying the maximum archive size in the daemon config 2018-01-03 07:38:27 +00:00
Richard Hughes
4f50e6268a Do not try to parse huge compressed archive files
We don't want to allow DoS-ing the daemon by trying to decompress a huge sparse
cabinet archive.
2018-01-03 07:38:27 +00:00
Richard Hughes
eec8a3c068 trivial: Fix a compile warning with the latest GLib 2018-01-02 20:37:31 +00:00
Richard Hughes
deea2da041 Use the new functionality in libgcab >= 1.0 to avoid writing temp files
Using old versions of gcab we could only do one thing: extract the files in the
cabinet archive to a new directory in /tmp, and then fwupd would have to read
them back in to memory to parse them. This was both inelegant and wasteful, and
probably not an awesome idea from a security or privacy point of view.

Using libgcab >= 1.0 we can decompress to a GBytes blob, and then verify the
firmware and metainfo file without anything being written to disk.

As this is a security sensitive operation, move the fwupd-specific helper code
out of libappstream-glib and also add a lot of internal self tests.

The gcab code will have to remain in libappstream-glib for a long time, but we
don't have to use it. Handling the cab file here also allows us to fix two
long-standing bugs:

 * MetaInfo or firmware files in a subdirectory are handled correctly

 * The archive can also be self-signed using PKCS7 instead of using GPG
2017-12-21 08:54:00 +00:00
Richard Hughes
650dadebe6 Choose the correct component from provides matches using requirements
In the case of multiple <component> sections with different AppStream IDs, but
with the same GUID <provides>, filter using the requirements rather than just
choosing the first one.

This allows the update of Logitech devices with secure bootloaders. Many thanks
to Ogier Bouvier for identifying the problem.
2017-12-14 15:50:19 +00:00
Richard Hughes
fbcebe096b Connect the progress and status callbacks on the new FuDevice on replug
This ensures we get progress events when replugging a device. Also, remove the
callbacks on the 'old' device to avoid causing multiple events on a 2nd-replug.
2017-12-11 16:48:56 +00:00
Richard Hughes
23135eb1c9 trivial: Remove the now-unused fu_plugin_set_status() 2017-12-04 17:00:22 +00:00
Richard Hughes
4a036018f7 Set the progress and state on the FuDevice, not the FuPlugin
This makes more sense; we're updating the device, not the plugin itself.

This also means we don't need to funnel everything through callbacks like
GFileProgressCallback and we can also update the state without adding an
explicit callback to each derived device type.
2017-11-30 20:51:52 +00:00
Richard Hughes
c3476d56de Add a method to probe a FuUsbDevice before it is opened
This allows us to further clean up device creation.
2017-11-30 14:16:34 +00:00
Richard Hughes
df149ac006 Remove the superfluous check for a duplicate FuDevice addition 2017-11-29 15:56:29 +00:00
Richard Hughes
634e9228f8 Always show coldplugged USB devices
When adding GUsbDevice we didn't account for coldplugging devices using the
GUsbContext enumeration.
2017-11-29 15:50:08 +00:00
Richard Hughes
f77d706fff trivial: Add some more profiling to narrow down a slow boot issue 2017-11-27 18:07:53 +00:00
Richard Hughes
5b5e945b18 trivial: Fix the prefix of profiling statements 2017-11-27 18:07:53 +00:00
Richard Hughes
5f733f2581 Fix critical warning when more than one remote fails to load
See https://github.com/hughsie/fwupd/issues/318
2017-11-26 16:14:20 +00:00
Richard Hughes
88adcbe601 Show a nicer error message if the requirement fails
`Not compatible with fwupd version 1.0.2, requires >= 1.0.3`

...is easier to understand than...

`Value of org.freedesktop.fwupd incorrect: failed predicate [1.0.3 ge 1.0.2]`
2017-11-24 16:37:15 +00:00
Richard Hughes
104f651132 Add a fu_plugin_usb_device_added() dedicated vfunc
This saves all the USB plugins from connecting to the context and managing the
device lifecycle and allows devices that uses FuUsbDevice to be removed
automatically.

This makes supported plugins *much* smaller indeed.
2017-11-24 16:13:44 +00:00
Richard Hughes
70425fe923 Allow different plugins to claim the same device
When changing from runtime->bootloader->runtime the usual way of handling this
in a fwupd plugin is to:

* reset the device and wait for a replug
* flash the hardware
* reset the device and wait for a replug

This works well when the runtime and bootloader modes are handled by the same
plugin. For situations like the Nitrokey device, where one plugin handles the
runtime (nitrokey), and another handles the bootloader (dfu) we have to have
the ability to 'ignore' the device removal and just issue a 'changed' signal
so the client refreshes the properties.
2017-11-24 14:42:27 +00:00