Commit Graph

18 Commits

Author SHA1 Message Date
Richard Hughes
3457715749 Allow desktop software to inhibit the system to prevent all updates
On edge hardware a process may want to disable firmware updates as it might be
a bad time to allow an upgrade.
2023-02-23 13:04:10 -06:00
Richard Hughes
5d6cb83d1c Add fu_context_remove_flag() for future use 2023-01-22 07:35:48 +00:00
Richard Hughes
0e381a8666 trivial: Store the chassis kind in the context 2023-01-16 17:49:57 +00:00
Richard Hughes
c95355b498 trivial: Add a GError parameter to fu_context_get_smbios_string()
This matches the behaviour of fu_smbios_get_string() and was probably accidental.
2023-01-16 14:05:48 +00:00
Richard Hughes
cf4f34572b Add fu_context_get_fdt() to get the Flat Device Tree
This is needed because multiple plugins will soon be consuming the system FDT,
and we don't want to either parse this multiple times, or duplicate the loading
logic.
2023-01-11 16:25:26 +00:00
Richard Hughes
d1c6acd752 trivial: Return an error from fu_context_get_smbios_data() 2022-10-24 13:58:00 +01:00
Richard Hughes
d629240a83 trivial: Remove the padding from FuXxxClass structs
The library is now tied to the current fwupd version, so we can break API.
2022-09-28 14:42:04 +01:00
Richard Hughes
5d38e0aeea Move the getting the ESP to the context
We now have two plugins getting the ESP values, and we only allow hardcoding
the ESP in uefi_capsule.conf.

Make all this a lot simpler by moving the ESP+BDP code to `FuContext`, which
also means we can handle the override (via the config file) in the engine,
and the override (in the command line tools) using the same mechanism.

Also, automate the migration of the `OverrideESPMountPoint` -> `EspLocation`
when loading the engine.

Fixes https://github.com/fwupd/fwupd/issues/5042
2022-09-22 14:31:06 +01:00
Richard Hughes
bfebede490 Add support for platform capability descriptors so devices can set quirks
This feature adds support for platform capability BOS descriptors which allows
the device itself to ship quirk data.

Use `sudo fwupdtool get-devices --save-backends=FILENAME` to save fake backend
devices to a file. This allows easy creation of self tests that do not require
physical hardware.
2022-09-13 12:07:35 +01:00
Mario Limonciello
b7b0ce533d trivial: Unify ambiguity between bios-attrs and bios-settings
These are currently used interchangeably since there was indecisiveness
which to use as the feature was being developed.

As outward facing it will be named with "settings", change all uses
in the code to match this.
2022-08-24 07:20:01 -05:00
Mario Limonciello
5ded4f44fe Add support for reading and writing firmware attributes
This support is comprehensive:
 * Client library support
 * Daemon support
 * plugin support
 * Client tool support (with new commands)
2022-07-28 17:30:57 -05:00
Richard Hughes
f76880182f Do not allow UEFI updates when the lid is closed
Most vendors do not mirror the firmware update to an external display,
and some don't behave correctly when the lid is shut and the machine is
docked. Add this quirk just for Lenovo for now.

Fixes https://github.com/fwupd/firmware-lenovo/issues/181
2021-12-29 19:18:26 +00:00
Richard Hughes
1a077289bc Speed up daemon startup by 15%
During my fwupd startup fu_plugin_has_custom_flag gets called 21 times
which causes all HWIDs to be enumerated with 346 calls to the quite
expensive fu_context_lookup_quirk_by_id() function.

Move the flag to a private hashset and enumerate the HWIDs only during
startup. There's nothing plugin specific about them anyway...
2021-11-03 07:14:37 +00:00
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Richard Hughes
dfaae2e837 Move amdgpu safety check into the plugin
There are now multiple plugins using drm_dp_aux_dev interface which
may potentially be combined with an amdgpu. Prevent exercising this
interface with any plugin using DP aux unless a new enough kernel is
installed.
2021-07-04 17:49:36 +01:00
Richard Hughes
e9cc87d740 trivial: Add some more missing GObjectIntrospection markup 2021-05-11 16:55:53 +01:00
Richard Hughes
4d76d18d35 Set the system battery state and level on the FuContext shared state
This allows plugins to set the battery power state of the *machine* which means
we can automatically inhibit devices with FWUPD_DEVICE_FLAG_REQUIRE_AC set.

It also allows to set the BatteryThreshold to 25% for Lenovo hardware, and we
can override other vendors with further quirks as required.

Fixes https://github.com/fwupd/fwupd/issues/3084
2021-04-07 08:05:15 +01:00
Richard Hughes
b333e0045c Split out a shared system context
There is a lot of code in fwupd that just assigns a shared object type to
a FuPlugin, and then for each device on that plugin assigns that same shared
object to each FuDevice.

Rather than proxy several kinds of information stores over two different levels
of abstraction create a 'context' which contains the shared *system* state
between the daemon, the plugins and the daemon.

This will allow us to hold other per-machine state in the future, for instance
the system battery level or AC state.
2021-04-01 21:11:29 +01:00