Commit Graph

91 Commits

Author SHA1 Message Date
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Richard Hughes
ac56353f05 trivial: Use the correct enum name
No functional change
2021-07-30 16:35:24 +01:00
Richard Hughes
f1f0180433 trivial: Add notify::update-error support 2021-07-16 21:11:53 +01:00
Richard Hughes
9829103be9 trivial: Add some generic helpers for building JSON 2021-07-15 20:34:07 +01:00
Richard Hughes
f7a23d7c88 Allow the client to watch for more property changes 2021-07-13 14:56:01 +01:00
Richard Hughes
f34c5d4eb6 trivial: Print the GUIDs in the order they were added
This fixes the self tests on old GLib versions as the order of the
GHashTableIter is not guaranteed to be stable.
2021-07-09 15:43:45 +01:00
Richard Hughes
5343a4a083 Export the build timestamp from plugins 2021-07-08 16:31:07 +01:00
Richard Hughes
121cffe7d8 trivial: Export fwupd_device_has_icon()
This is useful in self tests.
2021-07-06 16:47:50 +01:00
Richard Hughes
7b209bb2c1 Watch for children added or removed after setup has been completed
Some devices may 'discover' child devices during poll, rather than the
more usual case of adding them as children during setup.
2021-07-02 13:27:10 +01:00
Richard Hughes
eb8e43d942 libfwupd: Show unconverted GUIDs when debugging
Add a suffix to any GUIDs that are currently unconverted InstanceIDs.

This makes plugin development much easier as you can now see why GUID
quirks in the subclassed ->setup() are not matching.
2021-06-17 16:22:06 +01:00
Richard Hughes
a02c1073f2 trivial: Fix up some of the developer docs
And add some missing content as requried.
2021-06-11 09:39:03 +01:00
Mario Limonciello
1e17457b16 Allow building the documentation with gi-docgen and gtk-doc
Until gi-docgen is declared stable support either of them.
This effectively means that hand builds and CI builds will use
gi-docgen, but distro builds use gtk-doc-tools.
2021-06-09 22:21:53 +01:00
Richard Hughes
8246e43174 trivial: Convert FwupdDevice to use @self 2021-05-10 14:35:10 +01:00
Richard Hughes
20ef071b3c trivial: Style fixes to lots of gtk-doc 2021-05-10 14:35:10 +01:00
Richard Hughes
89d45a0d91 trivial: Standardize on introspection for @error and @cancellable
Also standarize on `Returns:` for the result.
2021-04-28 16:19:50 +01:00
Richard Hughes
63bc42eace Add a composite ID that is used to identify all devices in the same physical package 2021-04-22 16:27:04 +01:00
Richard Hughes
64416bcd0a trivial: Mark more functions arguments as 'nullable' 2021-04-19 14:46:42 +01:00
Richard Hughes
6ef551a39e Never allow plugins to add a NULL GUID
Not fixing, but should help with https://github.com/fwupd/fwupd/issues/3156
2021-04-19 14:46:42 +01:00
Richard Hughes
b3f9841924 Support more than one protocol for a given device
Devices may want to support more than one protocol, and for some devices
(e.g. Unifying peripherals stuck in bootloader mode) you might not even be able
to query for the correct protocol anyway.
2021-03-01 16:14:36 +00:00
Richard Hughes
7b2621c3de trivial: Incorporate by merging the device flags
If any flags are set in the baseclass (e.g. FuDevice) then incorporating with
a FuUdevDevice or FuUefiDevice is not going to merge the flags.
2021-02-23 14:33:30 +00:00
Richard Hughes
f722b30205 libfwupd: Fix adding multiple flags to devices
Ignore the request if _all_ the new flags are already set, not just any of them.
2021-02-22 22:48:56 +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
5bb9cf9392 Fix a crash when using fwupdtool
The docs for `fwupd_device_get_children()` make it very clear that only the
parent should be assigned. Also add a warning to `fwupd_device_add_child()`
explaining it is for internal daemon use only.
2021-01-27 15:48:43 +00:00
Richard Hughes
5d534970cb trivial: Show a warning if the child device gets unref'd from the parent
Should not happen, but bugs will be bugs.
2021-01-27 15:48:43 +00:00
Richard Hughes
a378c2902b trivial: Add a GObject property for update-state
This allows us to use ::notify when required.
2021-01-13 09:13:05 +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
eddaed0c11 Allow specifying more than one VendorID for a device
Asking the user for the UID mapping isn't working very well, as it requires lots
of manual handholding. It also doesn't work very well when the device vendor
does not actually have a PCI ID or if the vendor has split into two entities.

Just use the OUI address as an additional VendorID and match any of the device
IDs against any of the metadata-supplied values.
2021-01-04 22:30:20 +00:00
Richard Hughes
4d781ae14f Revert "If incorporating the version from a subclass, also set the verfmt too"
This reverts commit c0dee27b6d.
2020-11-07 07:57:50 +00:00
Richard Hughes
11832e10af trivial: Fix a warning when generating the GtkDoc pages 2020-11-06 13:18:25 +00:00
Richard Hughes
c0dee27b6d If incorporating the version from a subclass, also set the verfmt too
Otherwise we could be left with a device that sets the expected verfmt in the
plugin _init(), but would not be inherited from the subclass. It would have:

    Version:              0.2
    VersionFormat:        triplet

...which makes no sense.
2020-11-06 13:04:34 +00:00
Richard Hughes
e612078b8d Remove the duplicate parent-child data in FwupdDevice and FuDevice
The FuDevice derives from FwupdDevice, and yet both objects have a (potentially
different) parent and set of children. This is super confusing, and just not
required.

Removing the duplication also removes a sizable memory leak when hotplugging
composite devices as the parent was ref'd by the child and the child was ref'd
by the parent in different objects... Fun to debug...
2020-10-31 13:19:11 +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
7c8a830659 libfwupd: Add async versions of the library for GUI tools
Rather than force the GUI to interact with fwupd using threads, provide
async versions so thay can be run without blocking the UI thread.
2020-09-03 15:46:57 +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
0bc65b5e97 Export the device state as part of the D-Bus interface 2020-04-07 15:04:01 +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
0731b825f4 trivial: Render large values of VersionRaw in a more portable way 2019-12-05 10:56:41 -06:00
Richard Hughes
da80c1bda3 trivial: Convert the VersionRaw value to a uint64_t for future use
This has not been in any tarball release and so isn't a ABI break.
2019-12-03 10:46:17 -06: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
Richard Hughes
be956bdb66 Allow setting the device flags using GObject properties 2019-11-25 18:10:38 -06:00
Richard Hughes
33cb526248 Print the instance IDs if the GUIDs are unconverted
This caused some head scratching about the 'missing' values when doing
fu_device_to_string() before fu_device_convert_instance_ids() had been called.
2019-09-18 17:07:39 +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
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
8356a83c4a trivial: Fix potential critical when converting empty object to GVariant 2019-03-21 17:15:43 +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
d9f1f3ce7c trivial: Export the FwupdDevice flags as readable JSON
Rather than displaying:

    "Flags" : 9,

Use the more understandable:

    "Flags" : [
      "updatable",
      "require-ac"
    ],
2019-03-04 13:16:09 +00:00