Commit Graph

228 Commits

Author SHA1 Message Date
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
8ff529debb trivial: Don't try to generate a GUID for an empty string 2019-02-07 18:56:15 +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
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
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
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
b1d1c3b089 Fix the self tests when using glib2 >=2.59.0
Replace the non-breaking space with a traditional space rather than changing
the expected output with #ifdef to allow running the tests with a daemon
compiled against an older glib2 version.
2019-02-03 17:39:43 +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
Mario Limonciello
706ab43898 libfwupd: Add support for new remote type "directory"
This remote will be used for automatically building metadata based
on files in a directory.
2019-01-29 09:21:54 -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
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
e2fa12ed2f Submit the device firmware checksum and update protocol in the submitted report
This is usually the same as the content checksum, but can be a different value
for instance in the PCR0 UEFI case.
2018-12-14 19:23:04 +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
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
3ccce7151e trivial: Mark GParamSpec values as static to reduce RSS 2018-11-14 15:32:55 +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
ef677dab81 trivial: Rename a function to better explain what it does 2018-10-17 14:41:07 +01:00
Richard Hughes
bcf875ff3b trivial: Don't use AppStream-glib in libfwupd
It's only used in one place, and that's for checking against very old versions
of the running daemon.
2018-10-11 07:54:01 +01:00
Mario Limonciello
83a8aab034 trivial: libfwupd: correct documentation for fwupd_device_set_install_duration 2018-10-10 14:31:58 -05: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
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
49a56a4436 trivial: Add exported fwupd_device_compare() for future use 2018-08-10 14:50:43 +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
70c9ab0288 Do not use /usr/bin/env in the shebang line
According to Fedora policy env must not be used as it could be overridden by
values in the PATH.

For details, https://fedoraproject.org/wiki/Packaging:Guidelines#Shebang_lines
2018-07-12 07:08:53 -05:00
Richard Hughes
e0cd6e0667 Add fwupd_device_incorporate()
This allows us to copy properties from a donor object.
2018-06-28 15:51:11 +01:00
Richard Hughes
eeb8017a29 trivial: Remove unused variable in private struct 2018-06-21 21:43:21 +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
Richard Hughes
fe221dc13d trivial: Fix up some NULL/FALSE confusion 2018-05-29 09:33:44 +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
5a878b2a08 libfwupd: Fix a crash in get-details where no device ID is set
Fixes https://github.com/hughsie/fwupd/issues/494
2018-05-04 20:44:29 +01:00
Richard Hughes
5e447293fa Add the concept of logical mappings between different devices
This allows us to find out the logical parent device, for instance in composite
devices with more than one firmware image for a single device.

We also allow lazily specifying the device parent using a GUID and the engine
then automatically sets the parent object when the GUIDs match, which allows
children and parents to exist in different plugins.
2018-05-03 08:07:04 +01:00
Richard Hughes
8aa7239240 trivial: Fix some Gtk-Doc mistakes
Fixes https://github.com/hughsie/fwupd/issues/487
2018-05-02 08:39:36 +01:00
Mario Limonciello
ed1ac2a74b Enable CentOS 7 for CI
There are a lot of hacks here;
 * Pulling newer libappstream-glib from Fedora
 * Pulling a systemd backport
 * Manually installing pillow and pygobject
 * PKCS7 is turned off (gnutls is too old)
2018-04-18 10:25:22 -05:00
Mario Limonciello
a98df55d82 Disable -Wunused-function on clang builds (Closes #467)
GLib creates two static inline functions for paramaters that may
not be used that set off warnings in clang but not gcc.

Ignore these on clang builds everywhere that
G_DEFINE_AUTOPTR_CLEANUP_FUNC is used.
2018-04-17 10:10:43 +01:00
Richard Hughes
1fd3ecf7a3 Export fwupd_remote_get_agreement()
We need to show this agreement text in every fwupd frontend and exporting a
helper function allows us to do two things:

 * Share the semi-complicated code (and fallback) to avoid copy and pasting

 * Easily change the code in the future, for instance allowing merging Metainfo
   and AppStream metadata without updating all the front ends with new logic.
2018-04-16 16:44:27 +01:00
Richard Hughes
d17dc0616f trivial: Export fwupd_get_os_release()
We need this for future client functionality and it seems a sane thing to
share.
2018-04-11 09:48:02 +01:00
Richard Hughes
86fdd975ad Prevent a client crash if the daemon somehow sends invalid data
Fixes: https://bugs.launchpad.net/ubuntu/+source/fwupd/+bug/1762617
2018-04-10 11:59:36 +01:00
Robert Ancell
911e40f1aa Fix Vala bindings:
- Name the bindings the same as the pkgconfig file
 - Update the GIR bindings to include the appropriate header file which updates
   the Vala bindings
2018-03-07 09:21:31 +00:00
Richard Hughes
8e883407c0 Fix running the self tests when no fwupd is installed
Fixes https://github.com/hughsie/fwupd/issues/409
2018-02-27 14:30:28 -06:00
Robert Ancell
5c535a53ce Generate Vala bindings 2018-02-26 06:04:27 +00: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