Commit Graph

2402 Commits

Author SHA1 Message Date
Mario Limonciello
4ff6a6dedb trivial: flashrom: Add SPDX license header
Clarify that the license was intended to be LGPL2.1 when the project
adjusted and this source file was just missed as well.
2021-08-08 14:43:21 -05:00
Jeremy Bopp
3604b897b5 Fix detection of 8Bitdo wireless usb adapter
Limits copying the get version response payload to the size of the out buffer.
Devices that return a larger payload pack the necessary version information at
the beginning of the payload.

Fixes: #1661
2021-08-07 21:51:26 -05:00
Richard Hughes
ad24f1623d redfish: Also conflict with the bios plugin when required 2021-08-06 20:51:22 +01:00
Richard Hughes
d4a4362621 redfish: Fix writing large firmware files 2021-08-06 20:51:22 +01:00
Richard Hughes
f5c0eab25d redfish: Add a per-vendor quirk to set all devices as requiring a reboot
Some versions of XCC do not send the Base.1.10.ResetRequired message.
2021-08-06 20:51:22 +01:00
Richard Hughes
a5a978b3f6 Rename some confusing API
More than one person has asked about 'why call fu_plugin_update() for a
reinstall or downgrade' and I didn't have a very good answer.

The plugin API is not officially stable, and we should fix things to be
less confusing. Use the same verbs as the FuDevice vfuncs instead.
2021-08-06 19:49:53 +01:00
Peter Marheine
059f56e6ce realtek-mst: add support for RTD2141B
The RTD2141B has the same update protocol as RTD2142, but the Chromebook
targets that use it require us to find the drm_dp_aux_dev i2c channel
differently because the AMD display driver doesn't give each output a
unique name in sysfs, so it must be found by walking sysfs from the drm
device representing an output.

Change-Id: Icb6c1a40b8a62af72808d68a0a69555810abc272
2021-08-06 11:00:35 +10:00
Ricardo Cañuelo
7b18e593ea trivial: Ignore NUL chars in the device version
Signed-off-by: Richard Hughes <richard@hughsie.com>
2021-08-05 14:22:15 +01:00
Richard Hughes
2815a30274 elantp: Fix a crash when starting the daemon
FuElantpHidDevice derives from FuUdevDevice, not FuUsbDevice -- and the
former does not define a class->setup vfunc.

Fixes https://github.com/fwupd/fwupd/issues/3548
2021-08-05 12:54:17 +01:00
Richard Hughes
068cff6111 test: Allow setting plugin parameters using an environment variable
Based on a patch by Twain Byrnes <binarynewts@google.com>, many thanks.

Use this to test:

sudo FWUPD_TEST_PLUGIN_XML="<config><delay_decompress_ms>100</delay_decompress_ms></config>" \
./src/fwupdtool --plugins test get-devices -v
2021-08-05 08:12:58 +01:00
Thomas Deutschmann
9e4d1bc73b dell-dock plugin requires gusb
Closes: https://github.com/fwupd/fwupd/issues/3598
2021-08-04 18:19:09 +01:00
Thomas Deutschmann
bd6adc8beb modem-manager: Fix compiling with old versions of libxmlb
Closes: https://github.com/fwupd/fwupd/issues/3600
2021-08-04 18:16:18 +01:00
Jerry Zhang
0776918dd8 dfu: Add support for Poly Studio P21 usb device
Specify the Flags in dfu.qurik for Poly Studio P21's camera.
2021-08-04 17:27:11 +01:00
Twain Byrnes
eed815331c Inhibit system suspend during update
Create and destroy /run/lock/power_override/fwupd.lock.
This file will hold the contents of getpid (), which will
stop the device from being suspended while the file exists.
The file will be created and written just before the
update is put into motion and be destroyed once the update
finishes, or upon restart in case of catastrophic failure.

Change-Id: If8dd17b0358862a842c9589e11ed0de12d852797
2021-08-04 08:33:57 +01:00
8BitDo
c381b334eb 8bitdo: Fix N30 Pro 2 install duration 2021-08-03 18:35:07 +01:00
Richard Hughes
27fbab1990 redfish: Disable the uefi_capsule plugin if coldplug succeeded
We don't want to show the big warning about the missing ESRT on server
hardware that is managed by a BMC:

    WARNING: UEFI capsule updates not available or enabled in firmware setup
      See https://github.com/fwupd/fwupd/wiki/PluginFlag:capsules-unsupported for more information.
2021-08-03 13:10:10 +01:00
Richard Hughes
6c2535a71f uefi-capsule: Disable all UX capsules for Lenovo hardware
Applying updates to my new P1G3:

 * schedule the update in fwupd
 * boot into the BootNext
 * apply the capsule with RT->UpdateCapsule
 * reboot with RT->ResetSystem

Except the firmware updater EFI binary then wasn't running. The ESRT
last_attempt_status comes back as Success on the reboot.

Disabling the UX capsule made the update apply correctly each and every
time. Until we can work out what models are affected, use a per-vendor
quirk to avoid delaying the release.
2021-08-02 14:26:45 +01:00
Richard Hughes
f12068d2e9 Allow devices to only accept version upgrades
See https://github.com/fwupd/fwupd/issues/3554 for details.
2021-07-31 20:41:21 +01:00
Mario Limonciello
143efb9d88 trivial: only build powerd on new enough glib
snap has an older glib and the plugin fails to compile.
2021-07-30 20:25:46 -05:00
George Popoola
1a58398afb powerd: Creating recurring powerd callback
This CL moves the battery information retrieval into a new function,
called "fu_plugin_powerd_callback()", which returns the information in a
struct.

This information is then used in fu_plugin_update_prepare() for battery
checks. There is also a g_timeout_add() function being created in
fu_plugin_startup() in order to enable the plugin to repeatedly send a method
call to powerd.

fu_plugin_update_prepare is removed as its functionality is now handled
by src/fu-engine.c
2021-07-30 10:58:40 -06:00
Daniel Campello
40295c673d trival: reformat fu-plugin-powerd.c 2021-07-30 10:58:40 -06:00
Richard Hughes
32997b10f7 realtek-mst: Add a warning that extreme caution should be used 2021-07-30 09:26:43 +01: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
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
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
dfdecb304c amt: trivial: Fix another critical warning about missing context 2021-07-23 13:57:11 +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
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
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
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
Richard Hughes
6b238b2daa redfish: Automatically connect the BMC network interface at startup
Some distributions like RHEL change the default to not autoconnect
ethernet devices. This breaks connecting to the SMBIOS-defined BMC
adapter which means all the reads fail after a 60s timemout.

Autoconnect the internal USB ethernet adapter so we can use Redfish
without user action.
2021-07-22 12:48:22 +01:00
Richard Hughes
6b151a6acb redfish: Fix parsing USB/PCI network VID/PIDs 2021-07-22 12:48:22 +01:00
Richard Hughes
70a64190cb redfish: Limit requests to 30s max
The default in new libcurl versions is 'forever' which isn't useful for
a shared daemon.
2021-07-22 12:48:22 +01:00
Richard Hughes
ecd4c5431b redfish: Fix the docs to match reality 2021-07-22 12:48:22 +01:00
Richard Hughes
9f808bdbc0 uefi-capsule: Convert two metadata booleans to private flags 2021-07-22 12:47:54 +01:00
Richard Hughes
305e69f73b uefi-capsule: Rename the plugin flag to match the device flag 2021-07-22 12:47:54 +01:00
Richard Hughes
7b40c111c7 uefi-capsule: Move the results capsule to the FuDevice subclass
This allows us to create subclasses of FuUefiDevice that use different
ways to report update success.
2021-07-22 12:47:54 +01:00
Richard Hughes
d562c007a3 update-capsule: Move FuUefiDevice to a derivable for future use 2021-07-22 12:47:54 +01:00
Daniel Campello
924aa5a44b upower: Move battery_threshold setting to fu-engine
Change-Id: I63b4735bbaaf6f2cbdfb3f73b70b1fd4b3087a70
2021-07-21 21:53:57 +01:00
Richard Hughes
0920c44088 powerd: Use the system-defined battery threshold 2021-07-21 09:36:11 -06:00
Richard Hughes
56bf223a0f powerd: trivial style fixups 2021-07-21 09:36:11 -06:00
George Popoola
357bfd07da powerd: DBus Connection and Parsing
A series of changes are made to the powerd skeleton
plugin in order to reach two goals: ensuring that it handles cases correctly, given certain
information about the battery and/or certain return types and that it
successfully retrieves battery information from powerd to be used later.

Logic is then added to ensure updates are only performed
when that battery level is at or above the minimum threshold.
Then logic is added that checks if the device being updating requires
AC power. Along with this, specific
error statements are added for each scenario where an update is blocked.

To address the next goal, within fu_plugin_startup(), a GDBus connection
is established. However, instead of a direct connection to
powerd, the connection is changed to link to the general system bus with
g_bus_get_sync(). From there, a proxy is created to represent the
connection to powerd. A test call is made for the name of the service that the
proxy represents to check for successful communication.

Then, in fu_plugin_update_prepare(), the existing proxy is called and in the call,
the "GetBatteryState" is passed to make a method call method. The
response is filled into a GVariant, whose entries are initialized in new variables to use
for battery checks. And checks are added to make sure every step was
successful.
2021-07-19 13:40:11 -07:00