Commit Graph

1792 Commits

Author SHA1 Message Date
Richard Hughes
3a73c342ba Switch from libsoup to libcurl
The former drags on glib-networking and then gsettings-desktop-schemas, which
add over 5Mb to the minimal IoT and CoreOS composes. Everything already uses
libcurl (even NetworkManager!) and so this is an easy way to reduce image size.
2020-11-19 19:39:37 +00:00
Richard Hughes
d483fcedd5 trivial: Fix a logic thinko to unbreak switch-branch
We still want to return TRUE, rather than falling through as if the requirement
type was unknown.

Fixes https://github.com/fwupd/fwupd/issues/2578
2020-11-13 16:21:57 +00:00
Mario Limonciello
56d816a53b Fall back to FAT32 internal partitions for detecting ESP
Fixes #2576
2020-11-12 13:42:21 -06:00
Mario Limonciello
bd60de12be Add a flag to indicate if packages are supported
Anyone can easily add this, but it makes it clearer that by default hand
build, snap, and flatpak are not checked by anyone.
2020-11-11 14:34:59 -06:00
Mario Limonciello
cceeb75c7b Add a section to man page on scripting
Fixes: #2572
2020-11-11 12:50:13 -06:00
Jan Tojnar
a8b3f9ed57 trivial: fu-engine: skip empty cmdline commands
g_strsplit returns an empty vector for an empty string,
which leads to assertion in g_strv_contains when /proc/cmdline
ends with a space.
2020-11-07 19:51:07 +00:00
Richard Hughes
3e445ece04 Allow components to set the icon from the metadata
In this case, we want to set the generic ESRT entry to have the icon 'battery'.
2020-11-06 16:57:21 +00:00
Richard Hughes
0658ae184b trivial: Remove traces of the UA HSI suffixes 2020-11-06 09:57:03 +00:00
Richard Hughes
41a1650c2a Remove HSI update and attestation suffixes
The logic here is that the attestation is more than just the PCR0 value, and
multiple device firmware (such as EC, ME, etc.) needs to be included to validate
the system.

By the same logic, updates for the system firmware do not tell the whole story,
and confuse HSI as a specification. Remove them.
2020-11-05 15:12:12 +00:00
Richard Hughes
bf43978dfa Ignore an invalid vendor-id when adding releases for display
The idea for a missing vendor-id would be that the LVFS sets the value
`NEVER_GOING_TO_MATCH` which is shown (along with the correct value) when the
user tries to **install** the firmware.
In 1.5.0 we correctly switched to filtering the devices by GUID and *then*
checking requirements before showing to the user.

In the missing vendor-id case the the poor ODM does not know why the device is
not showing up until they run the daemon in --verbose mode.

Relax the vendor-id checks when adding releases to devices, but of course leave
them in place for installing firmware. The ignore-vid-pid flag is not added
from `Install(a{sv})` and so this stays the same as before.
2020-11-04 16:14:00 +00:00
Richard Hughes
a053134504 Notify the service manager when idle-quitting
This makes sure that the main process won't get SIGTERM on shutdown.

Inspired from a patch by Jonathan Kang <jonathankang@gnome.org>
2020-11-04 14:45:59 +00:00
Richard Hughes
203ed841da trivial: Codespell fixes 2020-11-02 14:26:26 +00:00
Richard Hughes
1df9b82046 Show a link to discover more information about a specific plugin failure
Fixes bugs like https://github.com/fwupd/fwupd/issues/2531
2020-11-02 10:21:57 +00:00
exploide
0c10507219 trivial: fix description of unblock-firmware 2020-11-01 20:00:23 +00:00
Richard Hughes
e98845d6cf Revert "Fix regression when filtering different priorities"
This reverts commit f630678b6f.
2020-10-29 14:01:25 +00:00
Mario Limonciello
6fc11ec089 trivial: fu-main: adjust polkit install flow
The authentication happens earlier in `fu_main_install_with_helper`
so no need to make recursive calls from `fu_main_authorize_install_cb`
into `fu_main_authorize_install_queue`.

Just simplify the code in the non-polkit case.
2020-10-26 10:05:41 -05:00
Richard Hughes
f630678b6f Fix regression when filtering different priorities
We need to check if the device is in the remove timeout before unconditionally
replacing a device on insert.

Fixes https://github.com/fwupd/fwupd/issues/2510
2020-10-26 08:43:27 +00:00
Mario Limonciello
13d077353b Revert "fu-engine: Set a device when checking requirements for fu_engine_get_result_from_component"
This reverts commit e4d52866d1.
2020-10-24 07:07:26 +01:00
Mario Limonciello
381c27ca44 trivial: Split check for signed metadata when no polkit
Checking this requirement at daemon startup meant that trust was
evaluated before releases could actually be checked.

It's only important to check at install time.
2020-10-24 07:07:26 +01:00
Mario Limonciello
e4d52866d1 fu-engine: Set a device when checking requirements for fu_engine_get_result_from_component
The trust flags are only checked if check_requirements is called, which
only happens when a device has been set.
2020-10-23 06:59:08 +01:00
Richard Hughes
cb0e614027 trivial: Do not list unsupported devices in switch-branch 2020-10-22 20:05:44 +01:00
Mario Limonciello
02f2cc311e Add switch-branch support to fwupdtool 2020-10-21 12:00:55 -05:00
Mario Limonciello
7db8e88d98 When PK is disabled only allow trusted payloads
Loosen the requirement of the user ID to match root for the following
actions:
* Install release
* Activate firmware

For install release action, reject CAB files not signed by LVFS
2020-10-20 15:24:08 -05:00
Richard Hughes
d7e3f09cbf trivial: Show what the device does support if the protocol match fails 2020-10-20 18:21:04 +01:00
Mario Limonciello
c3a8173a12 Show an error when a plugin is missing dependencies (Fixes: #1526)
```
$ sudo mv /usr/lib/x86_64-linux-gnu/libtss2-esys.so.0.0.0 /usr/lib/x86_64-linux-gnu/libtss2-esys.so.0.0.0.renamed
$ sudo fwupdtool get-devices --plugins=uefi
14:15:48:0735 FuEngine             cannot load: failed to open plugin /usr/local/lib/x86_64-linux-gnu/fwupd-plugins-3/libfu_plugin_uefi.so: libtss2-esys.so.0: cannot open shared object file: No such file or directory
Loading…                 [-                                      ]14:15:48:0753 FuEngine             failed to update history database: device ID b6c08fb9e5384d9d101853cc1ca20cf0ce2df2e2 was not found
Loading…                 [***************************************]
WARNING: Plugin depdendencies missing
No detected devices
```
2020-10-20 10:57:21 -05:00
Richard Hughes
43053d2a13 Do not include fullstops in the --help output
Fixes https://github.com/fwupd/fwupd/issues/2487
2020-10-19 00:43:49 +01:00
Richard Hughes
377feea500 Only show the HSI for sane chassis types
Fixes https://github.com/fwupd/fwupd/issues/2440
2020-10-18 20:24:10 +01:00
Richard Hughes
f2a3e01f96 Simplify fu_device_list_wait_for_replug() for sanity
Rather than using a recursive GMainLoop, just run a single iteration of the
mainloop every 1ms while we're waiting.

This simplifies the device lifecycle dramatically as we don't have to worry
about reentrant removals. It's also a lot simpler to debug as we know the only
way to return is the timeout elapsing or FWUPD_DEVICE_FLAG_WAIT_FOR_REPLUG being
unset.

If multiple devices got removed and we're waiting for one to re-appear, also
wait for all devices to come back before returning to the main loop.

In the worst case, this causes the device list to wait the full removal_delay
for the device rather than returning when the first device matches. This allows
us to simplify the hub update when we reboot the entire device and various
devices from different plugins come back in an unpredictable order.

Fixes the other half of https://github.com/fwupd/fwupd/issues/2376
2020-10-18 07:35:46 +01:00
Richard Hughes
84781f41cf trivial: Fix a segfault when installing without PolicyKit 2020-10-16 15:25:27 +01:00
Richard Hughes
65698015ae Do not fix up the version on post-update mismatch
We already set a update error if the fu_common_vercmp_full() fails to match,
and trying to do anything else would just be papering over the issue.
2020-10-16 14:02:10 +01:00
Daniel Campello
edab096c64 trivial: Fix build error on build=standalone and polkit=true
This fixes error introduced by 11b71f4978
2020-10-15 14:05:23 -06:00
Richard Hughes
1c62adec69 Get the list of unique branch names for 'switch-branch' 2020-10-15 18:05:29 +01:00
Richard Hughes
88fdc59330 Set _HAS_MULTIPLE_BRANCHES when release differs from device
Enable switch-branch any time a branch other than the default exists.

Based on a patch by Evan Lojewski <github@meklort.com>, many thanks.
2020-10-15 18:05:29 +01:00
Mario Limonciello
11b71f4978 Offer to compile daemon without polkit support
Based on a patch from Daniel Campello at
https://chromium-review.googlesource.com/c/chromiumos/third_party/fwupd/+/2354521
2020-10-14 07:58:16 -05:00
Richard Hughes
7bcb8d4385 Export FwupdPlugin so we can convey enumerated system errors to the end user
For instance, we can tell the user that UEFI UpdateCapsule is disabled in the
system firmware, or that efivarfs is not mounted. This is much better than
creating "dummy" devices which are really just hacks around the problem because
no better API existed. THe dummy devices cause as many problems as they solve.

Plugins have to set FWUPD_PLUGIN_FLAG_USER_WARNING if a warning should be shown
to the user, and only one warning will be shown of each failure type.

It is expected that GUI clients like gnome-software and gnome-firmware would use
this API to notify the user the localized message for why firmware updates are
not being shown.

Fixes https://github.com/fwupd/fwupd/issues/2456
2020-10-13 15:56:49 +01:00
Érico Rolim
0651aeef24 Fix header names.
- <sys/poll.h> should be <poll.h>
- <sys/errno.h> should be <errno.h>
2020-10-10 12:33:56 +01:00
Richard Hughes
f4c206d319 libfwupd: Do not export the HSI AppStream IDs
The clients don't need to know this, and exporting them means we paint-ourselves
into a corner if we want to change the 'namespace' or how HSI actually works.
2020-10-08 16:36:56 +01:00
Richard Hughes
f083af3e71 Download the metadata first when using 'fwupdtool refresh'
This allows us to use fwupd_remote_load_signature_bytes() to enable all the
JCat mirror-fix features.
2020-10-07 15:38:08 +01:00
Richard Hughes
738e3f01e1 trivial: Ensure config.h is included in all C files 2020-10-07 13:46:33 +01:00
Richard Hughes
6450d0deb4 Add FwupdInstallFlags of _IGNORE_CHECKSUM, _IGNORE_VID_PID and _IGNORE_POWER
The FWUPD_INSTALL_FLAG_FORCE flag has really unclear semantics, and ignoring a
file CRC, checksum or model ID should only be done when using fwupdtool actually
debugging a plugin or firmware parser.

Use the existing --force flag when we want a "gentle nudge" like reuploading
previously processed reports.
2020-10-07 13:15:09 +01:00
Richard Hughes
5bbf013879 Add a --allow-branch-switch to fwupdmgr
This allows us to turn off the tests like version format differences and
checking for downgrades.
2020-10-07 13:15:09 +01:00
Mario Limonciello
e8946a74d1 fwupdtool/fwupdmgr: make return code different for get-updates with no updates
This allows other tools to depend on it when checking for updates rather than
reading the output.
2020-10-06 13:34:41 -05:00
Richard Hughes
26e57dd4e2 Do not auto-detach when dumping firmware
This allows us to handle this in the plugin, which might mean detaching the
*proxy* device. It's also very important as a few plugins reboot the device
in ->attach() to get the new firmware version, which isn't required for a dump.

This partially reverts a58510b246 and does the
detach and attach in the few plugins where actually required.
2020-10-05 19:44:44 +01:00
Richard Hughes
2428147659 trivial: Show a single line for each plugin state at startup 2020-10-05 15:42:00 +01:00
Richard Hughes
9ed4d47040 trivial: Remove more debugging when disabling plugins
We already have a list of enabled and disabled plugins, don't tell the user
hundreds of times that 'optionrom is not found'.
2020-10-05 15:42:00 +01:00
Mario Limonciello
933e43005f trivial: fu-engine: don't show information for disabled remotes 2020-10-03 06:58:13 -05:00
Richard Hughes
f64e7a9cb4 trivial: Fix typo when setting _HAS_MULTIPLE_BRANCHES
Fixes https://github.com/fwupd/fwupd/issues/2439
2020-10-01 18:05:36 +01:00
Richard Hughes
521c2e2cd2 trivial: Do not print 'bare' GError strings
Give them come context so we know where they came from...
2020-10-01 16:39:10 +01:00
Richard Hughes
f4052b53f4 trivial: Do not warn about the same missing remote more than once
Removes 4 instances of 'ignoring unfound remote fwupd' at startup.
2020-10-01 16:39:10 +01:00
Richard Hughes
61a2dbad13 trivial: Do not inform if no fwupd::ReleaseFlags were set
This is never set in the AppStream metadata, and means that every call to
fu_engine_ensure_device_supported() at startup does not generate 16x debugs.

For cab archives we know if the archive was unsigned as we show the flags in
the to_string() output.
2020-10-01 16:39:10 +01:00