Commit Graph

142 Commits

Author SHA1 Message Date
Richard Hughes
41cbe2aab3 Add a firmware builder
This runs a script inside the firmware archive to generate firmware specific to
the machine. This uses bubblewrap to protect the local machine.
2017-08-09 10:33:39 +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
ba51279752 trivial: Fix two tiny leaks in fwupdmgr 2017-07-27 16:32:43 +01:00
Mario Limonciello
9ac53e28b1 Add information about compile-time dependency versions
Since the codebase looks at these versions for turning on and off
functionality it will be useful to use this for debugging
2017-07-24 15:30:28 -05:00
Mario Limonciello
dc8c985159 trivial: back the requirement on appstream-glib to 0.6.9
The items that 0.6.13 requires are now guarded by a version test.
This should allow running fwupd master on more distros that haven't
yet picked up appstream-glib 0.6.13.
2017-07-10 14:32:42 -05:00
Richard Hughes
b3dca14e90 trivial: Never compare a string against zero to avoid warnings 2017-07-06 18:28:01 +01:00
Mario Limonciello
b04c13e1cf Include optional git checkout information in --version
When users are running from git this should aide in
debugging if they have a fix included.
2017-07-05 17:49:50 -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
b53ad36012 trivial: Fix up a number of FALSE/NULL return issues 2017-06-19 13:50:42 +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
bbde1df44f Fix downgrades when version_lowest is set
Also, add some tests to test this with the dummy device.
2017-06-16 12:40:15 +01:00
Richard Hughes
8a870d0399 trivial: Ensure there are no updates after the update is applied 2017-06-16 12:40:10 +01:00
Richard Hughes
954de52612 trivial: Make --verbose work in fwupdmgr 2017-06-16 07:59:02 +01:00
Richard Hughes
40aeea4167 trivial: Show the release (not device) checksums in 'fwupdmgr get-updates' 2017-06-16 07:59:02 +01:00
Richard Hughes
c2a20d7fff trivial: Show the release (not device) checksums in 'fwupdmgr get-releases' 2017-06-15 20:19:03 +01:00
Richard Hughes
109526bf34 trivial: Fix a harmless warning when building RPMs 2017-06-15 11:07:00 +01:00
Richard Hughes
18b73a4bdd trivial: Return with exist code 0 when there is nothing to do 2017-06-14 15:16:06 +01:00
Richard Hughes
2899cb28d5 Show progress download when refreshing metadata 2017-06-13 16:31:18 +01:00
Richard Hughes
b86484a585 Export some more API for dealing with checksums 2017-06-09 10:11:58 +01:00
Piotr Drąg
748ae3154e trivial: Fix a typo in a translatable string (#132) 2017-06-07 16:59:40 -05:00
Richard Hughes
cffef2654b trivial: Include the device name in the output of 'fwupdmgr get-releases'
If only one device is present, then it's not obvious what this output refers to.
2017-06-07 15:34:53 +01:00
Richard Hughes
97fc78bbc3 trivial: Fix a harmless warning from clang 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
7e206447a8 Use the user cache directory for firmware
We don't need to redownload this multiple times if we have multiple devices
needing the same firmware update.
2017-06-06 12:22:30 +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
45c1545b0a Add a 'downgrade' command to fwupdmgr
This allows the user to downgrade the firmware on a device.
2017-06-06 09:44:47 +01:00
Richard Hughes
224002ab38 Prompt for the device ID if nothing specified in get-releases
This makes it somewhat easier to use for the common case.
2017-06-06 09:34:46 +01:00
Richard Hughes
e4a100cfee Add a GetReleases() D-Bus call to return all releases for a device
This allows us to downgrade firmware in the future.
2017-06-05 17:42:57 +01:00
Richard Hughes
1642b3b95a Deprecate the old FwupdResult API
It will be removed next time we bump soname.
2017-06-05 17:41:11 +01:00
Richard Hughes
502a2ca64a Do not re-download firmware that exists in the cache 2017-06-05 09:23:10 +01:00
Richard Hughes
b8f8db2082 Add support for Microsoft HardwareIDs
This commit provides a new "hwids" subcommand for fwupdmgr that shows the
hardware GUIDs on the local system. It also provides API that plugins can use
to self-disable when a specific HWID does not match.

The GUIDs used in this implementation match that of ComputerHardwareIds.exe
2017-06-04 19:46:36 +01:00
Richard Hughes
0b57806b68 Use the correct user and password for the firmware download 2017-06-02 13:19:08 +01:00
Richard Hughes
90bcd058f0 Return the remote ID when getting updates about hardware 2017-06-02 13:19:08 +01:00
Richard Hughes
1b50d960f2 Send the daemon the remote ID when sending updated firmware metadata
This allows us to 'tag' the components with the correct remote ID value, which
then means we can tell where the firmware information has come from when saving
a composite store. It also allows us use the correct username and password in
the future when downloading the firmware blob itself.

Keep the old D-Bus method around to preserve API for existing clients.
2017-06-02 13:19:05 +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
Eric Koegel
23603f0452 Add support for ConsoleKit2
Make systemd and ConsoleKit support an optional compile time flag
with both enabled by default. If both are used, the ifdef/elif will
ensure only the systemd calls are used so there's no conflict.
2017-06-01 09:00:16 +01:00
Richard Hughes
741dc5054a trivial: Use g_autoptr for the fwupdmgr private data 2017-05-08 20:38:17 +01:00
Richard Hughes
df5652ffb5 trivial: Return a sensible error if DownloadURI is intentionaly left blank 2017-05-08 19:06:08 +01:00
Richard Hughes
860640e32a trivial: Fallback to the system-wide config file if running from tree 2017-05-08 19:04:25 +01:00
Richard Hughes
b0fce88754 Do not spew a critial warning when parsing an invalid URI 2017-05-08 19:02:24 +01:00
Richard Hughes
ee401a17c4 Support proxy servers in fwupdmgr 2017-04-14 19:56:04 +01:00
Richard Hughes
da3ec457c4 Use a 60 second timeout on all client downloads 2017-04-14 19:46:57 +01:00
Richard Hughes
74702297b2 Move the Option ROM parsing to the Udev plugin 2016-12-15 17:09:38 +00:00
Richard Hughes
29c220db9f Add VerifyUpdate to update the device checksums server-side 2016-12-15 17:09:37 +00:00
Mario Limonciello
e781bb9b64 trivial: fix cosmetic fallout from provider -> plugin
some code (such as libfwupd) still internally refers to provider,
but this will need to be more carefully massaged
2016-12-13 12:25:09 -06:00
Richard Hughes
cff38bcb3a Convert the providers to plugins to simplify code and for future features
This is a large commit that removes all the providers and turns them into
plugins. I think having both providers _and_ plugins was super confusing.

Plugins are loaded at runtime so you could in theory develop a new plugin
without putting it in the fwupd source tree, although there are no installed
headers or PC files as I'm not sure it's a good idea at this stage.

This commit moves all the per-provider docs, tests, notes, debug dumps and test
data to plugin-specific directories -- these also allows the plugin author to
"own" more of the source tree so we don't enforce fu- prefixes and the style
guide everywhere.

This allows us to run the same action on all the plugins in the future, so we
could have a prepare(FuPlugin, FuDevice) and cleanup(FuPlugin, FuDevice) run
on *all* plugins, so doing an update using one plugin would allow us to work
around hardware quirks in other plugins.

If I've broken your out-of-tree provider it's trivial to port to the new API
with sed and a fixed up build file. If you need help please let me know.
2016-12-12 12:31:23 +00:00
Mario Limonciello
11dee100af Clarify the test in --help and man page related to offline (#69) 2016-10-19 15:56:48 -05:00