Commit Graph

39 Commits

Author SHA1 Message Date
Richard Hughes
a5966f7085 trivial: Codespell fixes 2021-03-19 16:42:33 +00:00
Richard Hughes
382524d82f trivial: Fix potential crash when doing crazy things
Fix the asan crash when feeding the value back into itself, e.g

    fu_firmware_set_version (firmware, fu_firmware_get_version (firmware));
2021-01-28 14:13:59 +00:00
Richard Hughes
b8dfaccce7 libfwupd: Add fwupd_release_add_location()
The metadata might want to pass more than one location URI to the client, for
instance if the file is available from more than one HTTP mirror.

Use the noun of location to match the AppStream <artifact> naming; this is the
last place where LVFS AppStream diverges from the official specification and
it would be good to bring fwupd back into line -- although the LVFS will have
to write both elements for a very long time.

See https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html

Also: we're not changing the format of the `Uri` GVariant key to preserve both
forward and backwards compatibility of the library. We can remove it when we
next break API.
2021-01-26 14:26:06 +00:00
Richard Hughes
5c9b1fcc81 Only include the start year in the copyright header
The end year is legally and functionally redundant, and more importantly causes
cherry-pick conflicts when trying to maintain old branches. Use git for history.
2021-01-07 14:48:16 +00:00
Richard Hughes
460c4b75fe Add the concept of firmware 'branches'
This allows a device to identify with different streams, for instance a Lenovo
laptop could have a coreboot firmware or a AMI firmware. The GUIDs would be the
same, but switching firmware would only be done rarely and very carefully.

Another example would be switching the Broadcom BCM57xx nework adaptors from the
vendor nonfree firmware with a signed PXE image, to the free software reverse
engineered driver with no PXE support (and thus no signed DXE) at all.

It is expected firmware would have additional metadata something like this:

    ...
    <branch>sdcc</branch>
    <description>
      <p>
        This is an alternate firmware built by the community using only free
        software tools.
      </p>
    </description>
    <requires>
      <id compare="ge" version="1.5.0">org.freedesktop.fwupd</id>
      <client>switch-branch</client>
    </requires>
    ...

Additionally, alternate branch firmware will not be returned for clients not
setting the FWUPD_FEATURE_FLAG_SWITCH_BRANCH before the GetReleases request.
2020-09-30 18:33:00 +01:00
Richard Hughes
ec2fbb054c trivial: Fix a copy paste mistake spotted by Coverity 2020-09-01 13:49:05 +01:00
Richard Hughes
ec2a4b586f trivial: Move some code for future use 2020-07-01 20:10:39 +01:00
Richard Hughes
4fd4b982ac Support LVFS::UpdateImage in GUI clients
The idea here is that we can show the user both a string and an optional
line-art image when the update has completed. The line art is often more well
understood for non-English speakers.
2020-06-26 12:29:54 +01:00
Richard Hughes
3382fb10d7 trivial: Correctly format the FwupdRelease:created attribute 2020-06-25 22:30:15 +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
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
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
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
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
8356a83c4a trivial: Fix potential critical when converting empty object to GVariant 2019-03-21 17:15:43 +00:00
Richard Hughes
e9058499a1 trivial: Add fwupd_release_has_checksum() 2019-03-05 19:05:28 +00:00
Richard Hughes
56c9c797e2 trivial: Do not print the display checksum in the JSON output
We're only guessing the format from the length, and not adding the wrapper
means it can be consumed more easily from other APIs.
2019-03-05 19:05:19 +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
Richard Hughes
b111ae3b5d trivial: Use JSON arrays properly 2019-03-01 12:49:20 +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
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
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
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
Mario Limonciello
51308e648a Adjust all licensing to LGPL 2.1+ (Closes: #526) 2018-05-29 09:03:13 +01:00
Richard Hughes
d0adb23968 Allow adding metadata to the FwupdRelease 2018-01-11 20:52:58 +00:00
Richard Hughes
e9c0a3c8cd trivial: Fix up some gtk-doc introspection issues in libfwupd 2017-10-05 10:32:05 +01:00
Richard Hughes
e0bd53e439 trivial: Use standard _to_variant() and _from_variant() forms 2017-09-28 09:23:52 +01:00
Richard Hughes
9e79223ecf trivial: C99ify more for-loops 2017-09-28 09:23:52 +01:00
Richard Hughes
603e42d527 trivial: Include the releases as part of the device a{sv} array 2017-09-28 09:23:52 +01:00
Richard Hughes
b3ca245b74 Move the release trust information to FwupdRelease
It only remained on FwupdResult because I couldn't make up my mind about whether
it was a property of the device, or the firmware release. It's more logically
the latter, as you could have a .cab file with multiple versions of the
firmware and only the first being signed.
2017-09-15 11:31:01 +01:00
Richard Hughes
7ee053df51 trivial: Actually generate complete GObjectIntrospection data 2017-06-21 15:32:08 +01:00
Richard Hughes
e979bb3269 trivial: Never allow duplicate checksums to be added to devices or releases 2017-06-07 15:34:53 +01:00
Richard Hughes
68cc00c7e9 Allow multiple checksums on devices and releases
Although we supported other hashes than SHA1 (which is now moderately unsafe)
we had to switch the metadata provider and daemon on some kind of flag day to
using SHA256. Since that's somewhat impractical, just allow multiple checksums
to be set on objects and just try to match whatever is given in preference
order.

This also means we can easily transition to other hash types in the future.

The removed API was never present in a tarball release, so not an API break.
2017-06-06 20:06:53 +01:00
Richard Hughes
81c7649dd8 libfwupd: Add fwupd_client_get_devices_simple() to return us an array of devices, not results 2017-06-06 11:10:57 +01:00
Richard Hughes
4db6c4a4b0 libfwupd: Split up FwupdResult into FwupdDevice and FwupdRelease
This retains the old API to avoid breaking ABI.
2017-06-05 17:34:36 +01:00