Commit Graph

6004 Commits

Author SHA1 Message Date
Richard Hughes
08caad4ed2 trivial: Skip the Fwupd.Client.connect() method for introspection
In hindsight connect() was a poor choice of name as this is hardcoded
as the GObject parent method for signal attachment. It's not actually
required when using the sync API in Python as it's called when required.
2021-07-30 07:24:17 +01:00
Richard Hughes
cbf57ea9d1 trivial: Fix the fwupdtool progress bar to actually work 2021-07-30 07:23:57 +01:00
Richard Hughes
6f7ceb9b35 trivial: Fix the ctrl+c SIGINT signal handling
This was broken since we started using the no-default GMainContext.
2021-07-30 07:23:57 +01:00
Mario Limonciello
192083479e trivial: fix void container build 2021-07-29 19:56:19 -05:00
Richard Hughes
a8d73369f7 trivial: Ignore the NUL suffix to fix loading new firmware
The LVFS is now adding an artificial NUL to the metainfo data to work
around a possible buffer over-read on old fwupd versions. This breaks
new code that reads the XML buffer using xb_builder_source_load_bytes
as GLib then tries to parse the final NUL byte.

As `xmllint` actually ignores the trailing NUL, we should as well.
2021-07-29 20:07:22 +01:00
Richard Hughes
640a3dbfb8 trivial: Add some more debugging when failing the wait-for-replug 2021-07-29 14:04:05 +01:00
Mario Limonciello
9233ceb8d4 trivial: fix void docker container creation 2021-07-28 21:42:54 -05:00
Jerry Zhang
bb5bae8c17 dfu: Add support for more Poly usb devices
Specify the Flags in dfu.qurik for Poly Studio R30, P5 and E70.
2021-07-28 18:46:53 +01:00
Richard Hughes
cb5912c941 trivial: Do not set URIs of zero length 2021-07-28 18:25:50 +01:00
Mario Limonciello
668623dda2 trivial: ci: timeout freebsd CI after 20 minutes
There have been a few jobs that were left running an hour pulling
a file, and that shouldn't block us and waste CI minutes.
2021-07-28 12:02:17 -05:00
Mario Limonciello
1150189948 trivial: Add VOID into contrib/setup 2021-07-28 11:29:44 -05:00
Mario Limonciello
a7cfe67cfe Add VOID CI target 2021-07-28 11:29:44 -05:00
Mario Limonciello
3081dea088 trivial: allow writing to /boot/grub
When running with systemd confinement writing to /boot/grub is needed.
```
fwupd[20533]: /usr/sbin/grub-mkconfig: 269: cannot create /boot/grub/grub.cfg.new: Read-only file system
fwupd[20492]: 03:12:53:0148 GLib                 posix_spawn avoided (fd close requested)
fwupd[20630]: /usr/bin/grub-editenv: error: cannot open `/boot/grub/grubenv': Read-only file system.
```
2021-07-28 17:11:39 +01:00
Mario Limonciello
b87c6dab95 uefi-capsule: Add support for installing UEFI updates from GRUB
Shim has had a hard time with loading updates from arguments in the
most recent release and this isn't the first time that happened.

Give distros and users an escape hatch that will allow using GRUB
instead.
2021-07-28 17:11:39 +01:00
Richard Hughes
3747e245e5 uefi-capsule: Add support for CapsuleOnDisk
Based on a patch by Ilias Apalodimas <ilias.apalodimas@linaro.org>,
many thanks.

Fixes https://github.com/fwupd/fwupd/issues/2900
2021-07-28 17:11:39 +01:00
Richard Hughes
a1f8096c53 lenovo-thinklmi: Remove the faulty test for the update_error
We should be just checking if the thinklmi plugin inhibited the device,
and if we fix the bug where the last_attempt_status value was not being
read on startup then this test will then fail.
2021-07-28 17:11:39 +01:00
Mario Limonciello
bf32c86c17 trivial: symlink in grub configuration too
If GRUB support was activated in uefi plugin, this will be needed
for it to work.
2021-07-28 10:25:47 -05:00
Mario Limonciello
1dcb42747e trivial: contrib/setup: Run helper stuff to set up local dev environment
If running interactive, offer to setup the local system to using
/usr/local more convenient.
2021-07-28 10:25:47 -05:00
Mario Limonciello
0de861086f trivial: contrib/setup: change the interactive check 2021-07-28 10:25:47 -05:00
Mario Limonciello
84c4ae387d trivial: only use systemd env variables if /usr prefix
This helps avoid confusion of /usr/local/etc vs /etc/ when using hand
install on a system that previous had packaged install.
2021-07-28 10:25:47 -05:00
Mario Limonciello
19a2a5791f trivial: let daemon work when configuration missing
By default the daemon start if no configuration is present, but
the first time that an fd is accessed the following error shows up:
```
A maximum read size must be specified
```

This is because the maximum archive size wasn't initialized.
2021-07-28 06:29:09 -05:00
Daniel Campello
2ece14d9e3 Fix battery threshold handling when AC is *not* required 2021-07-27 17:23:15 -06:00
George Popoola
8e4624809c powerd: Enable updates on devices without battery
This adds a condition to the powerd plugin that passes updates on devices
that do not give provide valid battery information or whose battery
information is unknown, such as Chromeboxes, which have no battery to
read.
2021-07-27 15:36:51 -06:00
Richard Hughes
eb215753ee trivial: Add the ability to download files using PkClient for testing 2021-07-27 15:59:17 +01:00
Richard Hughes
3d6a48fad3 Do not save invalid files on LVFS server error
In the event of a 429 response libcurl does not fail curl_easy_perform()
and instead saves the 'Too Many Requests' string as the payload.
This obviously fails the cabinet checksum specified in the metadata.

Move the response code checks to the success branch and also add checks
for the other 4xx and 5xx errors.

Fixes the fwupd half of https://github.com/fwupd/firmware-lenovo-thinkpad/issues/137
2021-07-27 15:59:17 +01:00
Richard Hughes
7bf7b7846b trivial: Fix the header ordering a little more 2021-07-25 08:58:14 +01:00
Mario Limonciello
01f79c0339 trivial: set the reference commit to run style check against on CI 2021-07-24 20:56:26 -05:00
Daniel Campello
987e7d2929 Add contrib/reformat-code.py to pre-commit hooks 2021-07-24 20:56:26 -05:00
Mario Limonciello
bb202244e3 trivial: add clang-format into dependencies 2021-07-24 20:56:26 -05:00
Richard Hughes
affd39f10b Change the style guide to no space before the bracket 2021-07-24 20:56:26 -05:00
Richard Hughes
a75266e701 trivial: Add the missing unversioned clang-format-diff 2021-07-24 16:38:04 +01:00
Richard Hughes
2a78d6d520 trivial: Order the headers in a more normal way 2021-07-24 16:11:57 +01:00
Richard Hughes
b7627e30a7 Set the column limit to 100 chars
80 is just too small on a modern editor, even in portrait mode.
2021-07-24 16:11:57 +01:00
Daniel Campello
af1577342a reformat-code.py: add argumentless mode for formatting diffs 2021-07-23 12:41:22 -06:00
Richard Hughes
dfdecb304c amt: trivial: Fix another critical warning about missing context 2021-07-23 13:57:11 +01:00
Richard Hughes
0efa97229a Automatically clear the update error as required
This is less fragile than patching all the callers.
2021-07-23 13:16:47 +01:00
Richard Hughes
25c93aa7ca redfish: Identify hardware that needs to be updated to the same version
For instance, the EFI driver for a given network card cannot be
different for identical hardware.
2021-07-23 13:16:47 +01:00
Richard Hughes
a8206b2bf6 redfish: Work around a XCC-ism on Lenovo hardware
Only the backup BMC device (which we ignore anyway...) can be updated
by specifying the target ID, the others need an *empty* array so that
XCC can work out what devices need to be processed.
2021-07-23 13:16:47 +01:00
Richard Hughes
90c42f84b3 ata: Ignore the virtual M.2 device
This is updated using Redfish anyway.
2021-07-23 13:16:47 +01:00
Richard Hughes
ae48e02ac2 Do not assume the metainfo file is NUL-terminated
This was only true by accident. We'll need another fix for the LVFS to
add the missing NUL to restore compatibility for older clients.

Fixes https://github.com/fwupd/fwupd/issues/3533
2021-07-23 11:58:56 +01:00
Richard Hughes
5a6dccfa69 trivial: Fix critical warning on 'fwupdtool get-details' 2021-07-23 11:38:02 +01:00
Peter Marheine
464425fb5c SMBIOS: try reading from /sys/class/dmi if direct access fails
The raw SMBIOS tables that Linux exposes in /sys/firmware/dmi
are restricted to being readable by root only. If running as
non-root access is still permitted by fields that have been
pre-parsed by the kernel in /sys/class/dmi, most of which are
world-readable. This allows the daemon to load most HWIDs even
if running as a non-root user, as is done on Chromium OS.
2021-07-23 09:46:45 +01:00
Daniil Lunev
dc483a5110 fu-engine: Preserve NEEDS_REBOOT on successful update
Currently the SUCCESS state overrides reboot-needed, thus making the
devices considered for successive git-upgrades within same boot. The
change preserves the REBOOT_NEEDED state. It also added a missed
'changed' signal, which otherwise would skip updating the persistent
state.

Change-Id: I6f60606f2253d89eab2f5bddceba19d19c4c9c97
2021-07-23 08:45:16 +01:00
George Popoola
f7195f0a22 powerd: Moving ignore power case before method call
This adds a condition that permits updates for devices that don't take
any power conditions into account.
2021-07-22 16:26:54 -06:00
George Popoola
1d8d26d167 powerd: Adding case for devices that ignore power
This adds a condition that permits updates for devices that don't take
any power conditions into account.
2021-07-22 20:57:32 +01:00
Daniel Campello
4b10b1324c trivial: powerd: reformat code with contrib/reformat-code.py 2021-07-22 10:45:45 -06:00
Daniel Campello
3da17e5fbb clang-format: adjust argument packing and consecutive declarations 2021-07-22 10:45:45 -06:00
George Popoola
8baa78b254 Addition of FWUPD_DEVICE_FLAG_REQUIRE_AC Flag to fu-plugin-test.c
This commit is a solution to the issue filed at
https://github.com/fwupd/fwupd/issues/3501. It sets a the AC power flag for the
fake webcam device.
2021-07-22 17:12:01 +01:00
Mario Limonciello
7787ba6df9 Add a .clang-format file and helper tool
It won't automatically be enforced, but should be picked up by editors
that support it (such as VS code + CPP extension)

It doesn't yet follow project style entirely, so more tweaking is
likely needed.

Also add a helper tool for reformatting new files to match project style
2021-07-22 16:38:29 +01:00
Richard Hughes
f2fd6b0717 trivial: Do not save the self test quirk silo to disk
This also speeds up the tests as the amount of pointless i/o is reduced.

Fixes https://github.com/fwupd/fwupd/issues/3522
2021-07-22 12:51:47 +01:00