Commit Graph

64 Commits

Author SHA1 Message Date
Richard Hughes
9bc9debd98 Allow uploading security attributes to the LVFS
We sign the data with the client cert to allow users with LVFS accounts to
publish 'official' HSI ratings.
2020-05-21 11:48:09 +01:00
Richard Hughes
6ecc4ca144 Export the report metadata on the D-Bus interface
This allows the client to easily query metadata to upload with the report,
without exporting rarely used attributes as D-Bus properties on the interface.

It also allows us to add extra metadata values in the future without changing
the public API.
2020-05-20 19:47:53 +01:00
Richard Hughes
0c6efe2e04 Revert "Export the host vendor, family and SKU"
This reverts commit 81c371098c.
2020-05-20 19:47:53 +01:00
Richard Hughes
81c371098c Export the host vendor, family and SKU
The 'product name' is not typically what the hardware is known as. We need the
vendor, family and SKU if the user is going to recognise the hardware.
2020-05-19 19:42:45 +01:00
Richard Hughes
b246bcaecb Allow client tools to translate the HSI attributes and results
To do this, rely on the AppStream ID to map to a translated string (providing a
fallback for clients that do not care) and switch the free-form result string
into a set of enumerated values that can be translated.

This fixes some of the problems where some things have to be enabled to "pass"
and other attributes have to be some other state. For cases where we want the
user to "do" something, provide a URL to a wiki page that we update out-of-band
of fwupd releases.
2020-05-18 17:03:49 +01:00
Richard Hughes
cae111d1de Save the plugin that created the FwupdSecurityAttr
This is really useful for debugging.
2020-05-15 16:17:27 +01:00
Richard Hughes
196c6c69db Add support for the Host Security ID
The HSI specification assigns a simple text ID to the current state of firmware
security. As new vulnerabilities are found, and as protection measures are
updated, new requirements will be added to the required firmware behaviours for
each HSI value.

The HSI specification is currently incomplete and in active development, and
so the --force flag is required in all command line tools. The current ID value
will probably change on a given platform so please do not start using the result
for any kind of compliance requirements.
2020-05-11 22:11:49 +01:00
Richard Hughes
173acd2e07 Add FwupdSecurityAttr to libfwupd
This will be used to store security attributes about platform security.
2020-05-11 17:52:41 +01:00
Richard Hughes
3aaf53c6f0 Allow specifying the device on the command line by GUID
The GUID is the only stable identifier, and allowing using the GUID makes it
much easier to test specific devices.
2020-04-20 18:45:45 +01:00
Richard Hughes
1bde4fdd29 Fix the DeviceID set by GetDetails
The returned ID is the result of the SHA1 hash of the actual device ID. This
does not match anything found by the client, and so the install fails.

The symbol is exported as I think the device ID is an important identifier and
used in various fwupd tools.

When backported to the stable branch the verification should just be a static
function in src/fu-engine.c rather than a new symbol.
2020-04-20 17:42:22 +01:00
Richard Hughes
0bc65b5e97 Export the device state as part of the D-Bus interface 2020-04-07 15:04:01 +01:00
Richard Hughes
a1de20665a Load the signature to get the aliased CDN-safe version of the metadata
Switch to downloading the signature first, which we can then load to get the
suffixed build-specific URL of the actual metadata file. You need to have
libjcat 0.1.1 installed and fwupd built against the new version for this to
work.

Fixes https://github.com/fwupd/fwupd/issues/391
2020-04-03 16:27:04 +01:00
Richard Hughes
52c1a4d38e Export the release urgency
Show it in the various command line tools if it has been set by the vendor.
2020-04-02 13:22:07 +01:00
Richard Hughes
14797f8a86 Export the release creation time
Show it in the various command line tools if it has been set by the vendor.

Fixes https://github.com/fwupd/fwupd/issues/1945
2020-04-02 13:22:07 +01:00
Mario Limonciello
96117d19df trivial: 1.3.9->1.4.0
We decided to branch at 1.3.8 and backport fix only things for 1_3_X.
So bump all the new stuff to 1.4.0 (which will be next release)
2020-02-28 10:17:56 -06:00
Mario Limonciello
c1776c9ad4 Add raw versions for bootloader and lowest
The assumption is that same version format is used for all 3 of these
versions.
2020-02-25 12:20:51 +00:00
Richard Hughes
30ef455d50 Allow the client to get the list of FwupdDevice children
These can only be assigned using fwupd_device_set_parent(), typically from
fwupd_device_array_ensure_parents().
2020-01-06 15:16:48 +00:00
Richard Hughes
0ef47201eb Set the FwupdDevice parents in fwupdtool
This requires splitting out a helper function as a new symbol so it can be used
without fwupd_device_array_from_variant().
2020-01-06 15:16:48 +00:00
Richard Hughes
10079e6b8c Export the raw device version to the client --verbose output
It turns out this is really useful for debugging UEFI firmware updates which
typically use the 0x-prefixed version numbers without a version format.
2019-12-02 06:51:25 +00:00
Richard Hughes
4f023420c6 Export the device protocol to the client --verbose output
It turns out this is useful for debugging.
2019-12-01 06:31:05 -06:00
Mario Limonciello
eb4c76416c Add a new property Interactive to the daemon
Clients can use this as a hint whether the daemon is running on
a terminal.

`fwupdmgr` uses this to bypass the systemd service check.
2019-11-11 11:16:21 -06: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
f54ddf42d4 Add support for '<name_variant_suffix>' to disambiguate some firmware 2019-09-25 10:20:10 -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
Mario Limonciello
d1681e6de5 libfwupd: Add a new private function fwupd_remote_set_remotes_dir
This allows the daemon to set the base directory to store remotes.

This fixes issues with systemd where the installation prefix was set
to soemthing not writable such as `/usr/local` but systemd
`STATE_DIRECTORY` doesn't match up.

```
$ fwupdmgr refresh
Fetching metadata https://cdn.fwupd.org/downloads/firmware.xml.gz
Downloading…             [***************************************] Less than one minute remaining…
Fetching signature https://cdn.fwupd.org/downloads/firmware.xml.gz.asc

Failed to update metadata for lvfs: Error creating directory /usr/local/var/lib/fwupd/remotes.d: Read-only file system
```

It should also hopefully help with immutable systems.
2019-08-29 11:44:32 -05:00
Richard Hughes
dd71b729e8 Export functionality to build an array of objects
This makes it possible to call GetDevices in an async D-Bus call, and easily
construct an array of objects from the return value.
2019-07-03 11:44:31 +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
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
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
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
e9058499a1 trivial: Add fwupd_release_has_checksum() 2019-03-05 19:05:28 +00:00
Richard Hughes
8dd4c1c4dd Allow restricting firmware updates for enterprise use 2019-03-05 19:05:07 +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
3143bad0f5 fu-tool: Save device state to @LOCALSTATEDIR@/lib/fwupd/state.json on actions
This feature is turned on with the new fwupdtool option `--enable-json-state`

The intended use case is for ChromeOS to be able to save information about
devices on the system when `fwupdtool update` was run to display in the UX at
a later time.
2019-02-28 10:32:45 -06: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
6b78d64987 Add fwupd_guid_from_string() to drop dep on uuid
This also allows us to write mixed-endian structures and adds tests. As part of
this commit we've also changed the API of something that's not yet been in any
tarball release, so no pitchforks please.
2019-02-06 14:48:04 +00:00
Richard Hughes
b8c30b8732 Do not use efivar just to print a mixed endian GUID 2019-02-04 15:19:57 +00:00
Richard Hughes
297055c9d8 Report the DeviceInstanceIDs to fwupdmgr get-updates
This makes it much easier to write metainfo files as we don't have to ask OEMs
or ODMs to run fwupdtool or fwupd with --verbose and then sort through hundreds
of debugging statements.

The fwupdmgr get-devices output also now prints output like this:

    20EQS64N0C System Firmware
      Guid:                 ddc0ee61-e7f0-4e7d-acc5-c070a398838e
      Guid:                 40ce5954-bfa8-5762-926b-f4848cb28bc8 <- UEFI\RES_{DDC0EE61-E7F0-4E7D-ACC5-C070A398838E}

We're deliberately not showing the InstanceId lines in the get-updates command
as the instance IDs are not useful in this case. It will also only show the
InstanceID lines when run as a trusted user, for instance root.
2019-02-04 15:19:57 +00:00
Richard Hughes
592baedfff Export some of the GUID functionality 2019-02-04 15:19:57 +00: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
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
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
adeb2b1b4d Add new API to get the release protocol from the metadata 2018-12-14 18:15:01 +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
Mario Limonciello
7c10696690 Add support for devices to show an estimated flash time (Closes: #765)
This time is provided to frontends to be able to show estimates
before a user would agree to flash the device.
2018-09-26 11:35:59 +01: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
Richard Hughes
49a56a4436 trivial: Add exported fwupd_device_compare() for future use 2018-08-10 14:50:43 +01:00