Commit Graph

66 Commits

Author SHA1 Message Date
Richard Hughes
5272cfc63d Add versions formats for the Microsoft Surface devices
Apparently there are yet more ways to encode a 32 bit number...
2019-11-07 21:34:09 +00:00
Mario Limonciello
97c1e727c4 Add new device flags indicating update resilience
fwupd clients will ideally use this information as part of a policy to schedule
updates in the background without user interactions on safe devices.
2019-10-17 11:38:46 -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
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
3be596b907 fu-util/fu-tool: Better display historical information
* When firmware has been modified use the device key "Previous version"
  instead of "Current version".
* Show release as a child node when looking at history
* Don't output empty flags for release
* Use the key "New version" for releases

Sample output from `get-history`
```
├Integrated Webcam™:
│ │   Device ID:           08d460be0f1f9f128413f816022a6439e0078018
│ │   Previous version:    1.2.2
│ │   Update State:        success
│ │   Flags:               updatable
│ │   Last modified:       2019-09-20 14:53
│ │   GUID:                b585990a-003e-5270-89d5-3705a17f9a43
│ │
│ └  New version:       1.2.3
│
└Integrated Webcam™:
  │   Device ID:           08d460be0f1f9f128413f816022a6439e0078018
  │   Modified version:    1.2.2
  │   Update State:        success
  │   Flags:               updatable
  │   Last modified:       2019-09-20 14:53
  │   GUID:                b585990a-003e-5270-89d5-3705a17f9a43
  │
  └  New version:       1.2.4
```

Sample output from `get-updates`
```
Integrated Webcam™:
  │   Device ID:           08d460be0f1f9f128413f816022a6439e0078018
  │   Summary:             A fake webcam
  │   Current version:     1.2.2
  │   Previous Version:     1.2.0
  │   Bootloader Version:  0.1.2
  │   Vendor:              ACME Corp. (USB:0x046D)
  │   Flags:               updatable|supported|registered
  │   GUID:                b585990a-003e-5270-89d5-3705a17f9a43
  │
  ├FakeDevice Firmware:
  │     New version:       1.2.4
  │     Remote ID:         fwupd-tests
  │     Summary:           Firmware for the ACME Corp Integrated Webcam
  │     License:           GPL-2.0+
  │     Size:              17 bytes
  │     Vendor:            ACME Corp
  │     Flags:             is-upgrade
  │     Description:       Fixes another bug with the flux capacitor to prevent time going backwards.
  │
  └FakeDevice Firmware:
        New version:       1.2.3
        Remote ID:         fwupd-tests
        Summary:           Firmware for the ACME Corp Integrated Webcam
        License:           GPL-2.0+
        Size:              17 bytes
        Vendor:            ACME Corp
        Flags:             is-upgrade
        Description:       Fixes a bug with the flux capacitor to avoid year 2038 overflow.
```
2019-09-20 16:02:55 -05:00
Richard Hughes
94422f651e Only force a semver when the device opts-in
This is only used by one, so-far out-of-tree plugin. Reduce complexity by not
using the version format to decide if we're forcing a semver.
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
Richard Hughes
cce6a1cb5a Do not report transient failures
We don't need to report failures to do with AC or battery level to the LVFS.
2019-04-17 08:20:44 +08:00
Richard Hughes
dce91204c9 Fix some typos spotted using codespell 2019-04-08 12:47:53 +01: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
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
56445b0936 trivial: Fix missing G_BEGIN_DECLS's from public includes 2019-02-10 08:59:07 +00:00
Richard Hughes
bfd946e463 Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
Richard Hughes
1bc432316a Defer the InstanceID->GUID hashing until after setup
This allows hardware from OEMs to *not* match generic firmware supplied by the
device manufacturer. The idea being, that the OEM will supply firmware that
will actually work on the device.

Based on a patch from Mario Limonciello, many thanks.
2019-02-06 08:02:16 +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
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
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
Mario Limonciello
e3016602f8 Include serial number in daemon device output when trusted
This moves the storing of the serial number into the daemon and
when the calling process is UID 0 includes it in device output
2018-09-06 13:34:28 -05:00
Mario Limonciello
9c3a6fd60f Add a new device flag "ignore-validation" that will override validation checks
This flag isn't really intended for production, but more for development
to allow setting a quirk for a device during a transition period.
2018-09-05 08:03:28 -05: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
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
7a874176ff trivial: Add a FuDevice flag to show the device is in bootloader mode
This is useful to present to the user using the command line, and means each
FuDevice-deriving object does not have to handle this.
2018-05-31 18:50:19 +01:00
Mario Limonciello
51308e648a Adjust all licensing to LGPL 2.1+ (Closes: #526) 2018-05-29 09:03:13 +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
d5982a1144 trivial: Use bitshifts when defining FwupdInstallFlags 2018-05-14 18:54:15 +01:00
Richard Hughes
9f86ade6bf Allow plugins to define the order composite firmwares are installed 2018-05-12 20:46:02 +01:00
Richard Hughes
fbf17e9c85 Allow devices to use the runtime version when in bootloader mode
Some devices like the Nitrokey use a generic DFU bootloader that reports a
version number unrelated to the version number of the runtime. Add a flag so
that we can set the correct version when switching plugins during detach and
attach.
2018-02-16 18:23:07 +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
d0d2c8b84e trivial: Add FWUPD_DEVICE_FLAG_REPORTED
This flag is present in the history database when a report has been uploaded.
2018-01-11 10:18:37 +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
95ca91a515 trivial: Clarify two gtk-doc comments to explain the flags better 2017-11-11 21:06:14 +00:00
Richard Hughes
f50eca4f55 trivial: Add FWUPD_STATUS_DEVICE_BUSY
This is when we're waiting for the device, but we don't know why.
2017-10-12 12:43:25 +01:00
Richard Hughes
e9c0a3c8cd trivial: Fix up some gtk-doc introspection issues in libfwupd 2017-10-05 10:32:05 +01:00
Richard Hughes
87f8a4a284 Add a waiting-for-auth daemon state
Using IDLE for this isn't right as we're basically blocked on the user.
2017-10-02 14:50:26 +01:00
Richard Hughes
b73ff8a346 trivial: Use FwupdStatus in the dfu plugin 2017-09-28 09:23:52 +01:00
Richard Hughes
94110f5983 Remove some deprecated #define names and bump the soname
Also, bump soname as we're going to clean up a lot of things now.

Many thanks to Mario Limonciello for all the Debian-specific changes.
2017-09-28 09:23:52 +01:00
Richard Hughes
b4fd0dfd7d Move deprecated symbols to a new header
This does two things:

 * Allows new users of the library to see only the supported symbols
 * Allows us to ensure we're not using deprecated API internally

I can also use this in gnome-software in CI to make sure we're not using
deprecated API too. I don't think we're ready for a soname bump so we have to
hang on to the deprecated code for now.
2017-09-08 13:31:01 +01:00
Richard Hughes
a785a1c2f6 Remove the confusing ALLOW_OFFLINE and ALLOW_ONLINE flags
Over the months the original meaning of ALLOW_OFFLINE and ALLOW_ONLINE have be
lost, and there is now a confusing mixture of uses in the source tree. With this
commit we make it clear the UPDATABLE flag is used to specify when the device is
updatable (e.g. from the desktop live session, or from the systemd offline
updates mode, or both) and the NEEDS_REBOOT flag lets us know when the update
is actually going to be done.

For instance, a UEFI UpdateCapsule can be *scheduled* from either the desktop
or from the update mode (but the latter would be a bit weird), but does require
a reboot. Some devices might only be updatable outside the live session, for
instance a hard drive update or a GPU update -- there's just too much going on
with a live session and we want to tightly control what's running during the
firmware flash.

This also means we don't have to "retry" the update when scheduling an update
that really can be scheduled whenever, but just requires a reboot to apply.
2017-08-26 18:09:21 +01:00
Richard Hughes
e1fd34d5f1 Allow plugins to set metadata on devices created by other plugins
This could be used, for instance, to set a property on ThunderBolt controllers
inside Dell computers saying that they support forcing the power level during
coldplug. It could also be used to set the dock type for the synapticsmst hub.

Adding this level of complexity allows us to avoid the creep of HAVE_DELL and
HAVE_LENOVO into seemingly unrelated plugins, and also allows us to have
multiple vendor plugins providing the same end result with two different
vendor-specific mechanisms.
2017-08-24 16:15:11 +01:00
Richard Hughes
7403dc505f Optionally use GnuTLS to verify PKCS7 certificates
We can use this as an alternative for GPG. No PKCS7 certificates are currently
installed by fwupd and it's expected that the LVFS will still only provide GPG
detached signatures.

If an OEM distributor wants to sign firmware with a PKCS7 and the corresponding
certificate is provided then the firmware will be marked as valid.

Only firmware shipping with a .p7b file will use the PKCS7 functionality,
similarly remote metadata validation will default to GPG unless Keyring=pkcs7
is specified in the config file.
2017-08-14 09:42:48 +01:00
Richard Hughes
2899cb28d5 Show progress download when refreshing metadata 2017-06-13 16:31:18 +01:00
Richard Hughes
812d1b708d trivial: Spit out non-enum functionality into a common file 2017-06-06 16:27:47 +01:00
Richard Hughes
644562e291 Use the correct define prefix for FwupdDeviceFlags
Also, add the compat flags so we don't break API.
2016-08-22 10:30:24 +01:00
Richard Hughes
adb7a4979b Add FU_DEVICE_FLAG_NEEDS_BOOTLOADER 2016-08-17 17:46:15 +01:00
Richard Hughes
33a518a615 Add another compile warning and fix up any build failures 2016-07-27 16:57:36 +01:00
Richard Hughes
2c553607e3 trivial: Fix gtk-doc wording of the device flags 2016-05-17 16:05:49 +01:00