Commit Graph

1104 Commits

Author SHA1 Message Date
Richard Hughes
84bf038a52 trivial: Do not log to the journal when calling GetDetails 2017-09-16 18:52:51 +01:00
Richard Hughes
882ab6b4d0 trivial: Add a self tests for the broken metadata bug 2017-09-16 17:53:16 +01:00
Richard Hughes
820dac7fde trivial: Use a different SYSFSFIRMWAREDIR for self tests
This means we can drop some self-test specific code in fu_smbios_setup().
2017-09-16 17:46:41 +01:00
Richard Hughes
e7c6bcab3a trivial: Use a different PLUGINDIR for self tests 2017-09-16 17:44:38 +01:00
Richard Hughes
49938e6a07 trivial: Skip non-conf files when searching for remotes 2017-09-16 13:24:50 +01:00
Richard Hughes
068d34307a Do not fail to load the daemon if cached metadata is invalid
Fixes: https://github.com/hughsie/fwupd/issues/257
2017-09-16 08:26:46 +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
e7fd8eb81f trivial: Simplify the check for supported devices 2017-09-15 14:12:18 +01:00
Richard Hughes
f11fa3caac trivial: Use the new fwupd_client_get_upgrades() in fwupdmgr 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
6ab53111db Never fallback to an offline update from client code
UEFI updates don't need to be retried since a785a1c. If the call to Install()
failed with NOT_SUPPORTED we can just show the error rather than doing the
little dance and involving the offline pending database for no reason.

Fixes some of https://github.com/hughsie/fwupd/issues/255
2017-09-15 09:35:27 +01:00
Richard Hughes
31bbd1691b Add a command 'clear-offline' to fwupdmgr
This allows us to 'unschedule' any offline updates.
2017-09-15 09:33:06 +01:00
Richard Hughes
f6e4d723ca Do not store the AppStream ID in the pending database
We don't actually need it for anything and it complicates future functionality.
2017-09-14 11:45:06 +01:00
Richard Hughes
27e5df2fe7 trivial: Fix a tiny leak in the daemon 2017-09-14 11:28:50 +01:00
Richard Hughes
ba15eebabb trivial: Show the RemoteID when printing available releases 2017-09-14 10:26:15 +01:00
Richard Hughes
d140210b4f trivial: Fix up the hex version numbers when adding to the store
This means we show the 'human readable' version numbers in the debug UI.
2017-09-14 10:26:15 +01:00
Richard Hughes
bd4d2856dd Merge releases where multiple remotes provide the same firmware
For a few months the lvfs-testing remote has not included firmware already
present in the stable lvfs remote. This means if you enable the testing remote
then components in the stable remote are not available to fwupd.

Instead of a simplistic check on the component ID, add the missing releases
no matter the ordering of the remotes.
2017-09-14 10:26:15 +01:00
Richard Hughes
fc0d170334 trivial: Show the available release versions in the daemon debug output
Also, truncate the output when there are lots of versions available.
2017-09-14 10:26:15 +01:00
Richard Hughes
225f3a98fe trivial: Sort the releases returned by GetReleases() 2017-09-13 19:38:51 +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
9dde04fbda trivial: Split out some functionality not to be used by plugins 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
d2b4fc5e00 trivial: Set the AppStream ID when returning results from GetReleases
We need this for GUI software.
2017-09-12 16:42:46 +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
6fae095fe5 trivial: Less whitespace in the output of fu_device_to_string() 2017-09-11 10:29:52 +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
304ffe4db7 trivial: Fix two big-endian issues in FuSmbios 2017-09-08 09:24:54 +01:00
Richard Hughes
564ad3103b trivial: Fix up a formatting specifier in FuSmbios
Fixes: https://github.com/hughsie/fwupd/issues/233
2017-09-08 09:03:45 +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
1941c44559 Do not auto-open all USB devices at startup
Fixes: https://github.com/hughsie/fwupd/issues/220
2017-09-07 19:00:51 +01:00
Richard Hughes
92faae9a41 usb: Use FuDeviceLocker 2017-09-07 19:00:51 +01:00
Richard Hughes
7c52580f9c Add FuDeviceLocker to simplify device open/close lifecycles
We can use the power of g_autoptr() to automatically close devices that have
gone out of scope. When everything is converted we can drop the GUsbContect
AUTO_OPEN_DEVICES flag which is making us look bad in powertop.
2017-09-07 19:00:51 +01:00
Richard Hughes
49e5e05aa8 Parse the SMBIOS DMI table directly
The Linux DMI class still does not provide the information we need, and parsing
the blob directly also allows the Dell and Redfish plugins to get the raw data.
2017-09-05 18:10:36 +01:00
Richard Hughes
19ff7b9571 trivial: Add fu_device_to_string()
This allows us to easily print the FwupdDevice, the FwupdRelease and the
daemon-specific metadata. This can only be called from the daemon or plugins.
2017-09-04 13:27:48 +01:00
Richard Hughes
adc9dadcf2 trivial: Fix the included headers for fu-common.h
The GCancellable object is in gio-2.0.
2017-09-04 13:19:27 +01:00
Richard Hughes
f315719851 trivial: Fix up a literal format string in fwupdmgr 2017-08-31 20:00:01 +01:00
Richard Hughes
1f92addd10 trivial: Remove unused function in fwupdmgr
Fixes 2nd half of https://github.com/hughsie/fwupd/issues/209
2017-08-30 10:51:51 +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
60eaca18fb trivial: Fix a const-correctness issue discovered using clang
Fixes: https://github.com/hughsie/fwupd/issues/210
2017-08-30 10:37:56 +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
Mario Limonciello
3bc251b3a8 thunderbolt: when in safe mode on a Dell system look up VID/DID from SMBIOS
Signed-off-by: Richard Hughes <richard@hughsie.com>
2017-08-25 09:46:41 +01:00
Mario Limonciello
35a0e864b8 Introduce concept of CanForcePower to turn on TBT controllers
Supported Dell devices will use this to turn on ThunderBolt controllers
during coldplug.
2017-08-25 09:35:46 +01:00
Richard Hughes
55566b53e6 Allow plugins to set boolean and integer metadata
Handling this in one place prevents plugins setting different values for
non-string values like TRUE/false or with different ways to represent integers.
2017-08-25 09:22:05 +01:00
Mario Limonciello
a4e764c3e2 Introduce a plugin interaction ABI 2017-08-24 13:41:27 -05: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
7ef96b8a4e trivial: Fix up a few NULL/FALSE mismatches 2017-08-23 18:28:24 +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
9a7db9df7d Show a bouncing progress bar if the percentage remains at zero
Device actions like a Thunderbolt replug can take 25 seconds (!) and so it's a
good idea to show the user that the calling process is still alive.
2017-08-21 15:51:38 +01:00
Richard Hughes
adcc16a53c trivial: Check for zero size firmware image 2017-08-21 12:26:46 +01:00
Richard Hughes
0a8d5df265 trivial: Check the PKCS key purpose before adding to the trust list
According to some best practices this is a good idea, but in this specific case
the certificate will have been installed by the admin or package manager and
so is less important.
2017-08-18 12:19:23 +01:00
Richard Hughes
f03f386c68 trivial: Add a test for firmware signed with a derivative of the LVFS key
This also switches around the test for the self signed key to now fail, as the
generated certificate is no longer loaded into the trust list. This is a more
useful test as it more accurately represents what the fwupd daemon is doing.

As a side-note the detached signature from the derivate cannot be generated
using `--no-p7-include-cert` as only the main LVFS-CA certificate is shipped
with fwupd.
2017-08-18 12:11:59 +01:00
Richard Hughes
14047d7d24 trivial: Split up the keyring setup and public key adding 2017-08-18 11:10:03 +01:00
Richard Hughes
f69a4810fa Return the authority and timestamp as part of the signing validation
This means we return an error when encountering a rollback attack. This can
currently be performed by providing the old metadata and old signature when
calling into UpdateMetadata.
2017-08-17 16:15:47 +01:00
Richard Hughes
556ec355db trivial: Fix getting the keyring for PKCS7-enabled remotes
Found using Coverity, thanks.
2017-08-16 13:42:10 +01:00
Richard Hughes
455fdd3ab6 trivial: Add some debugging into the common helper functionality 2017-08-16 13:42:10 +01:00
Richard Hughes
67cbe64070 trivial: Fix an abort when the pollable input stream couldn't be read 2017-08-16 13:42:10 +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
f0d57235f4 trivial: Fix a few cases of over-keen sed'ing 2017-08-16 13:42:10 +01:00
Richard Hughes
b9ad09ca93 trivial: Correctly search for the .cab detached signature 2017-08-15 15:35:47 +01:00
Richard Hughes
7ee42feb83 trivial: Add common function for making required parent directories 2017-08-15 15:35:36 +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
0724d8bde0 trivial: Bump the appstream-glib requirement to 0.6.13 2017-08-09 17:21:48 +01:00
Richard Hughes
f6f72a439e trivial: Look for bwrap executable in the path 2017-08-09 16:25:25 +01:00
Richard Hughes
443e409377 trivial: Allow non-shell startup scripts for the firmware builder 2017-08-09 16:07:31 +01:00
Richard Hughes
2bd16ac8b3 trivial: Remove unused allocated path 2017-08-09 16:04:08 +01:00
Richard Hughes
049ccc8f6c Add a helper function to spawn a subprocess
This allows us to watch the output of a flashing tool and screen-scrape the
progress completion.
2017-08-09 15:35:58 +01:00
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
954dd9fd88 trivial: Add fu_common_rmtree() for future use 2017-08-09 10:23:23 +01:00
Richard Hughes
94f939aa4d trivial: Move the archive decompression to common code 2017-08-09 10:23:23 +01:00
Richard Hughes
d7704d4cc2 Allow plugins to get DMI data from the hardware in a safe way
The returned strings are converted to ASCII and have leading and trailing
spaces removed.
2017-08-09 10:19:13 +01:00
Richard Hughes
e7472a22cc Use a static library to avoid symlinking files for the tests 2017-08-09 10:19:13 +01:00
Richard Hughes
d0d2ae66e0 trivial: Add fu_common_get_contents_bytes() for future use 2017-08-09 09:37: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
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
Richard Hughes
1ad45caeec Use new GUsb functionality to fix flashing Unifying devices
This avoids open()ing and close()ing multiple times on hotplug -- which in
itself isn't a huge problem as the requests are refcounted in libusb, but it
matters hugely when a plugin accidentally closes a device that was not opened.

As all the devices are going to be opened anyway (to read the vendor strings)
and the cost of keeping the device is open is tiny, just get libgusb to
auto-open *all* devices and keep them open for the duration.

Fixes: https://github.com/hughsie/fwupd/issues/155
2017-07-24 11:08:25 +01:00
Richard Hughes
535664cd1e Run the plugin coldplug methods in a predictable order
When reading with g_dir_read_name() the returned files do not have to be sorted
in any particular order and could even change between invokation. This patch
makes debugging the interactions between plugins much easier.
2017-07-24 10:32:06 +01:00
Richard Hughes
ca52a8541e trivial: Fix self tests after downgrading warnings commit 2017-07-21 15:42:32 +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
5033d9c92e Add capability to enable test suite via /etc/fwupd.conf 2017-07-17 14:45:51 -05:00
Mario Limonciello
c29b398ad0 trivial: fix various spelling errors 2017-07-17 13:07:05 -05:00
Richard Hughes
4851158249 trivial: Fix a -Wsign-compare warning on 32 bit 2017-07-17 16:39:35 +01:00
Richard Hughes
e8b5db66f4 Fix a hang on 32 bit computers
It turns out using a string hash for a pointer object doesn't always work...
2017-07-17 14:18:29 +01:00
Mario Limonciello
5735fd67c1 trivial: set engine back to idle
A regression from 9945edbe74 causes
a missing newline for many actions because it doesn't go back to idle
2017-07-13 16:22:19 -05: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
Richard Hughes
32684f2344 Check all the device GUIDs against the blacklist when added
To the user it's not obvious which is the default GUID.

See https://github.com/hughsie/fwupd/issues/127
2017-07-13 09:32:26 +01: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
ed34991bd8 Do not unlock devices when doing VerifyUpdate
We used to do this dance to avoid reading the Option ROM on hardware by default
(some faulty hardware would crash...) but now we're doing the verify update in
the daemon there's no need to split this into two steps.

Fixes: https://github.com/hughsie/fwupd/issues/149
2017-06-22 10:37:10 +01:00
Richard Hughes
b9bddfd7ac trivial: Ensure the verify component is replaced on veriy-update, not merged 2017-06-22 10:34:18 +01:00
Richard Hughes
08f12de44c trivial: Avoid warning when doing verify-update multiple times
Applications always need a valid source with newer appstream-glib versions;
even in this case where the source is the hardware itself.
2017-06-22 10:33:32 +01:00
Richard Hughes
22c88de8e4 trivial: Increase the warning level when a plugin adds a device twice 2017-06-22 09:36:32 +01:00
Richard Hughes
943d2c9bb5 trivial: Split out some common functionality from fu-engine.c 2017-06-21 09:04:39 +01:00
Mario Limonciello
f3f4390155 Only use the test runner plugin when CI is set in the env (#148)
This prevents an installed system from showing FakeDevices but
still allows exercising every commit with Travis CI
2017-06-20 13:56:13 -05:00
Richard Hughes
a5bb4d8428 trivial: Fix a missing signal causing a warning in the recent refactor 2017-06-19 20:22:25 +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
d60421a5fa trivial: Ensure all source files include config.h 2017-06-19 13:50:42 +01:00
Richard Hughes
9945edbe74 Split up the daemon into the loader and an engine object
The idea here is that we move a lot of the 'meat' out of fu-main into the
engine. This also lets us simplify a lot of things and ensures the user
authentication is simple and easy to audit.
2017-06-19 13:50:38 +01:00
Richard Hughes
5475427ca9 Remove the UpdateMetadata D-Bus method as the fallback is done client-side 2017-06-19 09:58:11 +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
83fb8d95f4 Do not fall back to the default release when verifying
This is never going to be valid. What we want is to try and get a new AsApp and
AsRelease from the system store, not the verification store.
2017-06-16 17:13:05 +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
5935ebda5a Check the remote exists and is enabled when using UpdateMetadataWithId 2017-06-16 15:40:31 +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
980ef147eb Move the config file parsing out to a new object
This will allow us to move the remote parsing here soon.
2017-06-16 12:46:40 +01:00
Richard Hughes
81f96797f6 trivial: Do not remove all apps in the store when loading metadata 2017-06-16 12:40:49 +01:00
Richard Hughes
8a8425f7be Do not store the verify store in the cachedir
The list of verification hashes is certainly not a cache, it's important data
that needs to be kept for a long time somewhere important.

Move it from /var/cache/app-info/xmls to /var/lib/fwupd and delete the old file
as it may have now-incorrect contents.
2017-06-16 12:40:44 +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
ababbb7ae1 trivial: Clear any device checksums before doing device::verify 2017-06-15 20:19:23 +01:00
Richard Hughes
f556d371da trivial: Clear any device checksums after the online update 2017-06-15 20:19:19 +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
ae7e0d21b2 Add an installed test for verification 2017-06-15 16:23:52 +01:00
Richard Hughes
20d2d726e0 Fix the self tests when running on PPC64 big endian 2017-06-15 12:05:11 +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
d424d0d193 Use the correct type signature in the D-Bus introspection file 2017-06-14 13:55:57 +01:00
Richard Hughes
4619f9f5c1 trivial: Use the 'message' level for normal events 2017-06-14 13:55:30 +01:00
Richard Hughes
2899cb28d5 Show progress download when refreshing metadata 2017-06-13 16:31:18 +01:00
Richard Hughes
b38a4fdfd6 Fix a crash when refreshing metadata
When processing the file handles it seems g_variant_get() actually wants to
write the fd integer. This bug does not happen every time, and seems to vanish
every time under valgrind.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1460429
2017-06-13 15:24:06 +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
3d2fc1e353 Ensure that firmware provides are legal GUIDs
If they are raw device strings, e.g. 'USB\VID_046D&PID_AAAC' just fix them
in-place.
2017-06-08 14:26:40 +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
6d7c33c5da trivial: Fix two tiny leaks in the new HWIDs support 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
985ac07ab7 Only decompress the firmware after the signature check
This is moderately more secure, in the event that g_zlib_decompressor_new() has
an exploitable overflow. Spotted by Sebastian Krahmer, many thanks.
2017-06-06 20:02:54 +01:00
Richard Hughes
fe461b618e trivial: Use SHA256 for the store origin
If we're using this for caching it seems a good idea to use a secure cache function.
2017-06-06 14:18:17 +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
6e48871bce trivial: Respect the checksum kind when calling VerifyUpdate 2017-06-05 17:48:13 +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
01c13d1634 trivial: Use a helper to get the sysconfig dir
This makes testing using a prefix much easier.
2017-06-05 09:10:17 +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
f29a6eeb2c trivial: Modernize the daemon private data cleanup 2017-06-02 20:14:14 +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
d4bdfd6883 Do not copy the origin from the new metadata file
If the system has multiple remotes enabled then simply setting the origin to
the 'last-updated' source is confusing.
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
Timo Gurr
555c634a92 Allow to specify bindir 2017-05-29 16:54:30 +01:00
Richard Hughes
f5f400fe52 trivial: Do not fail to startup if an invalid AppStream file is installed 2017-05-15 10:52:49 +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
c7f61b62db trivial: Fall back to the system config file
This makes trying the daemon locally much easier.
2017-04-26 10:18:42 +01:00
Mario Limonciello
66132d6b63 disable allowing the daemon test suite running in parallel to plugin test suites 2017-04-20 14:36:36 -05:00
Mario Limonciello
5c1df14d05 fix test suite localstate directory to be a temporary directory 2017-04-20 13:53:19 -05:00
Mario Limonciello
8e0f242d75 fix libexecdir to respect config option (#109) 2017-04-19 10:21:59 -05:00
Richard Hughes
a9a99bdb48 Actually use /usr/libexec/fwupd/fwupd
It appears the enormity of replacing a directory with a file is just too much
for package managers in 2017.

I guess we might ship other things in /usr/libexec/fwupd/ in the future.
2017-04-19 08:50:52 +01:00
Richard Hughes
05ede65e24 Add a config option to allow runtime disabling plugins by name
See https://github.com/hughsie/fwupd/issues/110
2017-04-16 09:11:39 +01:00
Richard Hughes
fc921ae0ce trivial: Fix underlinking in the daemon self tests 2017-04-16 09:10:45 +01:00
Richard Hughes
d1ced695ca Set the source origin when saving metadata
If this is not done the origin from the last file that was read (which might be
from Fedora, for instance) will be used. This isn't hugely important but can
give misleading and confusing unique-id's in gnome-software.
2017-04-15 12:27:26 +01:00
Mario Limonciello
acd288c322 correct test suite compliation failure 2017-04-14 15:04:32 -05: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
1fdb335025 Remove the automake build system 2017-04-13 18:42:08 +01:00
Richard Hughes
9f0c47b36a Fix the raspberrypi self test code under meson
Also, refactor the common test code to a new source file.
2017-04-13 10:09:33 +01:00
Richard Hughes
87e82a716d trivial: Add the optional valgrind functionality back 2017-04-12 18:21:08 +01:00
Richard Hughes
c388002b72 trivial: Fix under-dep issue with 'ninja test' 2017-04-12 18:08:49 +01:00
Richard Hughes
57746cb839 Add the Meson build system as an alternate to autotools
Automake and autoconf are impossible to fully understand and Meson now provides
everything we need for a much smaller, faster, and more understandable build.

See http://mesonbuild.com/ for more information.
2017-04-12 16:35:18 +01:00
Richard Hughes
24a580f622 trivial: Allow TESTDATADIR to be multiple locations
We need this when srcdir != destdir.
2017-04-12 16:34:17 +01:00
Richard Hughes
d6db6b4d8a trivial: Change the name of a generated file
The meson build system does not let you choose the output name of the resource.
2017-04-12 15:03:11 +01:00
Richard Hughes
d3f4b5a428 trivial: Define the build dir outside the source file 2017-04-12 14:26:14 +01:00
Richard Hughes
4af05398af trivial: Define the plugindir in one central place 2017-04-12 14:18:15 +01:00
Richard Hughes
e643fb283f Create directories in /var/cache as required
These can be nuked at any time by users, so don't rely on the package manager
or installer to create these for us.
2017-04-12 14:09:06 +01:00
Mario Limonciello
6d0aa3dcf7 trivial: make valgrind an optional build dependency
Packagers should still enable it so that tracking lost memory
in plugins is possible, but on some distros some archs don't
have valgrind available which would otherwise prevent fwupd
from running.

This is as problem currently for Debian unstable where some
archs valgrind fails to compile.
2017-02-28 08:22:27 -06:00
Shea Levy
345a7b7f3d Only try to mkdir the localstatedir if we have the right permissions (#96) 2017-02-27 20:41:58 -06:00
Richard Hughes
8738a9f8e4 trivial: Do not use deprecated appstream-glib API 2017-02-27 10:11:29 +00:00
Richard Hughes
576c012d20 Do not dlclose modules when running under valgrind
Without this patch, unloading the module means we can't resolve the symbols
where the memory was leaked.
2017-02-24 09:47:00 +00:00
Richard Hughes
afe00a91e7 trivial: Prevent a critical warning when using --timed-exit 2017-02-21 09:36:49 +00:00
Richard Hughes
6ad951d27c trivial: Do not allow plugins to call _device_add_delay() with the same device
Also, add some unit tests for this codepath.
2017-02-03 10:12:14 +00:00
Richard Hughes
f0a799eabf Only register the D-Bus service when all devices have been added
Poll each plugin, and only register the service when all the delayed coldplug
devices have been added to the device list. This prevents returning an error
when calling "fwupdmgr get-devices" for the very first time.

Resolves: https://github.com/hughsie/fwupd/issues/82
2017-01-18 08:10:32 +00:00
Richard Hughes
ccd78a9703 trivial: Add some sanity guards in plugin-calling functions 2017-01-11 16:57:41 +00:00
Richard Hughes
fcca6f67b2 Include all debug messages when run with --verbose 2017-01-11 16:50:17 +00:00
Richard Hughes
44dee88ad6 trivial: Protect against multiple uses of fu_plugin_alloc_data() in a plugin 2017-01-11 08:31:10 +00:00
Richard Hughes
b21e324c23 trivial: Always call update_cleanup() even when the update action fails
In this case we can't return any failure to cleanup and just log the warning
on the console.
2017-01-11 08:29:17 +00:00
Richard Hughes
57d18229a1 trivial: Add some more documentation for functions used by plugins 2017-01-10 16:09:32 +00:00
Richard Hughes
4190178f94 trivial: Remove the unused fu_plugin_set_name() 2017-01-10 16:09:32 +00:00
Richard Hughes
b082903c5f Add fu_plugin_set_coldplug_delay() to allow hardware to initialize if required 2017-01-10 09:27:08 +00:00
Richard Hughes
f360583f3c trivial: Reschedule a recoldplug after a small delay
This also ensures that we only re-coldplug once if multiple plugins request
the action in the same 1500ms window.
2017-01-08 10:51:57 +00:00
Richard Hughes
f028ba25ac trivial: Do not allow recoldplugging whilst in coldplug itself 2017-01-08 10:45:12 +00:00
Richard Hughes
362d6d7d7d Allow plugins to request that all plugins re-coldplug
This allows a plugin to signal the daemon that something has happened and that
all plugins should wake up connected devices, re-add them all and then put the
devices back to powersave mode. Any duplicate devices will be ignored.
2017-01-07 21:42:17 +00:00
Richard Hughes
46487c944a Add the ability to run a prepare->exec->cleanup on coldplug
The idea here is that plugins can 'wake up' hardware in prepare, and put it
back into powersaving mode when doing cleanup.
2017-01-07 21:26:36 +00:00
Richard Hughes
4852ff8521 Fix the appstream-glib version guards
Resolves: https://github.com/hughsie/fwupd/issues/78
2017-01-04 20:38:29 +00:00
Richard Hughes
7ceb318a27 Add fwupd_result_get_device_version_bootloader()
This functionality is required so that AppStream metadata can check the fwupd
version, the firmware version, bootloader version or a combination of all three.
2016-12-23 11:21:22 +00:00
Richard Hughes
404cc51be3 Allow the metadata to match a version of fwupd and the existing fw version
This allows us to have new markup specified in the MetaInfo or AppStream XML:

  <requires>
    <id compare="ge" version="0.8.1">org.freedesktop.fwupd</id>
    <firmware compare="ge" version="0.1.2"/>
  </requires>

This means that only updates that match these versions will be shown.
2016-12-21 16:16:18 +00:00
Richard Hughes
d4184cf2c6 trivial: Fix a crash when a Unifying USB device is quickly replugged
We need to remove the device from the delayed hash table to ensure we don't
accidently free the helper when it removed a *second* time.
2016-12-21 16:05:19 +00:00
Richard Hughes
2d744f5571 trivial: Fix critical warning when policykit rules are not installed 2016-12-20 09:07:37 +00:00
Richard Hughes
ae3d65f60b Move the device add delay to shared code
This allows us to reuse the logic in other plugins.
2016-12-16 12:41:57 +00: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
Richard Hughes
74d95ab988 trivial: Find the release when verifying and there is no version 2016-12-15 12:55:21 +00:00
Richard Hughes
df3aa3bdc9 trivial: Fix a warning when compiling the ROM fuzzer 2016-12-14 10:52:58 +00:00
Mario Limonciello
02ccecb2be fix dfu plugin loading
failed to open plugin
/usr/lib/x86_64-linux-gnu/fwupd-plugins-2/libfu_plugin_dfu.so:
failed to open plugin:
/usr/lib/x86_64-linux-gnu/fwupd-plugins-2/libfu_plugin_dfu.so:
undefined symbol: dfu_device_upload
2016-12-13 13:19:55 -06: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
4232185bec trivial: Remove some false-positive messages when using clang 2016-12-13 16:01:52 +00:00
Richard Hughes
59a9344c1e Move the UPower functionality to a plugin 2016-12-12 16:28:16 +00:00
Richard Hughes
e8fb74a341 Return the pending UEFI update when not on AC power
The user will not be notified about firmware security updates all the time they
are on battery power. It's better to handle this in the client prompting the
user to connect the AC power source.
2016-12-12 16:17:38 +00:00
Richard Hughes
7b8b202786 Add a set of vfuncs that are run before and after a device update 2016-12-12 16:15:03 +00:00
Richard Hughes
31bfba3d1b trivial: Fix an error path when getting firmware results 2016-12-12 15:14:12 +00: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
Richard Hughes
319a6bab12 Move the plugins into plugin-specific directories
This will allow us to add further documentation here in the future.
2016-12-12 11:52:03 +00:00
Richard Hughes
28bbab532a Unexport libebitdo
Nothing is ever going to use this except fwupd, so it makes no sense adding the
extra overhead.
2016-12-09 09:56:31 +00:00
Richard Hughes
bc93e4ab6e Make all providers and plugins share a GUsbContext
This means we don't have more that one thread just watching for the USB
hotplug events. To achieve this split up the coldplug into setup and coldplug
phases and run the enumerate just once in the daemon.
2016-12-08 19:51:55 +00:00
Richard Hughes
7419e9624a trivial: Use the correct index value when getting the local file descriptor
I assume GLib in F25 is more strict about invalid values.
2016-11-22 19:48:06 +00:00
Philip Withnall
bc339aa657 Fix redeclaration of polkit autocleanup functions
ifdef cannot be used to determine if a C symbol is defined, as it’s
evaluated by the preprocessor, before symbols are parsed. Instead, try
to detect whether polkit.h is suitably recent enough to define its own
auto-cleanup functions.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2016-11-22 16:13:33 +00:00
Richard Hughes
39148003a7 trivial: Add a Option ROM fuzzer to use with afl 2016-11-22 14:46:57 +00:00
Richard Hughes
467fdba7ce trivial: Never dump past the ROM size for corrupt option ROMs 2016-11-22 14:36:12 +00:00
Richard Hughes
f33d2c0d64 trivial: Use the entry point to detect NVIDIA ROMs 2016-11-22 14:36:12 +00:00
Richard Hughes
0023912e1c trivial: Be more helpful when failing to detect the firmware kind 2016-11-22 14:36:12 +00:00
Richard Hughes
fb049f75b7 trivial: Make the NULL padding detection safer 2016-11-22 14:36:12 +00:00
Richard Hughes
87764f0cc1 trivial: Refactor to create fu_rom_load_data() 2016-11-22 13:41:16 +00:00
Tsunghan Liu (Robert Liu)
a02bbb1c4e * close USB devices before error returns (#73) 2016-11-21 09:12:28 -06:00
Richard Hughes
f3b1bc6c0c trivial: Check the return code when using g_file_get_contents()
Not actually a bug, but pointed out by Coverity.
2016-11-09 20:14:15 +00:00
Richard Hughes
8072bb6fb7 trivial: Fix pointless header check
It can never be NULL. Found using Coverity.
2016-11-09 19:33:47 +00:00
Richard Hughes
710bf295b2 trivial: Fix two missing break statements
Found using Coverity.
2016-11-09 19:32:26 +00:00
Richard Hughes
e686719e38 dell: Fix a possibly-impossible-to-hit buffer overrun
Found using Coverity.
2016-11-09 19:30:37 +00:00
Richard Hughes
4417c062fe dell: Don't return the address of a stack variable
Found using Coverity.
2016-11-09 19:27:08 +00:00
Richard Hughes
fec2480330 trivial: Fix a critical warning on shutdown 2016-11-04 09:30:14 +00:00
Mario Limonciello
155f054dff trivial: re-enable dell tpm mode switching for system ID 07a4 2016-10-27 13:09:46 -05:00
Mario Limonciello
11dee100af Clarify the test in --help and man page related to offline (#69) 2016-10-19 15:56:48 -05:00
Mario Limonciello
54a5a21757 Show a different error when checking for updates while on battery power (#68) 2016-10-19 14:29:53 -05:00
Mario Limonciello
a91214f545 Enable hardening flags on more binaries 2016-10-14 12:43:02 -05:00
Richard Hughes
73b3bc59ac trivial: fake DFU runtime devices need a manual step 2016-10-14 18:07:34 +01:00
Mario Limonciello
cdf5b86e04 dell: If running in test suite, don't try to get product ID from sysfs
It's possible that the test suite was running in an environment without
bind mounted sysfs.
2016-10-03 14:32:47 -05:00
Mario Limonciello
cd272ac1cf dell: Match on TB16 as well 2016-09-28 15:58:47 -05:00
Richard Hughes
f401775c8a Don't create the UEFI dummy device if the unlock will happen on next boot 2016-09-27 15:35:01 +01:00
Richard Hughes
b0af181b01 Fix an assert when unlocking the dummy ESRT device 2016-09-27 15:27:23 +01:00
Mario Limonciello
3ef952fcea Verify devices support updating in mode they are called.
Providers that have both online and offline update methods don't
do verification that the device actually supports that mode.

This caused problems for Dell TPM devices where if you called
$ fwupdmgr install tpm.cab

It would attempt to use the online stub added in 1d97c8b5.
This would of course fall over requiring you to call with
$ fwupdmgr install tpm.cab --allow-offline

This fix will guarantee that the current install fallback
logic takes into account both device and provider support
for online/offline.
2016-09-20 12:34:42 -05:00
Mario Limonciello
7b2ea4de23 trivial: dell provider: allocate memory for online update SMI call 2016-09-02 14:41:48 -05:00
Richard Hughes
27aad5ac1f Add a fallback for older appstream-glib releases
Fixes: https://github.com/hughsie/fwupd/issues/62
2016-08-29 16:12:26 +01:00
Richard Hughes
4ced466f95 trivial: Fix two more compile warnings 2016-08-26 17:33:10 +01:00
Richard Hughes
2db526d178 Save the unique ID in the pending database
Also, generate something sensible if we're reading the status of an old task.
2016-08-25 15:07:25 +01:00
Richard Hughes
111be7431f trivial: Fix upgrading from an old version of fwupd 2016-08-25 14:40:35 +01:00
Richard Hughes
cec5c1dd88 Do not attempt to add DFU devices not in runtime mode 2016-08-25 13:05:42 +01:00
Richard Hughes
fdf46169f3 Ignore devices that do not add at least one GUID 2016-08-25 13:05:18 +01:00
Richard Hughes
644562e291 Use the correct define prefix for FwupdDeviceFlags
Also, add the compat flags so we don't break API.
2016-08-22 10:30:24 +01:00
Richard Hughes
5c066adf29 Use the SHA1 hash of the local file data as the component origin
This means we have a different cache-id for locally modified .cab files.
This allows us to update the text in the metadata without reloading the client.
2016-08-18 18:38:33 +01:00
Richard Hughes
fa782a3915 Add fwupd_result_get_unique_id()
This allows us to have a unique string that identifies the component and can be
used as a cache key.
2016-08-18 18:36:11 +01:00
Richard Hughes
ee3352ec02 trivial: Remove some dead code
If we do this for SteelSeries devices, we'll need a proper provider.
2016-08-17 17:46:15 +01:00
Richard Hughes
da004cf318 Show a progress notification when installing firmware 2016-08-17 17:46:15 +01:00
Richard Hughes
060af614a5 trivial: Ensure the daemon always returns to IDLE 2016-08-17 17:46:15 +01:00
Richard Hughes
14d176499d Handle the 8Bitdo bootloader in a better way 2016-08-17 17:46:15 +01:00
Richard Hughes
876c007b1a Allow providers to export percentage completion 2016-08-17 17:46:15 +01:00
Richard Hughes
ae87438781 trivial: Don't show the current release in the fwupdmgr get-updates output 2016-08-17 17:46:15 +01:00
Richard Hughes
20003d1c88 Add fwupd_result_remove_device_flag() 2016-08-17 17:46:15 +01:00
William Hua
12082bb863 trivial: link against fwup
If UEFI is disabled, but Dell non-ESRT capsule support enabled, fwupd fails to
link against libfwup as needed.
2016-08-17 09:30:13 -04:00
Richard Hughes
01b9a838b4 Show the vendor flashing instructions when installing 2016-08-16 17:59:32 +01:00
Richard Hughes
4fd38c8f1b trivial: Only show the device error when no devices are due to be updated
Showing a 'no attached hardware matched' then a large list of GUIDs isn't
super helpful.
2016-08-16 17:57:49 +01:00
Richard Hughes
0abde9c39a Fix writing 8Bitdo device firmware 2016-08-16 16:40:58 +01:00
Richard Hughes
535a5b9746 Get the firmware version correctly from 0Bitdo gamepads 2016-08-11 15:36:44 +01:00
Richard Hughes
0bda054f63 trivial: Show a warning when a requested plugin is not loaded 2016-08-11 15:35:30 +01:00
Mario Limonciello
49f789e10f trivial: Dell: for MST and NVM, if a version is set update online not offline 2016-08-01 10:56:35 -05:00
Mario Limonciello
1d97c8b563 trivial: split out dell updates to offline and online
(online still are missing lots of code to be fully functional obviously)
2016-08-01 10:42:40 -05:00
Richard Hughes
33a518a615 Add another compile warning and fix up any build failures 2016-07-27 16:57:36 +01:00
Mario Limonciello
2bb4f005d6 trivial: Remove an extra guint i missed from f192bf0 2016-07-27 10:21:05 -05:00
Richard Hughes
f192bf025a trivial: Switch to compiling with C99 by default
We're already using non-MSVC features like g_autoptr().
2016-07-22 08:41:59 +01:00
Mario Limonciello
94cdd0af27 Add XPS 9250 to Dell TPM modeswitch blacklist 2016-07-20 16:46:22 -05:00
Mario Limonciello
09e2630a59 trivial: re-enable Dell self tests 2016-07-18 09:32:24 -05:00
Mario Limonciello
f93dc38410 trivial: move structs and defines necessary for test suite into header file 2016-07-18 09:31:53 -05:00
Richard Hughes
3ddb6d90b6 trivial: Disable the Dell self tests until they compile 2016-07-18 09:24:14 +01:00
Richard Hughes
0d28b30104 trivial: Fix a couple of compiler warnings 2016-07-18 09:24:03 +01:00
Richard Hughes
9a52c5ed2c Allow blacklisting devices by their GUID
Fixes: https://github.com/hughsie/fwupd/issues/10#issuecomment-233207616
2016-07-18 09:17:02 +01:00
Mario Limonciello
958ead697b Add Dell TPM and TB15/WD15 support via new Dell provider.
This provider will provide support for items that can be flashed
as capsules but aren't present in the ESRT table.

The MST hub and TBT NVM are not yet updatable, but GUIDs are
created to represent them when they are.
2016-07-13 12:30:25 -05:00
Richard Hughes
c8646aff32 Show a more detailed error when installing firmware on the wildcard
Based on a patch by Mario Limonciello, many thanks.
2016-07-04 13:06:17 +01:00
Richard Hughes
bd40528575 Don't make failures critical while checking versions or locked state
Based on a patch by Mario Limonciello, many thanks.
2016-07-04 13:00:54 +01:00
Richard Hughes
3ab17e63dd trivial: Refactor the update helper
No logic changes.
2016-07-04 12:37:22 +01:00
Richard Hughes
346ea88135 trivial: Move a conditional out of the way 2016-07-04 12:31:06 +01:00
Richard Hughes
ce38d94d5e trivial: Get rid of useless internal-only gtk-doc markup 2016-06-29 11:25:25 +01:00
Richard Hughes
a4a2c18ac8 Use the correct firmware blob when installing a composite device update 2016-06-29 11:08:29 +01:00
Richard Hughes
fe5cc9021c Add support for installing against multiple devices from a CAB file
Based on a set of patches from Mario Limonciello <mario_limonciello@dell.com>,
many thanks.
2016-06-29 11:08:29 +01:00
Richard Hughes
db468eef67 trivial: Explicitly tag downgrades in the helper 2016-06-29 10:11:53 +01:00
Richard Hughes
4eb527f873 Use a private gnupg key store
Although it's convenient that you can just log in as root and add another
trusted key, it makes the selinux developers unhappy. Use a private keystore
in /var/lib/fwupd/gnupg to avoid the possibility of a somehow hacked fwupd
being able to export the root gpg secrets if any happened to exist.

If you've trusted keys other than the LVFS for metadata or firmware you'll need
to re-import them into this new location.

See b7f12bd377

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1303531
2016-06-28 09:18:45 +01:00
Richard Hughes
4921bd9770 Ensure the update ID is set when getting local firmware details 2016-06-27 11:17:43 +01:00
Mario Limonciello
8eaadd09d8 In get-details output, display the blob filename
This makes it easier to debug issues with CAB files with multiple
payloads
2016-06-22 15:01:09 -05:00
Mario Limonciello
c2cbd1ab6f trivial: s,cd_,fu_, in a few places in fu-main 2016-06-22 14:59:42 -05:00
Mario Limonciello
2c5ff43556 trivial: correct fu-debug.h definitions 2016-06-22 14:57:43 -05:00
Richard Hughes
d0583ae340 Only claim the DFU interface when required
It appears that some expensive USB sound cards do not like the DFU interface
being claimed at the same time the kernel starts using a different endpoint.

I suspect this is a device bug or limitation in some reference implementation
somewhere, but seeing as we only need the interface when verifying or writing
new firmware the sensible thing to do is not claim it until required.

Fixes: https://github.com/hughsie/fwupd/issues/50
2016-06-08 16:42:49 +01:00
Richard Hughes
11dc9ace51 trivial: Fix up some warnings spotted by new GCC 2016-06-07 10:11:00 +01:00
Richard Hughes
4580ed128b trivial: Prevent critical warning when verifying 2016-06-02 08:50:59 +01:00
Richard Hughes
7289a6b5f0 Add a GetDetailsLocal() method to eventually replace GetDetails()
This allows us to return multiple results from one file, for instance where the
firmware.cab file contains multiple metainfo.xml files.

This allows us to show all the entries in the firmware file, rather than
searching for the installed device that matches and falling back to just the
first listed item.
2016-05-29 09:57:24 +01:00
Richard Hughes
8ac07dcd1c trivial: Modularize the GetDetails call 2016-05-29 09:27:56 +01:00
Richard Hughes
c1a08c75d8 Support returning multiple GUIDs from GetDetails 2016-05-25 09:47:40 +01:00
Mario Limonciello
ff94ccde59 Enforce allowing providers to take away flash abilities
The flags for ALLOW_OFFLINE and ALLOW_ONLINE aren't currently used to
block a provider from flashing a file by hand.
2016-05-18 00:38:08 -05:00
Mario Limonciello
3321d7ea09 Test for a locked device when trying to install firmware update
Although other checks may also fail, the error shown when trying
to install a CAB that matches a GUID on the system that is locked
should be a message to unlock the device.
2016-05-18 00:37:59 -05:00
Mario Limonciello
f93c00dcf4 Re-read flags for a device after a provider's unlock routine is done
It's possible that the flags may have been altered in the provider
unlock routine.  These changes get discarded if not re-read.
2016-05-18 00:37:51 -05:00
Richard Hughes
043bc15f6d Allow metainfo files to match only specific revisions of devices
For example, matching on the 'USB\VID_0000&PID_0000&REV_0000' GUID rather than
the 'USB\VID_0000&PID_0000' GUID.

This is now possible as we can specify multiple GUIDs for a device.
2016-05-17 18:46:25 +01:00
Richard Hughes
feb8965d2e Add fu_device_get_alternate()
This daemon-only method allows a provider to associate one device with another.

Inspired by a patch by Mario Limonciello <mario_limonciello@dell.com>.
2016-05-17 16:27:59 +01:00
Richard Hughes
6561c8daf7 Only return updatable devices from GetDevices()
Fixes some of https://github.com/hughsie/fwupd/pull/47
2016-05-17 16:24:09 +01:00
Richard Hughes
99147f180b Allow devices to have multiple assigned GUIDs 2016-05-17 09:35:04 +01:00
Mario Limonciello
71a5b98d30 Add support for a --force flag to override provider warnings
Under some circumstances a provider may want to prevent a user from
performing a flash without additional user interaction.

Providers can opt into this behavior by checking for
FWUPD_INSTALL_FLAG_FORCE in the update routine.
2016-05-10 15:41:16 -05:00
Mario Limonciello
74037577f8 src/Makefile.am: reshuffle so enableable bits are only referenced when on 2016-05-10 12:57:45 -05:00
Mario Limonciello
f81f42a84c Add support for a new device field "Flashes Left".
For devices that can report the number of flash cycles supported this field can
be used to prevent allowing the device to be flashed again.
2016-05-10 12:21:09 -05:00
Richard Hughes
21542abb0a Set the device description when parsing local firmware files
We were overwriting the update description, so we never noticed before.
2016-04-29 10:55:16 +01:00
Richard Hughes
dde7a2f6e6 Re-match devices when the AppStream metadata is updated
This allows us to notify clients watching for the 'supported' property for
new devices added to the LVFS.
2016-04-28 16:56:23 +01:00
Richard Hughes
422e866bc8 Match the AppStream metadata after a device has been adedd
This allows us to match specific properties by watching the ::DeviceChanged()
signal.
2016-04-28 16:56:23 +01:00
Richard Hughes
8ca33784ec Add device-added, device-removed and device-changed signals
This allows us to watch a specific device from client code without
re-requesting the device list on every Changed() signal.
2016-04-28 16:56:23 +01:00
Richard Hughes
cfc44fa0ae Add a 'monitor' debugging command for fwupdmgr
This allows us to watch for signals from the daemon.
2016-04-28 16:56:23 +01:00
Richard Hughes
4f4e1f3478 Add a 'supported' flag to the FuDevice
This is TRUE when the device has been found in the LVFS metadata.
2016-04-28 16:56:23 +01:00
Richard Hughes
37e9d777e5 Fix a critical warning when restarting the daemon
Emit the Status property with the correct type
2016-04-28 16:56:23 +01:00
Richard Hughes
654f6b82f3 Return all update descriptions newer than the installed version
Fixes: https://github.com/hughsie/fwupd/issues/45
2016-04-25 12:30:49 +01:00
Richard Hughes
3c694baf2d trivial: Make it clear the version from get-updates is an update version 2016-04-25 12:28:08 +01:00
Richard Hughes
1d3567056c trivial: Fix alignment of multi-line update descriptions 2016-04-25 12:17:42 +01:00
Richard Hughes
f76956be6f Make the device display name nicer 2016-04-15 09:02:28 +01:00
Mario Limonciello
d9c234aeb3 trivial: update get-results error to be clearer 2016-04-14 13:44:01 -05:00
Mario Limonciello
68a462c9b6 Set the system's DMI product name as the DisplayName for UEFI
It might not be technically correct if multiple ESRT entries
are supported on the system, but these don't currently exist
and this is an improvement over it being set to null and
showing messages like:
"(null) has firmware updates"
2016-04-14 12:02:31 -05:00
Mario Limonciello
bfedfea62e Remove non-interactive pinentry setting from fu-keyring
691e02d652 [fu_keyring_setup] added a signing
server and configured to not have interactive pin entry
[gpgme_set_pinentry_mode]

This signing server was reverted in 5c35abb1a5
but the non-interactive pin entry setting for gpgme remained.

This functionality was only added in gnupg 2.1. If not running on gnupg 2.1
gpgme will give silent errors when importing keys.  The silent errors were
fixed in 0.7.0 in c5e8921dfd.  Unfortunately
that makes an implicit dependency on gnupg 2.1 to use fwupd.

This commit will allow older gnupg versions (< 2.1) to continue to work without
negative implications for fwupd.
2016-04-05 08:53:01 -05:00
Richard Hughes
f7c81e312a Allow the test suite to run in %check 2016-04-01 10:25:05 +01:00
Richard Hughes
f3f4e8dae5 Revert "Allow overriding the location of the provider offline files for test suite"
This reverts commit 661cd75b41.
2016-04-01 10:25:05 +01:00
Richard Hughes
06c804890a Revert "Allow overridding the location of the pending database for test suite"
This reverts commit 5c1999b4ec.
2016-04-01 10:25:05 +01:00
Richard Hughes
a9de272370 trivial: Fix build warning when compiling 'make check' 2016-04-01 10:25:05 +01:00
Mario Limonciello
661cd75b41 Allow overriding the location of the provider offline files for test suite 2016-03-31 13:41:14 -05:00
Mario Limonciello
5c1999b4ec Allow overridding the location of the pending database for test suite 2016-03-31 13:37:33 -05:00
Richard Hughes
2a1a9b61cc trivial: Use g_autoptr() in FuProviderUefi 2016-03-31 11:35:05 +01:00
Richard Hughes
7105e42af8 trivial: Do not show the argument list for an internal error 2016-03-31 11:23:04 +01:00
Richard Hughes
77df553db7 trivial: Be more explicit about testing for import success 2016-03-31 09:08:28 +01:00
Richard Hughes
fe490ebb80 Use g_auto() in FuKeyring
This simplifies function cleanup.
2016-03-31 09:00:16 +01:00
Mario Limonciello
c5e8921dfd Test that GPG key import actually was successful (or didn't change a key already in the keyring) 2016-03-30 23:59:48 -05:00
Richard Hughes
9559bbe42d Connect to UPower at startup 2016-03-29 19:18:52 +01:00
Richard Hughes
53ec7ea39e Do not return updates that require AC when on battery
This prevents us showing updates in GNOME Software that can't actually be
installed without an error.
2016-03-29 19:18:52 +01:00
Richard Hughes
5bf2837485 Add fwupd_result_has_device_flag() 2016-03-29 19:18:52 +01:00
Richard Hughes
b8956d41ee Do not use /tmp for downloaded files
The files are signed but downloading into user-cachedir is probably safer.
2016-03-29 19:18:18 +01:00
Richard Hughes
e4141f4f23 trivial: Print the fingerprint of the sig used for verification 2016-03-29 11:26:51 +01:00
Mario Limonciello
bb49bd52b9 Add Alienware to the version quirk table 2016-03-21 08:56:52 -05:00
Richard Hughes
b8f6b737e6 Show the checksum kind in the fwupdmgr output 2016-03-18 12:33:47 +00:00
Richard Hughes
af2f3f9288 Allow SHA-256 hashes when verifying
Although, stick to the old default of SHA-1 for now.
2016-03-18 12:33:47 +00:00
Richard Hughes
48a5117fde trivial: Allow different checksum types in FuRom 2016-03-18 12:33:47 +00:00
Richard Hughes
2d6e186800 Rename some of the new libfwupd API to align with the D-Bus names 2016-03-18 09:20:40 +00:00
Richard Hughes
c8a60c9073 trivial: Squash a warning when compiling the self tests 2016-03-17 13:09:51 +00:00
Richard Hughes
8e9762d174 Use libfwupd inside the daemon
This also entailed writing some compat defines to work on FuDevices without
casting each one to a FwupdResult.
2016-03-17 10:14:17 +00:00
Richard Hughes
cb07a3eb3f Use FwupdClient from libfwupd in fwupdmgr 2016-03-17 10:09:03 +00:00
Richard Hughes
b94f2f0488 Export FwupdUpdateFlags in libfwupd 2016-03-17 09:52:00 +00:00
Richard Hughes
a475eecda2 Export FwupdUpdateState in libfwupd 2016-03-17 09:48:34 +00:00
Richard Hughes
6d39d37039 Show device flags in 'fwupdmgr get-devices' 2016-03-15 21:40:36 +00:00
Richard Hughes
16d8f6212d Return the device flags when getting firmware details
This allows us to see if a local firmware file can be installed on the local
machine, and crucially, whether it has to be installed on or off-line.
2016-03-15 21:40:36 +00:00
Richard Hughes
5883ccae57 Add a plugin for SteelSeries hardware 2016-03-14 14:56:11 +00:00
Richard Hughes
dad1e193cd Run vendor plugins as required
This allows us to run plugins from AppStream metadata values.
2016-03-14 14:54:21 +00:00
Richard Hughes
80a77bcfd8 Use g_usb_context_wait_for_replug() 2016-03-14 14:47:44 +00:00
Richard Hughes
d090514f15 Add a simple plugin infrastructure
This allows vendors to write small self-contained modules that can be used to
override the default behaviour in the various providers.
2016-03-13 09:52:55 +00:00
Richard Hughes
ffa323b231 Revert "Allow defining update vfuncs with no runtime support"
This reverts commit 780a3e59ff.
2016-03-11 08:48:58 +00:00
Richard Hughes
780a3e59ff Allow defining update vfuncs with no runtime support
This allows providers to decide at runtime if a device can be updated online.
2016-03-11 08:21:22 +00:00
Richard Hughes
935769bf4d trivial: Fix comment header 2016-03-11 08:21:10 +00:00
Richard Hughes
da9804d8be Show ignored DFU devices in dfu-util, but not in fwupd
This allows desktop software to ignore the device, but leaves the device
controllable by the dfu-tool command line client.
2016-03-07 08:47:11 +00:00
Mario Limonciello
7ebdc1b148 trivial: Adjust ESRT enable function to match fwupdate change.
This was changed to have a fwup_ prefix and be clearer:
b817715900
2016-03-02 10:23:34 -06:00
Richard Hughes
65dfbfe54f Do not use deprecated API from libappstream-glib 2016-03-02 13:43:21 +00:00
Richard Hughes
aaa0772618 Only read PCI OptionROM firmware when devices are manually unlocked
This allows us to do two things:

 * Start up much faster, now typically under 150ms on fast machines
 * Stop hard-locking machines with dodgy hardware or non-free kernel drivers

The last point in particular was causing gnome-software a bad reputation, as
fwupd was only auto-started the when gnome-software was launched, which read
the Option ROM which then hardlocked some machines.

Note: We still unconditionally read the Option ROM when verifying, although
this is a seldom used feature, and easier to correlate with hard lockups on
faulty hardware.
2016-03-02 10:17:02 +00:00
Mario Limonciello
29a7f95beb Add ESRT enable method into UEFI provider. 2016-03-02 10:17:02 +00:00
Richard Hughes
9a410ce459 Add an unlock method for devices
This is based on an idea from Mario Limonciello which can be used to enable a
PCI OptionROM read, or possibly enable ESRT functionality.
2016-03-02 10:17:02 +00:00
Richard Hughes
b75c92db47 Require AC power before scheduling some types of firmware update
Fixes half of https://github.com/hughsie/fwupd/issues/42
2016-02-20 20:25:56 +00:00
Richard Hughes
750ef0f2f4 trivial: Fix 'make distcheck' 2016-02-03 20:14:55 +00:00
Mario Limonciello
918f3939a4 Move quirks directly into a single table and file.
This will make it easier for other quirks to be added later without
needing to remember to poke through all the code to find everywhere
they were mentioned.
2016-02-03 12:47:23 -06:00
Richard Hughes
df7950b8f3 Support vendor-specific UEFI version encodings
This allows vendors such as Dell to use encodings such as AA.BB.CC.DD rather
than the default of AA.BB.CCDD which is used by Intel and Microsoft.

Existing metainfo.xml files with version numbers prefixed with '0x' are
automatically converted to the new scheme.

Based on a patch Mario Limonciello, many thanks.
2016-02-03 08:52:34 +00:00
Mario Limonciello
92f903823d Fix get-results for UEFI provider.
Even though fwupd doesn't display any information about when,
libfwup will fail to return data unless it gets a pointer.
2016-02-02 09:08:15 -06:00
Richard Hughes
1d96633198 Add 'Created' and 'Modified' properties on managed devices
This allows us to show suitable UI in GNOME Software when reporting historical
firmware updates.
2016-01-27 13:25:45 +00:00
Richard Hughes
0a36f44bc7 trivial: Fix a debug statement when no devices are detected 2016-01-06 14:57:20 +00:00
Richard Hughes
b1b59d83cb Do not misdetect different ColorHug devices
Allow devices to have a specific device ID, which also matches other equivalent
IDs from other providers

This allows the user to plug in one type of device, and not match a different
cached device that also matches the same provider.
2016-01-06 13:20:58 +00:00
Richard Hughes
9a6a9c8b20 Always persist ColorHug devices after replug
We need this to happen no matter the method of getting the version number else
the reconnection idle loops do not work correctly.
2016-01-06 13:12:56 +00:00
Richard Hughes
2a1e75da72 Only dump the profiling data when run with --verbose
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1292059
2015-12-18 17:42:53 +00:00
Mario Limonciello
7df2c4c2e9 trivial: fu-provider-udev: Remove dead debug code 2015-12-08 13:39:54 -06:00
Richard Hughes
f4e8fe0763 trivial: Fix several trivial warnings on ARM 2015-12-06 17:51:10 +00:00
Richard Hughes
832c334548 Fix compile with --disable-shared 2015-12-01 11:41:16 +00:00
Richard Hughes
9b1349b885 libdfu: Add an explicit 'attach' method
This can also deal with the m-stack quirk in a central place.
2015-11-27 10:54:26 +00:00
Richard Hughes
922dbc721a Rescan the DFU device after firmware has been updated 2015-11-25 15:01:18 +00:00
Richard Hughes
a2b2b1cc68 Export the AppStream ID when returning device results
This allows us to match up the AppStream data we've parsed in gnome-software and the firmware update we've got from fwupd. This means we can get access to some of the data that fwupd doesn't care about, for instance the how-to-upgrade screenshots.
2015-11-25 15:00:51 +00:00
Richard Hughes
6511f5011f f 5d057a8fce 2015-11-25 13:53:10 +00:00
Richard Hughes
a6778df664 f 5d057a8fce 2015-11-25 13:39:54 +00:00
Richard Hughes
291e9a6b19 trivial: Remove some dead code 2015-11-25 10:34:34 +00:00
Richard Hughes
fd50193cd8 trivial: Bump the dep on libcolorhug 2015-11-25 10:33:28 +00:00
Richard Hughes
0bb530be97 libdfu: Copy the platform ID and invalidate the GUsbDevice when removed 2015-11-25 10:27:36 +00:00
Richard Hughes
5d057a8fce Split out the DFU provider as a new file 2015-11-25 10:27:36 +00:00
Richard Hughes
a45d00eb2c Rescan the DFU device after replug to get the new version 2015-11-24 12:35:22 +00:00
Richard Hughes
a3a8f5039c Emit the changed signal after doing an update
This allows the UI to re-request the update list.
2015-11-24 12:35:22 +00:00
Richard Hughes
999e96bbd4 Close DFU devices as soon as possible after the transfer has completed
This allows clients like 'dfu-tool watch' to report the status values correctly.
2015-11-24 12:35:22 +00:00
Richard Hughes
5d6066c002 libdfu: Use signals to propagate device state
Also, add padding to the various class structs so we can add more signals in
the future without breaking ABI.
2015-11-23 10:19:24 +00:00
Richard Hughes
e7aaf39de2 libdfu: Fix multi-interface devices like the Neo Freerunner
The DFU specification specifies that only one of the DFU interfaces has to
export a functional descriptor; I assumed they all had to. Adding support
for this kind of device rapidly turned into a massive restructure and it was
all too complicated anyway.

Reorganise the code so that we can support these kinds of devices and clean up
the API so it's sane and easy to use. This also allows us to generate the
GObject introspection GIR and to also install libdfu as a shared library.

If you've got any comments about the API, please shout now as when 6.0 is
released it will become API and ABI stable.
2015-11-22 21:17:48 +00:00
Richard Hughes
e7ba943cf5 libdfu: Support download and upload to ST DfuSe devices
Also, simplify the general download and upload API now we can deal with
element data in chunks.
2015-11-20 14:14:05 +00:00
Richard Hughes
a941c3a9e9 Use new API available in fwup 0.5
This allows us to schedule a UEFI update without writing a temp file.
2015-11-17 11:06:29 +00:00
Richard Hughes
3ad474214b Ignore the DFU device detach:attach when verifying 2015-11-16 16:36:55 +00:00
Richard Hughes
7d79e580bb Use the same device identification string format as Microsoft
Using our own special version for the input for the GUID calculations means
that the result is not 'googlable'.

This does have the result of changing the GUIDs stored in the 'verify' database
but given the string->GUID function in appstream-glib has also changed to
become standards compliant and that only a few people are using it I felt it
was worth the pain.
2015-11-15 11:02:33 +00:00
Richard Hughes
62633af0db libdfu: Add support for DfuSe firmware
Also, move some shared stuff down from DfuTarget to DfuDevice.
2015-11-14 16:34:09 +00:00
Richard Hughes
a3acd7f711 Add support for updating USB devices with DFU
This adds a private libdfu library and also a small utility program called
dfu-tool.
2015-11-12 17:32:48 +00:00
Richard Hughes
e49b266fd5 trivial: Fix a small critical warning for broken USB devices 2015-11-12 17:32:48 +00:00
Richard Hughes
a48361f82f Use strerror() when printing errors from libfwupdate
Fixes https://github.com/hughsie/fwupd/issues/37
2015-11-12 17:29:30 +00:00
Mario Limonciello
e43cfdcb3d trivial: return for UEFI errors is a decimal not string.
This is for part of issue #38.
2015-11-12 10:06:39 -06:00
Mario Limonciello
6fade1ffea Fix compile error against fwupdate git due to dropped functions.
Closes #37
2015-11-10 18:13:48 -06:00
Richard Hughes
b2fe639940 Use the correct user agent string for fwupdmgr 2015-11-05 08:48:48 +00:00
Richard Hughes
0f89bcd47d trivial: Update the run-fwupd.sh script to include all debugging 2015-10-30 08:49:03 +00:00
Richard Hughes
bb840ceaff Do not assume that the compressed XML data will be NUL terminated
In most cases this is out of chance, but in some random cases the gzip
decompressor decides to reuse the input buffer as a decompression buffer,
which means we get junk data after the decompressed text.

To solve this, just truncate the data at the reported size, and then feed this
into the XML parser.

Fixes: https://github.com/hughsie/fwupd/issues/36
2015-10-30 08:47:28 +00:00
Richard Hughes
f2fca01989 Avoid seeking when reading the file magic during refresh 2015-10-30 08:44:44 +00:00
Richard Hughes
727664fa20 Clear the in-memory firmware store only after parsing a valid XML file
If we send junk to UpdateMetadata() the deamon did something like this:

* Clear existing entries from memory
* Try to load junk file into memory -> error

This left us with no entries in the in-memory store, which required the user to
either keep retrying the 'fwupdmgr update' until it worked or just forced them
to restart fwupd so it loaded the old valid store from the cache file.

Now, only clear the in-memory store and add the new firmware entries when
we know the file has been parsed correctly.

Fixes: https://github.com/hughsie/fwupd/issues/35
2015-10-27 09:56:13 +00:00
Richard Hughes
d9fa06b8c9 trivial: Fix compile with really new versions of appstream-glib 2015-10-18 20:56:16 +01:00
Richard Hughes
709d0114e3 Fix verify-update to produce components with the correct provide values 2015-10-09 12:17:08 +01:00
Richard Hughes
60f48c2013 trivial: Do no ship the old-style cleanup functions 2015-10-08 20:25:51 +01:00
Richard Hughes
3f23650f15 Add profiling data to debug slow startup times 2015-10-08 20:11:57 +01:00
Richard Hughes
d449447fc8 Add the update description to the GetDetails results 2015-10-08 20:11:34 +01:00
Richard Hughes
01d9ac56f0 trivial: Fix make check 2015-10-08 19:57:03 +01:00
Richard Hughes
5d14deff4a Support cabinet archives files with more than one firmware
This allows a vendor to upload a single file that targets different versions of
the same hardware. If this feature is used, the metainfo.xml files *must* have
something like <checksum target="content" filename="firmware2.rom"/> inside the
latest <release> tag.
2015-10-07 17:45:11 +01:00
Richard Hughes
9e1768940d When the version is from the 'FW' extension do not cache the device
This ensures we don't get confused when plugging in and out multiple ColorHug
devices of the same kind but with different version numbers.
2015-10-06 10:37:32 +01:00
Richard Hughes
2b549a6419 trivial: Remove unused struct member 2015-10-06 10:37:32 +01:00
Richard Hughes
2d32b8f0e9 trivial: Include the filename in the error when fwupd.conf is not found
This can happen if the user deletes it from /etc or is running inside a prefix
shell, e.g. jhbuild.
2015-09-28 13:56:42 +01:00
Richard Hughes
a48106f1f8 Show the dotted-decimal representation of the UEFI version number 2015-09-24 10:08:18 +01:00
Richard Hughes
697eb60320 Ensure D-Bus remote errors are registered at fwupdmgr startup
Fixes: https://github.com/hughsie/fwupd/issues/31
2015-09-23 10:04:17 +01:00
Kalev Lember
1f819d7adc offline update: Use glib api for for reading symlinks
readlink() man page says that applications must not rely on it returning
null-terminated links. This commit switches it to use g_file_read_link()
instead that has much nicer API and shields us from readlink() oddities.
2015-09-18 13:54:34 +02:00
Richard Hughes
9d76a877db Fix the error message when no devices can be updated
Fixes: https://github.com/hughsie/fwupd/issues/30
2015-09-17 12:49:07 +01:00
Richard Hughes
f00f1e90ea trivial: Do not show the D-Bus error prefix 2015-09-17 12:48:26 +01:00
Richard Hughes
c2da4b2580 Do not reboot if racing with the PackageKit offline update mechanism
The very first thing the PackageKit updater does is delete this symlink...
2015-09-14 12:15:41 +01:00
Richard Hughes
46832432ea Raise the dep on GLib to support and use g_autoptr() 2015-09-11 13:43:15 +01:00
Richard Hughes
033ccba050 Do not merge the existing firmware metadata with the submitted files
This just causes confusion and makes things hard to debug.
2015-09-10 15:06:26 +01:00
Richard Hughes
2257cee8ee Simplify the version properties on devices to avoid complexity and bugs
This reduces the number of 'version' properties from 4 to 2... We can just use
these consistently to mean 'older' and 'newer'.
2015-09-08 16:53:49 +01:00
Richard Hughes
82856d9843 Add application metadata when getting the updates list 2015-09-08 16:53:49 +01:00
Richard Hughes
51f5083b09 Depend on appstream-glib >= 0.5.0 2015-09-08 16:53:49 +01:00
Richard Hughes
5c35abb1a5 Remove fwsignd, we have the LVFS now 2015-08-27 14:45:42 +01:00
Richard Hughes
98dd640f41 Don't apply firmware if something else is processing the offline update
This also stops us rebooting the computer a few seconds into a PackageKit
offline update...
2015-08-25 14:07:48 +01:00
Mario Limonciello
001558db63 Install fwupd and fwsignd into /usr/lib/$(triplet)/fwupd instead.
Fixes https://github.com/hughsie/fwupd/issues/29
2015-08-14 18:58:33 -05:00
Richard Hughes
ff7e6ceb98 Generate the ColorHug test files at runtime
Also, fix the firmware.inf to have the correct ClassGuid.
2015-08-12 09:09:28 +01:00
Richard Hughes
ba14582ef4 Use the AppStream 0.9 firmware specification by default 2015-08-11 14:34:08 +01:00
Richard Hughes
76d14e1a03 trivial: Use the new libappstream-glib API where available 2015-08-10 09:29:18 +01:00
Richard Hughes
25cf6ab53e Add a Raspberry Pi firmware provider
This queries the current firmware version and also allows online or offline
updating.
2015-08-05 12:14:56 +01:00
Richard Hughes
804c075fee Make parsing the option ROM runtime optional
On devices with a lot of PCI devices this can take a couple of seconds per
device, and if this feature is not desired then disabling it saves system
resources.
2015-08-04 14:56:39 +01:00
Richard Hughes
ac8b192033 Add a simple config file to store the correct LVFS download URI 2015-08-04 14:56:39 +01:00
Richard Hughes
e00d70dabe trivial: Fix compile with AppStreamGlib git master 2015-08-04 14:44:37 +01:00
Richard Hughes
c6ff8fa574 Move the verification and metadata matching phase to the daemon
This allows us to use the functionality in gnome-software or cockpit without
loading the system AppStream store.
2015-08-03 18:00:54 +01:00
Richard Hughes
9985a24a29 Fix validation of written firmware
It turns out comparing sha1{firmware.cab} and sha1{firmware.bin} doesn't match.
Require appstream-glib 0.5.x for the new API required to fix this.
2015-08-03 13:22:34 +01:00
Richard Hughes
d51173d448 Allow no arguments to 'fwupdmgr verify-update' and use sane defaults
Reading firmware from devices and writing to the default path will typically
require authentication.
2015-07-30 19:56:04 +01:00
Richard Hughes
40b6b3f597 Prefer the GUID from the firmware than the device
The firmware may be more generic, and it also allows us to match the GUID then
doing 'verify' on a device with a different device PID than the firmware
actually declares.
2015-07-30 18:41:39 +01:00
Richard Hughes
a7c99b54ea Devices with option ROM are always internal 2015-07-29 15:55:48 +01:00
Richard Hughes
441785d215 trivial: Fix up some harmless lint, no code changes 2015-07-28 14:56:19 +01:00
Richard Hughes
eaa09993b0 trivial: Remove some unused code found by clang 2015-07-28 14:05:26 +01:00
Richard Hughes
fe8b96e74e Do not pre-convert the update description from AppStream XML
This allows the text clients like fwupdmgr to convert to UTF-8 text, and
graphical clients can use the markdown target to ensure the links are made
clickable and paragraphs are presented in the right way.
2015-07-28 13:13:41 +01:00
Richard Hughes
04ee5856d0 Sign the test binary with the correct key
Use the LVFS key rather than my own GPG key, and load that in the self tests.

Fixes https://github.com/hughsie/fwupd/issues/14
2015-07-28 09:47:03 +01:00
Thomas Hindoe Paaboel Andersen
1058ce8155 trivial: remove unused variables 2015-07-27 00:24:01 +02:00
Richard Hughes
31477cf4e7 trivial: Fix make distcheck 2015-07-25 14:51:36 +01:00
Mario Limonciello
3ed5447c92 Reload appstream data after refreshing. 2015-07-23 19:01:15 -05:00
Mario Limonciello
a570bb5195 Fallback to offline install when calling the update argument.
The fallback support is currently only present in the regular
install argument.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2015-07-23 20:40:52 +01:00
Richard Hughes
0950db9340 Only sign files when the entire file has been copied
For large files, EVENT_CREATED gets emitted when the first chunk hits the disk,
not when the file has finished copying. To fix, just wait for the file monitor
to hint that all the changes in the operation have happened and then process
the firmware files.
2015-07-23 09:15:28 +01:00
Richard Hughes
e70f12af9e trivial: Allow parsing unsigned firmware 2015-07-22 17:42:41 +01:00
Richard Hughes
e97261ab3d trivial: rename 'update-metadata' to 'refresh' now we have an 'update' command 2015-07-22 10:36:00 +01:00
Richard Hughes
777917ef21 Add a 'fwupdmgr update' command to update all devices to latest versions
This downloads the latest version of the firmware and applies it to any
matching hardware. e.g.

$ fwupdmgr update
Downloading 1.2.3 for ColorHug...
Updating 1.2.3 on ColorHug...
 * Loading firmware
 * Decompressing firmware
 * Restarting device
 * Writing firmware to device
 * Verifying firmware from device
 * Restarting device
Done!
2015-07-22 10:36:00 +01:00
Richard Hughes
ade063b0df Allow installing an offline UEFI update without --offline
The way this works is we try with the user settings, and if this fails with
NotSupported and the offline flag is unset then we retry the action with a
warning and the flag manually set.

I chose to do this in the client rather than the daemon as I don't want to
encode too many magic rules when we don't know the kind of devices that will
appear in the future.

Fixes the other half of https://github.com/hughsie/fwupd/pull/23
2015-07-22 10:36:00 +01:00
Richard Hughes
63a407ab34 Change the DBus method for installing firmware to 'Install'
It seems a little odd to call it 'Update' when it's being used for downgrading
and reinstalling as well.

As we're making things simpler, just use a single 'install' action in fwupdmgr
rather than 'install', 'update-online', 'update-offline'. We can use the flags
and fallbacks to do the right thing in all cases, and make the typical case
(installing a local file to any matching hardware) simple.

Fixes half of https://github.com/hughsie/fwupd/pull/23
2015-07-22 10:36:00 +01:00
Richard Hughes
7708a0f3fd Move GetUpdates to the daemon
This only returns the latest version, if you actually need to know details
about all versions including downgrades then you still need to load the
AppStream metadata and match devices manually.
2015-07-22 10:35:05 +01:00
Richard Hughes
2b60a33c8f Do not merge existing LVFS metadata
If we change the filenames or hash values we don't want duplicate locations.
2015-07-21 17:19:54 +01:00
Richard Hughes
0b8d461099 trivial: Use the correct error codes when failing to download metadata 2015-07-21 13:27:10 +01:00
Richard Hughes
ebaf7ba035 Allow running fwsignd as the non-root user
...however, most users will still want to use the root user so that the owner
and group are set correctly on the destination files.
2015-07-21 13:24:26 +01:00
Mario Limonciello
28b8151ca0 Don't call efibootmgr after fwupdate.
fwupdate will handle creating the appropriate BootNext entry.
No other changes are needed from fwupd.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2015-07-20 16:21:24 +01:00
Richard Hughes
c7cf166a2f Automatically download metadata using fwupdmgr if required
Using no arguments to 'fwupdmgr update-metadata' means we use the network.
2015-07-20 16:19:20 +01:00
Richard Hughes
691e02d652 Add a simple signing server that operates on .cab files 2015-07-20 15:31:10 +01:00
Richard Hughes
1a886b1b76 Allow cab files to be saved
This means reworking the way we load the file as we have to keep the full
filelist in case we have to re-extract and save each and every file.
2015-07-20 15:31:05 +01:00
Richard Hughes
eec19e760d Add the ability to create detached signatures 2015-07-20 15:30:48 +01:00
Richard Hughes
8ffbd403cb Fix ROM PPID searching to work for all ROMs 2015-07-08 14:28:53 +01:00
Richard Hughes
f720e9fe92 trivial: Do not add an extra ROM section for a NUL padded ROM 2015-07-05 21:13:43 +01:00
Richard Hughes
fe68ff584f Make the version parsing more resilient to corrupt firmware 2015-07-03 12:37:56 +01:00
Richard Hughes
53fc7961dc trivial: Remove a magic number introduced with the last patch 2015-07-01 14:12:15 +01:00
Richard Hughes
885128a7c8 Keep hitting the hardware until it gives us enough ROM 2015-07-01 14:06:28 +01:00
Richard Hughes
5e330b0f0c Fix trivial bug when parsing firmware versions 2015-07-01 13:30:23 +01:00
Richard Hughes
46535115ee trivial: Remove debug info that snuck in 2015-07-01 13:05:01 +01:00
Richard Hughes
5dc6f5ccfc Add a 'verify-update' command to fwupdmgr
This allows us to do something like:

    $ fwupdmgr verify
    e9b8eebd-b5f8-18d4-9fbd-d7da7711985c	f21e1d2c969dedbefcf5acfdab4fa0c5ff111a57	No metadata
    $ find /sys/devices -name rom -exec sudo fwupdmgr verify-update /var/cache/app-info/xmls/fwupd-verify.xml {} \;
    $ fwupdmgr verify
    e9b8eebd-b5f8-18d4-9fbd-d7da7711985c	f21e1d2c969dedbefcf5acfdab4fa0c5ff111a57	OK
    $ # flash the firmware
    $ fwupdmgr verify
    e9b8eebd-b5f8-18d4-9fbd-d7da7711985c	5c946b3950deaf7b102e75be488052afd4dcf16	        Failed: for v013.012.000.019.000000 expected f21e1d2c969dedbefcf5acfdab4fa0c5ff111a57
2015-07-01 12:16:09 +01:00
Richard Hughes
826a5698e3 trivial: Always return the verification hash for the first verify run
The property is being cached, so re-request the list of devices.
2015-07-01 12:07:07 +01:00
Richard Hughes
5e33bccd54 Accept multiple files at one time when using fwupdmgr dump-rom 2015-07-01 11:53:33 +01:00
Richard Hughes
c14aa63c25 Actually parse the PCI option ROM
This allows us to get more details about the firmware.
2015-07-01 11:52:02 +01:00
Richard Hughes
84e1efa65e trivial: Split out the GUID functionality to a new file 2015-07-01 11:50:38 +01:00
Richard Hughes
7d7a2d3227 trivial: Fix a crash with corrupt firmware files 2015-07-01 11:46:23 +01:00
Richard Hughes
c15cd320b6 Fix Intel VBIOS detection on Dell hardware
Many thanks to Gerben Welter for reporting the problem.
2015-06-30 20:54:05 +01:00
Thomas Hindoe Paaboel Andersen
7fca610d67 Do not return NULL as a gboolean 2015-06-30 21:00:56 +02:00
Thomas Hindoe Paaboel Andersen
80b85676bb remove unused variables 2015-06-30 20:47:15 +02:00
Jussi Kukkonen
ebfbad71e3 build: gusb is required even without colorhug
Fix build failure when building with --disable-colorhug.
2015-06-30 19:45:31 +03:00
Richard Hughes
174211b979 Provide a way to dump the option ROM using the command line
This allows someone to do:

$ find /sys/devices -name rom -exec sudo fwupdmgr dump-rom {} \;

...and get a nice summary of the option roms installed.
2015-06-30 15:40:46 +01:00
Richard Hughes
ac32a2a232 trivial: Fix a crash if the rom filename is invalid 2015-06-30 15:36:36 +01:00
Richard Hughes
ffd5fdf7f2 Get the version number out from Intel VBIOS too 2015-06-30 15:12:28 +01:00
Richard Hughes
4b41e737b1 Make the ROM parsing more robust and add self tests
This code can now parse 99.6% of all the user-submitted firmwares from the
http://www.techpowerup.com/vgabios/ database.
2015-06-30 14:00:31 +01:00
Richard Hughes
a043c2e376 Add a 'verify' command that verifies the cryptographic hash of device firmware
Goes some way towards fixing https://github.com/hughsie/fwupd/issues/15
2015-06-29 12:53:01 +01:00
Richard Hughes
a1e5d86d20 Extract the version string from the ROM in PCI devices 2015-06-29 12:53:01 +01:00
Richard Hughes
ebb58a3495 Add a Udev firmware provider
This allows us to support showing firmware updates for VIA USB hubs
2015-06-29 12:53:01 +01:00
Richard Hughes
ae0efdc5a7 Provide a way for clients to add new firmware metadata to the system cache
This is only possible if the metadata has been signed by a key that we trust.
2015-06-25 09:59:53 +01:00
Richard Hughes
f0d6c86df2 trivial: Print the command message even for internal error 2015-05-21 13:42:10 +01:00
Richard Hughes
d7dba98e68 Move boolean properties on the device to a set of flags
This is much less boilerplate and allows us to expand in the future.
2015-05-05 16:02:20 +01:00
Richard Hughes
c89c1b0e9b Support OpenHardware devices using the fwupd vendor extensions
We won't be able to update these devices ourself, but we can detect if there
are updates available.
2015-05-05 15:22:00 +01:00
Richard Hughes
3b0be1b8bb Get the firmware version from the device descriptors
Not claiming the interface means we can avoid blocking other applications just
to get the current firmware version.

See https://blogs.gnome.org/hughsie/2015/04/29/updating-openhardware-firmware-2/
for more details about what is required from firmware.
2015-04-29 16:37:49 +01:00
Richard Hughes
d8a02bfeeb Run the offline actions using systemd when required 2015-04-25 17:14:20 +01:00
Richard Hughes
fd4688408d Coldplug the devices before acquiring the well known name
This prevents getting no added devices when 'fwupdmgr get-devices' autostarts
the fwupd process.
2015-04-22 16:44:10 +01:00
Richard Hughes
adb7a5e29b Extract the .cat file alongside the firmware 2015-04-16 12:02:37 +01:00
Richard Hughes
63bbbf544f Only allow signed firmware to be upgraded without a password
This does not affect UEFI capsule updates as the signing is checked by the
machine itself. We don't know anything about the trust level at all because
NIST SP800-147 pretty much says we're not allowed to.

For BIOS or ColorHug updates however we really do need to request authentication
before downgrading or installing non-signed code.

At the moment only the Hughski Limited key is trusted for firmware, although I
hope in the future we can also include Red Hat, Microsoft, Intel, AMD and other
hardware vendors in that list too.

Fixes: https://github.com/hughsie/fwupd/issues/5
2015-04-14 16:19:39 +01:00
Richard Hughes
d8fa049693 Show the firmware trust status when doing GetDetails() 2015-04-14 15:57:08 +01:00
Richard Hughes
8a08f9d8f3 Verify firmware if a detached signature is present 2015-04-14 15:41:44 +01:00
Richard Hughes
683b0e0def Decompress any firmware signatures in the .cab file 2015-04-14 15:08:24 +01:00
Richard Hughes
36a889034c Add helper code to validate public key signatures
We'll use this in the future for checking device firmware.
2015-04-14 13:53:19 +01:00
Richard Hughes
8ccb1af4fe trivial: Use the ALS firmware with signed payload 2015-04-14 13:44:35 +01:00
Richard Hughes
d34d7d9643 trivial: Fix a tiny compile warning 2015-04-08 19:47:41 +01:00
Richard Hughes
8818151196 Export the status as an enumerated value rather than a string 2015-03-19 10:57:44 +00:00
Richard Hughes
f910ac9541 trivial: Also export the status enum codes 2015-03-19 10:54:06 +00:00
Richard Hughes
8645ec9ad5 Create a libfwupd shared library 2015-03-19 10:54:05 +00:00
Richard Hughes
d3c0a70b37 Create runtime directories if they do not exist 2015-03-19 10:31:23 +00:00
Richard Hughes
0e883ee815 Add and document the offline-update lifecycle
Also allow providers to override getting and clearing the last update status.
2015-03-19 10:31:23 +00:00
Richard Hughes
871e017bdb Add a 'get-updates' command to fwupdmgr
This matches the devices from the AppStream metadata and displays new releases.
2015-03-17 21:00:21 +00:00
Richard Hughes
9a38c03fe2 Do not crash when there are no devices to return 2015-03-17 20:58:46 +00:00
Richard Hughes
7c3485bc1b trivial: Make a translated string a little clearer 2015-03-17 07:56:31 +00:00
Richard Hughes
8ded6ca0f1 trivial: Mark some more strings as translatable
Also fix up some translator comments.
2015-03-16 12:51:43 +00:00
Richard Hughes
310419856b trivial: Add some files ready for a first release 2015-03-16 12:51:04 +00:00
Richard Hughes
31ddb97066 trivial: Relax the BRs so we can build in Fedora 22 2015-03-16 11:38:03 +00:00
Richard Hughes
bbac6d7932 Return some more fields when returning data about firmware files 2015-03-12 11:41:20 +00:00
Richard Hughes
8152e208d5 Use the metainfo.xml in the .cab file when it's available 2015-03-11 22:01:47 +00:00
Richard Hughes
45255952b7 Use efibootmgr to automatically boot the UEFI firmware update process 2015-03-11 21:34:40 +00:00
Richard Hughes
28cf0a8d1b trivial: Fix crash when installing UEFI firmware 2015-03-11 20:33:11 +00:00
Richard Hughes
d7022b50e6 Emit ::Changed() when devices are added or removed
This allows clients to reget any available updates.
2015-03-11 19:47:08 +00:00
Richard Hughes
1e59872733 Port to the new fwupdate API 2015-03-10 17:32:20 +00:00
Richard Hughes
3bf9480d34 Parse the firmware name when exploding the cab file 2015-03-10 15:57:30 +00:00
Richard Hughes
dd2c776c0a trivial: Fix the ColorHug display names 2015-03-10 09:48:00 +00:00
Richard Hughes
773ce988e8 Add a 'Status' property which is updated when the daemon is active 2015-03-09 22:43:25 +00:00
Richard Hughes
a8e8394b70 Do not require the root password to update removable devices 2015-03-09 22:43:25 +00:00
Richard Hughes
184232918d Do not require authentication to update devices when the root user 2015-03-09 22:43:25 +00:00
Richard Hughes
cccc775b60 Add a method to get details about a firmware file 2015-03-09 11:04:32 +00:00
Richard Hughes
d079b1a6ca Allow installing firmware without a specified device ID 2015-03-06 10:09:55 +00:00
Richard Hughes
18e7591104 Use fwup.h to actually implement the UEFI update 2015-03-05 13:56:56 +00:00
Richard Hughes
6af9e50c7d Delete the pending firmware file after it has been used 2015-03-05 13:56:56 +00:00
Richard Hughes
003e4bf9b7 Check the firmware is valid for the device before applying 2015-03-05 13:38:39 +00:00
Richard Hughes
3c99ba4d3c Make both the ColorHug and UEFI support optional 2015-03-05 12:17:48 +00:00
Richard Hughes
412034adaa Add actual error codes for failure 2015-03-05 11:30:58 +00:00
Richard Hughes
d1e823ccbf Allow scheduling updates for later
Also add a update-prepared command to fwupdmgr to process the defered updates.
In the future we'll hook into the systemd early-boot code for this.
2015-03-05 11:15:36 +00:00
Richard Hughes
9849d2bb61 Register the local error codes with D-Bus to return a nice error message 2015-03-04 22:30:12 +00:00
Richard Hughes
d3d0165259 trivial: Strip the D-Bus error before showing to the user 2015-03-04 22:30:12 +00:00
Richard Hughes
1b5ea3517d Add an OnlyOffline property for devices that cannot do online updates 2015-03-04 22:30:12 +00:00
Richard Hughes
e7c1264f3b Add a --force option to fwupdmgr to allow installing old firmware 2015-03-04 22:30:12 +00:00
Richard Hughes
def3175655 Compare the specified and installed firmare versions 2015-03-04 19:26:54 +00:00
Richard Hughes
a2288a3fce trivial: Fix build after the ColorHug rename 2015-03-04 18:45:15 +00:00
Richard Hughes
72dff812c0 Add initial ColorHug support
This may be useful; more people have ColorHug devices than UEFI firmware that
supports system capsule updates.
2015-03-03 15:13:27 +00:00
Richard Hughes
81e8d799f7 trivial: Pad out the properties when doing GetDevices 2015-03-03 15:11:22 +00:00
Richard Hughes
67ec898265 Extract the .cab file and parse the .inf file 2015-03-03 11:41:01 +00:00
Richard Hughes
1ffde6cd72 Return the device properties when calling GetDevices()
This allows us to discover a version number, and other things.
2015-03-02 22:44:58 +00:00
Richard Hughes
74cc217f9d Support online updates
This doesn't make sense for UEFI firmware, but allows us to support other
future usecases.
2015-03-01 20:33:54 +00:00
Richard Hughes
f508e76a7a Use PolicyKit to check the authorisation of the firmware update 2015-02-27 12:49:36 +00:00
Richard Hughes
8bbfdf49a8 Flesh out the provider interface and allow offline updates 2015-02-27 08:29:13 +00:00
Richard Hughes
8dbfb1c478 Add initial build files and enough code to launch a simple D-Bus daemon 2015-02-26 18:16:40 +00:00