![]() 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. |
||
---|---|---|
.. | ||
acpi-dmar | ||
acpi-facp | ||
acpi-phat | ||
altos | ||
amt | ||
analogix | ||
ata | ||
bcm57xx | ||
bios | ||
ccgx | ||
colorhug | ||
cpu | ||
cros-ec | ||
dell | ||
dell-dock | ||
dell-esrt | ||
dfu | ||
dfu-csr | ||
ebitdo | ||
elantp | ||
emmc | ||
ep963x | ||
fastboot | ||
flashrom | ||
fresco-pd | ||
goodix-moc | ||
hailuck | ||
intel-spi | ||
iommu | ||
jabra | ||
lenovo-thinklmi | ||
linux-lockdown | ||
linux-sleep | ||
linux-swap | ||
linux-tainted | ||
logind | ||
logitech-hidpp | ||
modem-manager | ||
msr | ||
nitrokey | ||
nvme | ||
optionrom | ||
parade-lspcon | ||
pci-bcr | ||
pci-mei | ||
pixart-rf | ||
platform-integrity | ||
powerd | ||
realtek-mst | ||
redfish | ||
rts54hid | ||
rts54hub | ||
solokey | ||
steelseries | ||
superio | ||
synaptics-cxaudio | ||
synaptics-mst | ||
synaptics-prometheus | ||
synaptics-rmi | ||
system76-launch | ||
test | ||
thelio-io | ||
thunderbolt | ||
tpm | ||
tpm-eventlog | ||
uefi-capsule | ||
uefi-dbx | ||
uefi-pk | ||
uefi-recovery | ||
upower | ||
vli | ||
wacom-raw | ||
wacom-usb | ||
meson.build | ||
README.md |
Adding a new plugin
An extensible architecture allows for providing new plugin types (for reading and writing different firmware) as well as ways quirk their behavior.
You can find more information about the architecture in the developers section of the fwupd website.
You can use the fwupd developer documentation to assist with APIs available to write the plugin.
If you have a firmware specification and would like to see support in this project, please file an issue and share the spec. Patches are also welcome.
We will not accept plugins that upgrade hardware using a proprietary Linux executable, proprietary UEFI executable, proprietary library, or DBus interface.
Plugin interaction
Some plugins may be able to influence the behavior of other plugins. This includes things like one plugin turning on a device, or providing missing metadata to another plugin.
The ABI for these interactions is defined in: https://github.com/fwupd/fwupd/blob/master/src/fu-device-metadata.h
All interactions between plugins should have the interface defined in that file.