Commit Graph

2860 Commits

Author SHA1 Message Date
Richard Hughes
bccaaf5194 Add shared functionality for reading and writing with O_NONBLOCK
Two plugins have very similar code already, and we're about to get another.
2018-12-06 14:07:02 +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
Mario Limonciello
3561d9bef9 trivial: snap: move to efivar 37 2018-12-06 08:20:38 +00:00
Richard Hughes
e59cb9af01 trivial: Add fu_common_dump_raw() 2018-12-05 15:09:56 +00:00
Richard Hughes
55b8a249e0 Sanitize the version if the version format has been specified
This converts versions like 'v1.2.3' into a valid semver of '1.2.3' if the
version format has been set.

Fixes https://github.com/hughsie/fwupd/issues/884
2018-12-05 07:07:35 -06:00
Richard Hughes
8949f3d066 wacom-usb: Remove the DTH generation hardware as it will not work with fwupd
Fixes https://github.com/hughsie/fwupd/issues/882
2018-12-05 11:41:59 +00:00
Mario Limonciello
cc355beaf8 trivial: Add a snap badge for fwupd 2018-12-04 15:54:18 -06:00
Mario Limonciello
8ec36ae826 trivial: dell-dock: reverse MST update order for I2C
This mirrors the update process over DP aux to run the ESM update
first.

The thought process is as follows:
The "version" displayed doesn't show ESM version, only standard
bank version.
So if the update fails for the ESM then because the update of the
standard happening first it would never be flashed.
2018-12-04 06:16:29 -06:00
Mario Limonciello
d73fbe08ce thunderbolt: Remove a superfluous boundary condition when verifying update
`g_ascii_strtoull` returns 0 and sets `errno` to `-EINVAL` only when
the base is invalid.  It's hardcoded to `16` so this is impossible.
Reading `-EINVAL` from `errno` is incorrect in these circumstances.

Fixes: https://github.com/hughsie/fwupd/issues/879
2018-12-03 14:28:48 -06:00
Richard Hughes
b4fd12a4c6 Add a plugin to update hardware that supports fastboot 2018-12-03 15:50:38 +00:00
Richard Hughes
1c4e06925c trivial: Speed up daemon startup
Require a quirk match for Unifying hardware to avoid probing a lot of USB
devices at startup.
2018-12-03 15:23:27 +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
0585172c17 trivial: Document the expected plugin firmware formats 2018-12-03 08:48:13 -06:00
Richard Hughes
b27a2520cc dfu: Require a specific USB class and subclass for DFU mode
This makes startup quicker as we no longer have to probe every USB device, and
is now possible with the new GUIDs we added. Devices not using the
specification-provided values can (and already are) worked around with quirks.
2018-12-03 13:57:52 +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
7cd6d363e1 trivial: Correctly calculate the erase length for all locales
This fixes the progressbar going crazy when using fwupdmgr with zh_CN.
2018-11-30 15:56:28 +00:00
Richard Hughes
6dc8680e15 amt: Fix a crash if AMT returns an empty response
Mixing integer return values and GError is never a good idea.

Fixes https://bugzilla.redhat.com/attachment.cgi?id=1510083
2018-11-30 15:22:17 +00:00
Richard Hughes
cd2fb3eb62 Check plugins set error on failure
Don't explode in a ball of flames if the plugin forgets to set the error.
This at least gives us a journal warning when a plugin goes crazy.
2018-11-30 15:22:17 +00:00
Mario Limonciello
91a3eac28d contrib: Add a simple python3 client
The client uses GObject introspection to use the libfwupd2 library.

The client offers a reduced set of commands, but may be useful in some
environments.
2018-11-30 08:39:50 -06:00
Richard Hughes
1d9c2ec1f1 trivial: Allow loading archives ignoring the path 2018-11-30 12:18:37 +00:00
Mario Limonciello
15e4b0caaf installed-tests: Adjust to actually use a remote for installed tests
By using a remote, this should allow using gnome-software to do the
installed tests without hacking around much.

Fixes: https://github.com/hughsie/fwupd/issues/862
Fixes: https://github.com/hughsie/fwupd/issues/809
2018-11-29 09:40:06 -06:00
Richard Hughes
74f976a821 Add more standard USB identifier GUIDs
These are specified in:
https://docs.microsoft.com/en-us/windows-hardware/drivers/install/standard-usb-identifiers
2018-11-29 13:26:53 +00:00
Richard Hughes
57908bebc1 wacomhid: Rename to wacom-usb
We're adding another Wacom plugin soon, this one also using hidraw -- but the
new protocol uses a different 'raw' protocol and does not use USB.
2018-11-29 13:26:29 +00:00
Richard Hughes
596f93f50b trivial: Allow calling fu_device_has_guid() with non-GUID text
This matches the behaviour of fu_device_add_guid().
2018-11-28 17:53:21 +00:00
Richard Hughes
847a6b11b2 trivial: Don't ask translators to translate the release notes 2018-11-28 14:18:36 +00:00
Richard Hughes
43fb4a7110 trivial: Update two release note typos 2018-11-28 14:18:36 +00:00
Richard Hughes
b97f07e7be Provide a way for plugins to decompress a custom archive to ram
This allows plugins to load an archive supplied as the 'deliverable' of the
cabinet archive. This means plugins can bundle up a set of images in a cross
platform way, for instance adding boot.img+os.img+manifest.xml into a zip file,
rather than having to (ab)use the DfuSe file format or deal with libarchive
directly.
2018-11-28 14:18:03 +00:00
Richard Hughes
6a53116fb5 trivial: post release version bump 2018-11-27 14:53:43 +00:00
Richard Hughes
c0b20b119b Release fwupd 1.2.1 2018-11-27 14:51:56 +00:00
Mario Limonciello
817a15a1bf trivial: dell-dock: Set EC version to daemon before EC reset
If the process fails (or was skipped due to 'skip-restart') this will
prevent the daemon from trying again until the dock has been power
cycled.
2018-11-27 11:05:26 +00:00
Mario Limonciello
1210332e05 trivial: dell-dock: fail when EC indicates flashing an invalid/unsigned image
Otherwise this would cause fwupd to sit in an endless loop when providing a bad
image.

This additional enum is only available in EC16, but since it doesn't break existing
API on older EC images, don't bump minimum requirement to EC16 yet.
2018-11-27 11:05:26 +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
8a2eaa5514 trivial: Move the release descriptions to the metainfo.xml file
This matches what a lot of other projects do, and means we can easily format
the release notes back into NEWS format, but also into HTML and Markdown.

This also means we can show the correct update description in gnome-software
when building a flatpak, rather than falling back to the generic project
description.
2018-11-16 21:52:41 -06: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
9cf352db2f trivial: Add InstallDuration values for 8bitdo devices 2018-11-15 15:43:43 +00:00
Richard Hughes
0443a4170a trivial: Add InstallDuration values for Unifying devices 2018-11-15 15:43:43 +00:00
Richard Hughes
5ed4d968ac trivial: Add InstallDuration values for ColorHug devices 2018-11-15 15:43:43 +00:00
Richard Hughes
86b79fb039 Speed up fwupd startup by loading less thunderbolt firmware
We load the Thunderbolt controller firmware to see if the controller is in
native mode, as this changes the GUID. If the controller is asleep the firmware
is not cached by the kernel and it can take more than 4 seconds to read out
504kB of firmware.

We only need the first two 64-byte chunks, so only read what is required.
This speeds up fwupd starting substantially, and also means we don't have to
allocate a giant chunk of heap memory just to inspect one byte.

Fixes: https://github.com/hughsie/fwupd/issues/848
2018-11-14 16:21:52 +00:00
Richard Hughes
840184929b trivial: Fix some function prefixes for Thunderbolt 2018-11-14 16:21:52 +00:00
Richard Hughes
af2d1c285e trivial: Do not show all the HWIDs at daemon startup
The same information can be seen in `/usr/libexec/fwupd/fwupdtool hwids` and
for most users verbose mode is turned off -- so we're doing all those expensive
allocations for nothing.
2018-11-14 15:32:55 +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
e9dfeb49c1 trivial: Remove unused functionality 2018-11-14 15:32:55 +00:00
Richard Hughes
3ccce7151e trivial: Mark GParamSpec values as static to reduce RSS 2018-11-14 15:32:55 +00:00
Richard Hughes
ac458d3436 Guess the version format when it is not provided
The most important change here is that versions without dots (not a 'semver')
are treated as 'PLAIN' rather than 'UNKNOWN'.
2018-11-14 11:52:46 +00:00
Richard Hughes
69fca1d754 Fix a use-after-free when using valgrind and --immediate-exit 2018-11-13 17:15:38 +00:00
Mario Limonciello
c7fe0a7453 trivial: Add quirk documentation
Fixes https://github.com/hughsie/lvfs-website/issues/192
2018-11-13 09:53:19 +00:00