Commit Graph

14 Commits

Author SHA1 Message Date
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
e2a92690da Allow client code to construct objects from GVariant blobs
Rather than wrapping every sync D-Bus call with a GTask helper (hundreds of
additional lines of code and dozens of new entrypoints in libfwupd) I think it
is best for client software wanting async operation just uses the D-Bus
interface. I consider it part of the API as much as the shared library and
I don't see it changing in a non-compatible way any time soon.

Exposing these already-exported symbols allows client software to use the
demarshalling functionality and to operate on the GObjects directly from an
existing GDBus async return value.
2019-07-03 11:44:31 +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
bfd946e463 Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06: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
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
e0bd53e439 trivial: Use standard _to_variant() and _from_variant() forms 2017-09-28 09:23:52 +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
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
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
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
dfed515573 Allow downloading metadata from more than just the LVFS
Add the concept of 'remotes' that can dropped into /etc and used as firmware
metadata sources. This may be desirable when firmware is only accessable with
a valid support contract or from behind a VPN.
2017-06-02 13:19:05 +01:00