Commit Graph

328 Commits

Author SHA1 Message Date
Leo
6640b571bf Fix shebangs on scripts 2019-11-24 18:51:56 -06:00
Richard Hughes
342a38b432 Release fwupd 1.3.4 2019-11-22 16:00:40 +00:00
Ken VanDine
d5988a5339 Allows confined snaps to activate fwupd via D-Bus 2019-11-12 12:40:08 -06:00
Mario Limonciello
5123d4333e Rename unifying plugin to logitech-hidpp (Fixes: #1329) 2019-11-04 13:35:36 -06:00
Richard Hughes
f6526ddb63 Release fwupd 1.3.3 2019-11-01 15:06:16 +00:00
Richard Hughes
02792c0ba3 trivial: Fix up some typos from codespell 2019-11-01 14:21:20 +00:00
Mario Limonciello
98b951688a Use device safety flags to show prompts before installing updates 2019-10-30 11:30:36 -05:00
Richard Hughes
a58510b246 Allow verifying the device image itself from fwupdtool
To debug flashing failures it's sometimes requried to get a SPI dump of the
hardware to analysis.

Add a debug-only command that lets us dump the device from the engine.
2019-10-30 13:55:55 +00:00
Richard Hughes
51a869a01d Use XMLb to query quirks
During startup we do 1898 persistent allocations to load the quirk files, which
equates to ~90kb of RSS. Use libxmlb to create a mmap'able store we can query
with XPath queries at runtime.
2019-10-30 08:29:58 -05:00
Richard Hughes
95c98a95b6 Allow fwupdtool to dump details of common firmware formats
To do this, the plugins have to register the GType(s) they are using for
firmware, along with a short 'id' that can be used in CLI scripts.
2019-10-22 12:36:15 -05:00
Mario Limonciello
0b9bfec150 Add a systemd preset file for fwupd-refresh.service
Makes `fwupd-refresh.service` strictly opt-in.

Some distros are defaulting to all systemd services on and causing
more refreshes than desirable by default, especially when using
both `gnome-software` and `fwupd-refresh.service`
2019-10-20 14:31:13 -05:00
Mario Limonciello
561751faff trivial: don't try to enable LVFS from systemd 2019-10-18 09:21:19 -05:00
Mario Limonciello
80d6581be8 trivial: fwupd-refresh: activate motd if using systemd v243 or later
It turns out there is some bug in systemd v242 or less that runtime
directories can't be used.  So only populate motd when we know that
we have a newer systemd
2019-10-15 15:56:33 -05:00
Mario Limonciello
2a4fa179ff trivial: fwupd-refresh: allow exit code 2 for success
This is no supported devices, and shouldn't cause systemd failures
for fwupd-refresh.
2019-10-15 15:56:33 -05:00
Richard Hughes
c0695320c8 Add a generic DFU firmware object for plugins to use 2019-10-11 13:19:46 +01:00
Mario Limonciello
d837ca8c28 fu-util: add support for a reinstall command 2019-10-03 08:16:41 -05:00
Mario Limonciello
34c366aab2 Add support for automatically uploading reports 2019-09-30 16:21:23 -05:00
Mario Limonciello
4f13bbc7e3 trivial: motd: disable updating motd for now
It looks like a systemd bug is happening, but let it be diagnosed upstream
systemd first.

https://github.com/systemd/systemd/issues/13688
2019-09-30 14:09:18 -05:00
Mario Limonciello
dc7e7c3808 trivial: fwupd-refresh: fix a clash with fwupd.service (Closes: #941360)
`fwupd-refresh.service` uses `DynamicUser=true` which causes systemd
to make `/var/cache/fwupd` a symlink to `/var/cache/private/fwupd`.

Individual units aren't allowed to access this directory, only the ones
with the directive.  This means that `fwupd.service` stops working as
soon as a user tries to start `fwupd-refresh.service`.

The bug details are present in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=941360
2019-09-30 14:09:18 -05:00
Richard Hughes
0d8efd2373 Release fwupd 1.3.2 2019-09-26 11:05:06 +01:00
worldofpeace
41a25be6f4 Move D-Bus conf file to datadir/dbus-1/system.d
Since D-Bus 1.9.18 configuration files installed by third-party should
go in share/dbus-1/system.d. The old location is for sysadmin overrides.
2019-09-16 16:37:06 +01:00
Richard Hughes
67ad8d0d22 Release fwupd 1.3.1 2019-09-13 10:58:38 +01:00
Richard Hughes
fbff921b35 Allow disabling all plugins
This allows us to easily build just libfwupd in a flatpak manifest without
installing dozens of deps to build things we're just going to delete anyway.
2019-09-13 10:27:57 +01:00
Richard Hughes
0e46b22728 Allow disabling SSL strict mode for broken corporate proxies 2019-09-05 19:14:38 +01:00
Mario Limonciello
dfff18e3e8 Add aliases for get-upgrades and upgrade
Mostly for consistency purpose.  Details:
* It's confusing that internally the functions for `FwupdClient` use
`upgrade` in the name.
* The logical antonym of `downgrade` is `upgrade` not `update`
* People who don't use the tool frequently may try `get-upgrades`
2019-08-29 19:14:55 +01:00
Mario Limonciello
921e426f5a Use more systemd directives for directories
systemd will automatically create these directories if missing
and also will set permissions accordingly on them.
2019-08-27 06:08:06 -05:00
Mario Limonciello
71d2f62dc2 trivial: update references of hughsie/fwupd to fwupd/fwupd 2019-08-22 09:47:52 -05:00
Mario Limonciello
b390b14f8f Add support to integrate into the motd (Fixes: #1270)
Fixes Debian bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=921820

Introduce a new --log option to fwupdmgr that will log stdout to an argument.
If run under systemd, prefix that argument with $RUNTIME_DIRECTORY.

Add a new systemd unit and associated timer to regularly refresh metadata.
After the metadata refresh is complete, save the output to the motd location.

The timer and service are disabled by default and can be enabled by an admin.
2019-08-22 06:39:02 +01:00
Richard Hughes
7afd7cba0d Use FuFirmware as a container for firmware images
In many plugins we've wanted to use ->prepare_firmware() to parse the firmware
ahead of ->detach() and ->write_firmware() but this has the limitation that it
can only return a single blob of data.

For many devices, multiple binary blobs are required from one parsed image,
for instance providing signatures, config and data blobs that have to be pushed
to the device in different way.

This also means we parse the firmware *before* we ask the user to detach.

Break the internal FuDevice API to support these firmware types as they become
more popular.

This also allows us to move the Intel HEX and SREC parsing out of the dfu plugin
as they are used by a few plugins now, and resolving symbols between plugins
isn't exactly awesome.
2019-08-08 13:10:57 +01:00
Richard Hughes
747f570310 Allow filtering devices when using the command line tools 2019-08-06 20:59:28 +01:00
Mario Limonciello
00aabbf78b trivial: add cache directory into systemd unit rw paths 2019-08-01 07:50:02 +01:00
Richard Hughes
80e02dfe21 Release fwupd 1.2.10 2019-07-15 19:25:54 +01:00
Richard Hughes
4808c0ebad Release fwupd 1.2.9 2019-05-20 11:17:42 +01:00
Mario Limonciello
e1b4b20978 Dynamically read path to use for /system-update
This allows `fwupdoffline` to work in installations that don't use
`/var/lib/fwupd`.
2019-05-01 09:24:55 -05:00
Richard Hughes
b6f4a1697e trivial: Fix two bugs in the hardware self tests script 2019-04-30 09:26:48 +01:00
Richard Hughes
828c913e37 Release fwupd 1.2.8 2019-04-23 10:25:55 +01:00
Mario Limonciello
38027e696b Allow setting the daemon verbose domains at runtime 2019-04-17 12:12:13 -04:00
Mario Limonciello
bfcf75b7a6 Allow fwupdmgr to modify the daemon config
This allows several things, for instance:

 * Adding or removing blacklisted plugins or devices
 * Changing the idle timeout where allowed

...without a user needing to manually modify a configuration file.
2019-04-17 12:12:13 -04:00
Richard Hughes
a7f860c67f Release fwupd 1.2.7 2019-04-11 14:33:25 +01:00
Richard Hughes
dce91204c9 Fix some typos spotted using codespell 2019-04-08 12:47:53 +01:00
Mario Limonciello
fe593944a9 fu-tool: Port get-history command to fwupdtool 2019-04-03 14:37:25 -05:00
Mario Limonciello
2df922c23d Move the core built-in 'fwupd' remote over to the dell-esrt plugin
This metadata is useless to other systems, so if compiling a custom
fwupd without -Dplugin_dell=true it shouldn't be included.
2019-04-02 07:18:29 -05:00
Mario Limonciello
58d5fcc210 trivial: metadata: remove very old static VIA metadata
This information was a predecessor to metadata provided by LVFS with
actual files associated.  It's not useful to 99% of the machines it runs
on, and future VIA metadata should come directly with releases on LVFS.
2019-04-02 07:18:29 -05:00
Richard Hughes
963d3897b3 Release fwupd 1.2.6 2019-03-26 10:51:49 +00:00
Richard Hughes
19e56866f6 trivial: Disable MemoryDenyWriteExecute
This is failing for new versions of Gio for some reason. Revert when required.
2019-03-23 11:59:14 +00:00
Richard Hughes
3dbacdf541 Fix the location of fwupdoffline in the service file 2019-03-21 20:58:42 +00:00
Richard Hughes
705402cebd trivial: Do not offer to report firmware for the installed tests 2019-03-21 15:54:52 +00:00
Richard Hughes
1568449e69 Add a verify-update command to fwupdtool
This is useful for debugging to just read the checksum from the device.
2019-03-18 10:08:58 +00:00
Thaodan
156538f1c3 fwpup.service: use display-manager.service instead of gdm.service
Instead of referring to just *gdm.service* use the alias *display-manager.service* instead to allow other display managers like *sddm* too.
2019-03-12 10:03:27 +00:00
Richard Hughes
4ffc14f6ea Allow signing the fwupd report with the client certificate 2019-03-11 13:57:39 +00:00
Richard Hughes
3d60762bed Add a D-Bus method to generate a signature using the self-signed client certificate 2019-03-11 13:57:39 +00:00
Richard Hughes
4499d19ba3 Move out the offline update functionality to a new binary
The offline updates environment is special, and we have to be careful to delete
the trigger before doing anything that can fail to avoid boot loops.

For this reason, split it out to a simple self-contained binary that is easy to
understand.
2019-03-08 09:45:30 -06:00
Richard Hughes
ad73719fa4 Do not reboot when failing to start fwupd during offline updates
If another offline update task is run at the same time, e.g. pk-offline-update
from PackageKit then we might corrupt the package database when the client
D-Bus request times out.

Copy the fixes from PackageKit so that the offline updates work together.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1685471
2019-03-08 09:45:30 -06:00
Richard Hughes
5806867ebe Add the fwupdagent binary for use in shell scripts
This currently just outputs the current list of devices with releases and makes
it possible to integrate firmware version reporting with other tools like mgmt.
2019-03-06 13:15:55 +00:00
Richard Hughes
8dd4c1c4dd Allow restricting firmware updates for enterprise use 2019-03-05 19:05:07 +00:00
Mario Limonciello
3143bad0f5 fu-tool: Save device state to @LOCALSTATEDIR@/lib/fwupd/state.json on actions
This feature is turned on with the new fwupdtool option `--enable-json-state`

The intended use case is for ChromeOS to be able to save information about
devices on the system when `fwupdtool update` was run to display in the UX at
a later time.
2019-02-28 10:32:45 -06:00
Mario Limonciello
2b020efa5e trivial: modify appstream metadata for some warnings
The following warnings were displayed by Debian appstream metadata
validation.

```
metainfo-validation-issue
Validation of the metainfo file found a problem: Found empty 'url' tag.
metainfo-validation-issue
Validation of the metainfo file found a problem: Type 'console-application' component, but no information about binaries in $PATH was provided via a provides/binary tag.
metainfo-validation-issue
Validation of the metainfo file found a problem: Found empty 'url' tag.
```
2019-02-28 09:38:12 -06:00
Mario Limonciello
96a0dd5606 Add a support for delayed activation
This is intended for devices that it is not safe to immediately activate
the firmware.  It may be called at a more convenient time instead.

Both fwupdmgr and fwupdtool support the feature.

- if called at runtime with fwupdmgr it uses the daemon
- during shutdown fwupdtool uses the pending.db to perform this feature.
2019-02-27 09:04:54 +00:00
Marcin Sucharski
de2b70bc7d Add elogind support 2019-02-25 10:05:17 +00:00
Richard Hughes
c2b626dc2d Release fwupd 1.2.5 2019-02-25 09:42:18 +00:00
Richard Hughes
97293c4560 Show in Flathub correctly
For this we need to register as a console application (which fwupdtool is, I
suppose) and also supply a usable icon.

I've used the new GNOME icon theme guidelines so please add a drop shadow
before using: https://gitlab.gnome.org/GNOME/Initiatives/issues/2
2019-02-15 12:32:46 +00:00
Mario Limonciello
80b671633c trivial: Correct the license for some metadata files
These warnings were coming up in the Debian build:
```
W: fwupd source: inconsistent-appstream-metadata-license data/remotes.d/lvfs-testing.metainfo.xml (cc0 != cc0-1.0)
W: fwupd source: inconsistent-appstream-metadata-license data/remotes.d/lvfs.metainfo.xml (cc0 != cc0-1.0)
```
2019-02-07 08:03:33 +00:00
Mario Limonciello
53ce25d985 Add support to call composite prepare and cleanup using fwupdtool
Two new arguments added to fwupdtool: `--prepare` and `--cleanup`

They are used only with the `install-blob` command

This makes sure that devices can get rebooted in dell-dock even if using
fwupdtool to install a single blob.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2019-02-01 16:39:08 +00:00
Richard Hughes
8ece8874b5 Release fwupd 1.2.4 2019-02-01 14:28:36 +00:00
Mario Limonciello
1e35e4c22d fu-tool: Port the get-updates command over
Now that there is actually support to load non-static information
(at least from fwupd perspective) it makes sense to support this
command in both tools.
2019-01-29 09:21:54 -06:00
Mario Limonciello
4f24d0bae3 When using directory remote type automatically generate metadata
The CAB files will be parsed upon `fwupd`/`fwupdtool` startup and
loaded into the daemon.
2019-01-29 09:21:54 -06:00
Mario Limonciello
4c0df63db1 trivial: meson.build: Fix builds with -Ddaemon=false but no other changes
Without this fix build will fail like below:
```
$ meson build -Ddaemon=false
.
.
.

src/meson.build:21:4: ERROR:  Unknown variable "colorhug_pkcs7_signature".
```
2019-01-15 16:24:38 -06:00
Mario Limonciello
46aaee8cec fu-tool: Add support for an 'update' command to fwupdtool
This will perform updates with all currently present metadata.

It is "intended" for usage with local metadata repositories referring
to local files.

fwupdtool however does also support fetching a file from the web
and if the metadata refers to the file on the web it should also work
for that.
2019-01-11 12:59:00 +00:00
Richard Hughes
36a5b8f7a2 Release fwupd 1.2.3 2019-01-04 11:08:49 +00:00
Richard Hughes
c2b4b56bd3 Release fwupd 1.2.2 2018-12-30 15:19:01 +00:00
Mario Limonciello
15e4b0caaf installed-tests: Adjust to actually use a remote for installed tests
By using a remote, this should allow using gnome-software to do the
installed tests without hacking around much.

Fixes: https://github.com/hughsie/fwupd/issues/862
Fixes: https://github.com/hughsie/fwupd/issues/809
2018-11-29 09:40:06 -06:00
Richard Hughes
43fb4a7110 trivial: Update two release note typos 2018-11-28 14:18:36 +00:00
Richard Hughes
c0b20b119b Release fwupd 1.2.1 2018-11-27 14:51:56 +00:00
Richard Hughes
75b965d01d Shut down the daemon after 2h of inactivity
Plugins are allowed to 'opt-out' of this behaviour using _RULE_INHIBITS_IDLE.
This should be used where waking up the hardware to coldplug is expensive,
either from a power consumption point of view, or if other artifacts are going
to be seem -- for instance if the screen flickers when probing display devices.

This functionality is also inhibited when the actual upgrade is happening,
for obvious reasons.

Admins can turn off this auto-sleep behaviour by editing the daemon.conf file.

Fixes https://github.com/hughsie/fwupd/issues/417
2018-11-21 18:54:44 +00:00
Richard Hughes
8a2eaa5514 trivial: Move the release descriptions to the metainfo.xml file
This matches what a lot of other projects do, and means we can easily format
the release notes back into NEWS format, but also into HTML and Markdown.

This also means we can show the correct update description in gnome-software
when building a flatpak, rather than falling back to the generic project
description.
2018-11-16 21:52:41 -06:00
Mario Limonciello
62f8486ffe fwupdmgr/fwupdtool: Move monitor command to fwupdtool
This command is used for monitoring events from the daemon and normally
used only by power users or developers.
2018-10-18 19:36:59 +01:00
Mario Limonciello
f6d01b16de fwupdmgr/fwupdtool: Move firmware builder from fwupdmgr to fwupdtool
This command is really a power user command and should live in
fwupdtool with similar debugging and development features.
2018-10-18 19:36:59 +01:00
Mario Limonciello
7e5c6eebfe meson: Bump dependency to 0.44 and adjust sysconfdir handling
Some code was put in place to workaround sysconfdir behavior of meson
0.43 and less.  This is no longer needed.
2018-10-16 08:21:24 +01:00
Richard Hughes
214906817e trivial: Use less offensive wording when talking about private LVFS instances
Various guidelines we care about tell us not to use this word unless specified
in documentation, e.g. i2c.
2018-09-05 15:16:42 +01:00
Richard Hughes
1d894f13cc trivial: Move the hwids debug functionality to fwupdtool 2018-08-31 16:39:09 +01:00
Richard Hughes
c0dd011eaf trivial: Fix the DFU A3BU self test failure
The .cab file was re-uploaded with the same version to the LVFS to test the
LVFS::InhibitDownload functionality, but of course the SHA1 hash changed.
2018-08-31 09:58:40 +01:00
Richard Hughes
bda4d81d3d trivial: Allow plugins to add virtual children from quirk files
The example here would be adding virtual i2c devices attached to an existing
USB hub device.
2018-08-28 18:30:00 +01:00
Richard Hughes
6dec401a67 Store the DeviceInstanceId as a GUID in the quirk database
This allows us to match non-DeviceID GUIDs, and also GUIDs we don't know how to
generate.

To make this fully useful, search for device quirks when GUIDs are added.
2018-08-28 18:30:00 +01:00
Richard Hughes
cdb01590e0 nvme: Add a new plugin to update NVMe hardware 2018-08-26 19:42:28 +01:00
Mario Limonciello
df60f69814 uefi: Add special handling for /efi (Closes #680)
This is a similar problem to #627 (which was fixed by 9bdbbc5ca).
Add special handling to allow writing to /efi/EFI
2018-08-22 16:43:20 -05:00
Richard Hughes
7132122387 Implement the systemd recommendations for offline updates
See https://www.freedesktop.org/software/systemd/man/systemd.offline-updates.html
for details.

Reported by Hans de Goede <hdegoede@redhat.com>, many thanks.
2018-08-20 09:58:28 +01:00
Mario Limonciello
9bdbbc5ca8 uefi: Handle /boot properly (Closes: #627)
/boot is a special cased directory when using ProtectSystem=full

Due to this, it's marked read only even if it's listed in ReadWritePaths.

Allow folks to use this for their ESP, but they need to create /boot/EFI
in advance of starting fwupd.
2018-08-09 09:28:50 -05:00
Mario Limonciello
10a4824cb0 trivial: Allow running on an older systemd
Build the path list dynamically based on enabled plugins and use options
that are compatible with older systemd when appropriate
2018-07-10 11:05:10 -05:00
Richard Hughes
f307775675 Add release information for locked devices 2018-06-28 15:51:11 +01:00
Mario Limonciello
cfc22a8b90 uefi: Detect the EFI system partition location at runtime
Check across a list of common EFI system partition locations for a mounted
location before starting fwupd.

This also will cause the plugin to not initialize if the EFI system partition
is not mounted.
2018-06-28 15:51:11 +01:00
Mario Limonciello
4eff978638 trivial: make gcab a build dependency
Fixes #574
2018-06-28 08:54:22 -05:00
Richard Hughes
87fb9ff447 Change the quirk file structure to be more efficient
This pivots the data storage so that the group is used as the preconditon
and the key name is used as the parameter to change. This allows a more natural
data flow, where a new device needs one new group and a few few keys, rather
than multiple groups, each with one key.

This also allows us to remove the key globbing when matching the version format
which is often a source of confusion.

Whilst changing all the quirk files, change the key prefixes to be more familiar
to Windows users (e.g. Hwid -> Smbios, and FuUsbDevice -> DeviceInstanceId)
who have to use the same IDs in Windows Update.

This also allows us to pre-match the desired plugin, rather than calling the
probe() function on each plugin.
2018-06-28 13:32:30 +01:00
Richard Hughes
411fcbde43 trivial: Add a hardware test for the AIAIAI H05 2018-06-28 13:29:37 +01:00
Richard Hughes
e4ad057553 trivial: Add a hardware test for the 8Bitdo SF30 Pro hamepad 2018-06-28 13:29:37 +01:00
Richard Hughes
7e43ed191d trivial: Use the correct metainfo ID in the static metadata
This isn't important, but it makes it easier to understand in gnome-software.
2018-06-27 14:07:27 +01:00
Richard Hughes
0b522aef96 colorhug: Do not require libcolorhug to build
Requiring colord to be built before fwupd makes it hard to build packages.

The HID-based flashing protocol is stable and documented, so there's no need
to use an external library for this now.
2018-06-02 21:43:20 +01:00
Richard Hughes
4be17d1364 Add support for relocating various runtime paths
This allows a snap package to be easily built.

With much help from Mario Limonciello <mario.limonciello@dell.com>, many thanks.
2018-05-31 16:25:22 +01:00
Mario Limonciello
1e0d7d95d9 trivial: don't install installed tests in no daemon mode
Even if running the local tests when we build, we still don't want
to install tests into flatpak/snap.
2018-05-30 13:44:17 -05:00
Mario Limonciello
02c738830d trivial: Don't install bash-completion for fwupdmgr in no daemon build 2018-05-30 13:44:17 -05:00
Richard Hughes
e43f832c5d trivial: Make the daemon functionality optional
This is useful when building just fwupdtool in a flatpak.
2018-05-30 14:45:16 +01:00