Commit Graph

328 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
Mario Limonciello
bd60825749 libfwupd: Allow skipping machine ID self test (Fixes #403)
Some sandbox environments won't allow creating this file, so skip
this test.

We're still running it on all Travis CI test cases though.
2018-02-14 07:00:36 +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
03fa8c1002 trivial: Don't upload the DeviceID when sharing history
We don't use it on the LVFS, and it's not useful for debugging problems.
2018-01-26 09:30:49 +00:00
Richard Hughes
b58104895d trivial: Add fwupd_build_history_report_json() for future use 2018-01-11 21:28:22 +00:00
Richard Hughes
d0adb23968 Allow adding metadata to the FwupdRelease 2018-01-11 20:52:58 +00:00
Richard Hughes
d29df0819f Allow specifying the reporting server in the remote key files 2018-01-11 20:20:00 +00:00
Richard Hughes
ae142a411f trivial: Parse the os-release file in a more useful way
This allows us to use the other keys for future use.
2018-01-11 10:30:39 +00:00
Richard Hughes
6b22295cf0 Add a D-Bus method to modify a historical device
This allows us to set specific flags on the device stored in the database.
2018-01-11 10:20:48 +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
476363ac19 Add a D-Bus method to get the history information 2018-01-11 10:08:58 +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
b73e70b205 trivial: Use the shared fu_test_compare_lines() in the dfu plugin 2018-01-11 09:59:34 +00:00
Richard Hughes
f1ed711c7e trivial: Add fwupd_build_machine_id()
This allows us to identify a specific machine using the machine-id.
2018-01-11 08:16:55 +00:00
Richard Hughes
8f89cf04fb Add more metadata to the user-agent string 2017-12-21 08:25:29 +00:00
Richard Hughes
ec2df91c15 Support AppStream metadata with relative <location> URLs
If a remote like LVFS outputs <location>foo.cab</location> without a prepended
hostname and path then we should use the metadata URI hostname and path instead.

This allows us to trivially mirror a firmware repository, although clients using
older versions of libfwupd will not work without this patch. We should encourage
people to use `FirmwareBaseURI` for a long time yet.
2017-12-04 15:46:54 +00:00
Richard Hughes
d0cff7caec Remove autoconf-isms from the meson configure options
See https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
2017-11-27 18:07:53 +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
8175f6d136 libfwupd: Remove a pointless call to fwupd_remote_build_uri() 2017-11-09 12:15:30 +00:00
Richard Hughes
98a8046d7b trivial: Fix a tiny memory leak when processing signals from the daemon 2017-10-19 17:13:19 +01: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
f497dac356 trivial: Skip some self tests if the running fwupd is too old 2017-10-05 21:18:15 +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
7f6d78fb1b Add fwupd_remote_get_checksum() to use in client programs 2017-09-28 09:23:52 +01:00
Richard Hughes
d727929327 Generate the LD script from the GObject Introspection data
Also, we now verify the version script is correct each time we run the tests;
the consequences of getting the version script wrong are terribly bad.

Note, we can't actually use generated .map file for two reasons:

  1. We don't hard depend on GObject Introspection
  2. The map file is required to build the lib that the GIR is built from

To avoid the circular dep, and to ensure we don't change exported API
accidentaly actually check in a version of the version script to git.
2017-09-28 09:23:52 +01:00
Richard Hughes
9342996e7e trivial: Use more defined result keys for FwupdRemote
Specifically here we want to use 'RemoteId' rather than just 'Id'...
2017-09-28 09:23:52 +01:00
Richard Hughes
b2fb80925c trivial: Remove fwupd_remote_get_filename()
The data for these was just being generated internally based on the ID and the
basename of the original URI, and that's easy for the calling application to do
itself.
2017-09-28 09:23:52 +01:00
Richard Hughes
642ec13754 trivial: Remove GetUpdates as it is no longer used 2017-09-28 09:23:52 +01:00
Richard Hughes
b73ff8a346 trivial: Use FwupdStatus in the dfu plugin 2017-09-28 09:23:52 +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
7965721015 trivial: Restore a sensible amount of padding in the FwupdClientClass
We broke API recently, we might as well go full throttle.
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
5b20c18656 trivial: Convert FwupdRemote from a FINAL to DERIVABLE type
The latter is best-practice in a library so that objects can be superclassed by
client programs.
2017-09-28 09:23:52 +01:00
Richard Hughes
9e1b14067c trivial: Always use a a{sv} type to return value
Mixing sa{sv} and a{sv} made everything very confusing...
2017-09-28 09:23:52 +01:00
Richard Hughes
10c6a89563 trivial: Do not use 'provider' in the public API 2017-09-28 09:23:52 +01:00
Richard Hughes
80893e29fe trivial: Remove FwupdResult from libfwupd 2017-09-28 09:23:52 +01:00
Richard Hughes
696934a7c3 trivial: Remove deprecated FwupdResult API 2017-09-28 09:23:52 +01:00
Richard Hughes
fbc5101e56 trivial: Remove the deprecated FWUPD_RESULT_KEY_DEVICE_CHECKSUM_KIND 2017-09-28 09:23:52 +01:00
Richard Hughes
b86ef97b36 trivial: Remove fwupd_remote_build_uri()
This also removes the long-deprecated fwupd_remote_get_uri() and fwupd_remote_get_uri_asc()
2017-09-28 09:23:52 +01:00
Richard Hughes
ba73c76d69 trivial: Remove the deprecated fwupd_client_update_metadata()
Also, rename fwupd_client_update_metadata_with_id() to it's now-removed counterpart.
2017-09-28 09:23:52 +01:00
Richard Hughes
07f963a52d trivial: Remove the deprecated fwupd_client_get_details()
Also, rename fwupd_client_get_details_local() to it's now-removed counterpart.
2017-09-28 09:23:52 +01:00
Richard Hughes
eb94c14022 trivial: Remove the deprecated fwupd_client_get_devices()
Also, rename fwupd_client_get_devices_simple() to it's now-removed counterpart.
2017-09-28 09:23:52 +01:00
Richard Hughes
f90cc4507f trivial: Remove two more deprecated defines 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
8880cd09e4 trivial: Fix up some introspection issues 2017-09-19 09:54:16 +01:00
Richard Hughes
fe09a0010f trivial: Allow adding more than one FwupdRelease to a FwupdDevice 2017-09-15 20:09:03 +01:00
Richard Hughes
93b1576bef trivial: Add helpers that can be used for returning local files
This also allows us to drop the use of FwupdResult in the daemon.
2017-09-15 14:12:18 +01:00
Richard Hughes
cc3de2efa4 Do not store the newest release as part of the FuDevice object 2017-09-15 14:12:18 +01:00
Richard Hughes
a96413a368 Add a method to return a list of upgrades for a specific device 2017-09-15 14:12:18 +01:00
Richard Hughes
97284b1ad8 Move the downgrade calculation to the daemon 2017-09-15 14:12:18 +01:00
Richard Hughes
68982c6624 Make FuDevice derive from FwupdDevice rather than FwupdResult
We're aiming for a model where devices can have multiple releases and we can
nuke FwupdResult completely.
2017-09-15 14:12:18 +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
30dbf0d7d0 Remove the UniqueID property
This was only ever added for gnome-software, and is too inflexible for anything
else. It turns out we don't even need it in GNOME, as we can construct a
suitable ID ourselves using the existing values.

It was also ambiguous whether the unique ID was in reference to the device
or release -- and for gnome-software we need both.
2017-09-13 15:28:33 +01:00
Richard Hughes
8cee383f65 trivial: Add the missing functionality to proxy the update error string 2017-09-13 14:59:32 +01:00
Richard Hughes
a1aab517d1 Move the update state to FwupdDevice
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 former, and that's how plugins are using it.
2017-09-13 14:59:32 +01:00
Richard Hughes
d3b93f83ed trivial: Fix a small memory leak in fwupd_device_to_string() 2017-09-12 19:57:08 +01:00
Richard Hughes
539a830a36 trivial: Fix a tiny memory leak when setting the summary 2017-09-12 19:34:51 +01:00
Richard Hughes
c1c2fec6f5 Add optional icons to each device
This allows us to show the devices in a GUI with a nice icon. Some of the icon
mappings are not perfect and I'll be asking the GNOME designers for some
additions to the icon specification.

Custom vendor icons can also be specified, and /usr/share/fwupd/icons would be
a good place to put them. If vendor icons are used they should show a physical
device with the branding, rather than just the vendor logo.
2017-09-11 17:27:35 +01:00
Richard Hughes
6c6e8d3ab8 Add an 'Summary' property to each device
This was already exported in the libfwupd API, but it had no way of being set
from devices or passed from daemon to client.
2017-09-11 09:30:06 +01:00
Richard Hughes
48ad97fd61 Add a human-readable title for each remote
This allows us to show something useful in a GUI.
2017-09-10 09:08:32 +01:00
Richard Hughes
b3c13461e9 trivial: Use the error domain from libfwupd
This means we don't need to convert the error code in the dfu plugin.
2017-09-08 13:33:34 +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
a6bd5580d3 Add ModifyRemote as an easy way to enable and disable remotes like the LVFS
For example:

    $ fwupdmgr modify-remote lvfs-testing Enabled true
2017-09-07 23:02:58 +01:00
Richard Hughes
ad1d9b1769 trivial: Fix a tiny leak in FwupdRemote 2017-08-31 20:07:06 +01:00
Yehezkel Bernat
e43f7fb655 trivial: cleanup for many compilation warnings from clang
Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2017-08-30 10:43:15 +01:00
Richard Hughes
eb0b3ad71a libfwupd: Correctly set the ID ownership when using g_object_set()
Fixes half of https://github.com/hughsie/fwupd/issues/210
2017-08-30 10:34:59 +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
e116e2a6a6 trivial: Add the missing device flag to string functionality 2017-08-26 09:50:18 +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
c6afb51e32 Add a FirmwareBaseURI parameter to the remote configs
This allows somebody to mirror the CDN without resigning the metadata files.

Fixes: https://github.com/hughsie/fwupd/issues/186
2017-08-23 14:22:12 +01:00
Richard Hughes
0dea1efb92 Use MetadataURI for both kinds of remote
I think this is clearer having one key for both types of remote.
2017-08-23 14:22:08 +01:00
Richard Hughes
3a0d3d5b58 trivial: Fix two introspection warnings 2017-08-22 10:37:26 +01:00
Richard Hughes
99e621d388 Save the metadata signature in the local cache
This is useful if the admin wants to re-verify the metadata, or if a public
key is removed or expires.
2017-08-16 13:42:10 +01:00
Richard Hughes
18c2a689d2 trivial: Reorder a function in a header 2017-08-16 13:42:10 +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
2d95a71a0c Support embedded devices with local firmware metadata
In this mode, both the metadata and firmware is stored on the local filesystem
and distributed using a distribution system like OSTree.

Fixes https://github.com/hughsie/fwupd/issues/162
2017-07-28 17:41:24 +01:00
Patrick Ohly
eb03b0f33d meson: introspection optional
Calling g-ir-scanner when cross-compiling with bitbake/OpenEmbedded
fails because it calls the wrong ld (the one from the host). More work
will be needed in meson.bbclass and/or gobject-introspection.bbclass
to make it work.

In the meantime, having an option to turn of introspection is useful
perhaps also in other cases where the extra work is not needed. For
example, fwupd works fine also when it is off.

The name of the new meson option matches the --disable-introspection
that is used by some autotools-based projects.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2017-07-26 13:29:21 +01:00
Richard Hughes
3cca1c65c2 trivial: Remove or downgrade some superfluous warnings
Fixes bugs like https://github.com/hughsie/fwupd/issues/159
2017-07-21 13:38:27 +01:00
Mario Limonciello
790701f32b trivial: adjust get-details and get-devices output Display Name output
This returns them back to the more readable 0.8.x behavior where
devices have the name first and then all the details indented.
2017-07-13 16:22:19 -05:00
Mario Limonciello
7e9924d7a7 trivial: Adjust get-devices output order
Since changing how the data was shuffled from earlier fwupd versions
the device name is no longer output at the top of the list, fix that.
2017-07-05 17:16:18 -05:00
Richard Hughes
89483f1bb9 Add --version option to fwupdmgr
$ fwupdmgr --version
    client version:	0.9.6
    daemon version:	0.9.6

Fixes https://github.com/hughsie/fwupd/issues/153
2017-07-04 20:49:27 +01:00
Richard Hughes
7ee053df51 trivial: Actually generate complete GObjectIntrospection data 2017-06-21 15:32:08 +01:00
Richard Hughes
0eaca2da65 trivial: Fix test failure with de5dd8f3 2017-06-19 14:01:27 +01:00
Richard Hughes
b53ad36012 trivial: Fix up a number of FALSE/NULL return issues 2017-06-19 13:50:42 +01:00
Richard Hughes
de5dd8f33d trivial: Include the name in fwupd_device_to_string() 2017-06-19 13:26:47 +01:00
Richard Hughes
1f162e2f16 Implement the GetDetails->GetDetailsLocal fallback client side
This allows us to get rid of some more complex daemon code.
2017-06-19 09:56:43 +01:00
Richard Hughes
cda1cdf606 Also watch the metadata cache filename for changes
If something changes the cache behind our back (e.g. deleting or updating the
file) we need to reload the list of remotes so that the age is correctly shown.
2017-06-16 21:49:37 +01:00
Richard Hughes
feb8027ee3 Show the age of the remote metadata in 'fwupdmgr get-remotes'
Note: we have to transfer the mtime (not the age) when creating the GVariant,
as we want calls to fwupd_remote_get_age() to update the value without getting
the remote from the daemon each time.
2017-06-16 20:24:41 +01:00
Richard Hughes
0a87f6fb03 Store the metadata files rather than merging to one store
Now we have multiple remotes that can be enabled or changed at runtime we need
to do several things better:

* Only load components from remotes that are enabled

* Only load a component if a higher priority remote has not already added it

Rather than just appending all recieved metadata into one big XML file, save
the original metadata .xml.gz files in /var/lib/fwupd/remotes.d and only load
them in the correct priority order if the remote is known and enabled.

Remove the old /var/cache/app-info/xmls/fwupd.xml file, also noting it wasn't
really a cache file at all but actually something quite important.
2017-06-16 16:43:13 +01:00
Richard Hughes
4c36970445 Move the remotes parsing from the client to the server
This allows us to load the metadata stores in a more sensible way in the future.
2017-06-16 15:31:40 +01:00
Richard Hughes
f0bde3e4af Add a get-remotes command to fwupdmgr
This allows the user to show the configured remotes.
2017-06-16 14:31:20 +01:00
Richard Hughes
a71e0a71f6 Allow ordering the metadata remotes
This allows us to load one metadata source file before or after another.
2017-06-16 12:40:24 +01:00
Richard Hughes
402a438bae trivial: Show a better message when failing to connect to the system D-Bus 2017-06-14 15:15:41 +01:00
Richard Hughes
2899cb28d5 Show progress download when refreshing metadata 2017-06-13 16:31:18 +01:00
Richard Hughes
f04923ae2f trivial: Don't fail to refresh if a remotes.d does not exist
Resolves: https://github.com/hughsie/fwupd/issues/137
2017-06-13 10:16:36 +01:00
Richard Hughes
fd381cc96e Add the ability to restrict the firmware installation to specific vendor IDs
This allows us to fix https://github.com/hughsie/lvfs-website/issues/4
2017-06-12 20:22:25 +01:00
Richard Hughes
b86484a585 Export some more API for dealing with checksums 2017-06-09 10:11:58 +01:00
Richard Hughes
d80666281c trivial: Do not run any tests if configuring with -Denable-tests=false 2017-06-08 08:43:21 +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