fwupd/plugins/uefi-capsule
Richard Hughes 6e34a90a12 trivial: Add FuProgress to fu_context_load_hwinfo()
TIL: fu_bios_settings_setup() takes over 50ms (10%!) at startup.
2023-01-30 14:47:44 +00:00
..
tests Add a test UEFI device that can be used to test capsules 2021-11-02 08:09:25 +00:00
fu-self-test.c trivial: set firwmare attributes class directory for all tests 2022-07-28 17:30:57 -05:00
fu-uefi-backend-freebsd.c Remove the 'common' prefix when parsing version numbers 2022-06-14 14:36:52 -05:00
fu-uefi-backend-freebsd.h uefi-capsule: Add support for CapsuleOnDisk 2021-07-28 17:11:39 +01:00
fu-uefi-backend-linux.c trivial: Return an error from fu_context_get_smbios_data() 2022-10-24 13:58:00 +01:00
fu-uefi-backend-linux.h uefi-capsule: Add support for CapsuleOnDisk 2021-07-28 17:11:39 +01:00
fu-uefi-backend.c Allow plugins and backends to print debugging information to the console 2022-07-28 16:10:06 +01:00
fu-uefi-backend.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-bgrt.c Split out the path helpers to a new source file 2022-06-14 14:36:52 -05:00
fu-uefi-bgrt.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-bootmgr.c uefi-capsule: Fix a tiny memory leak when falling back to the app path 2022-07-11 08:29:37 +01:00
fu-uefi-bootmgr.h Be smarter and include less header files per source file 2022-06-14 14:36:52 -05:00
fu-uefi-capsule-plugin.c Lots of spelling fixes 2022-12-29 13:57:31 +00:00
fu-uefi-capsule-plugin.h Build many more plugins as builtin 2022-09-28 17:01:23 +01:00
fu-uefi-cod-device.c Remove fu_strtoull_full() 2022-06-14 14:36:52 -05:00
fu-uefi-cod-device.h trivial: Remove the class structs for types that use G_DECLARE_FINAL_TYPE 2022-05-21 12:19:50 +01:00
fu-uefi-common.c uefi-capsule: Try harder when trying to find the default ESP 2022-10-07 15:11:38 +01:00
fu-uefi-common.h uefi-capsule: Try harder when trying to find the default ESP 2022-10-07 15:11:38 +01:00
fu-uefi-device.c trivial: Add new convenience API to make plugins simpler 2022-12-20 20:54:12 +00:00
fu-uefi-device.h uefi-capsule: Add a private flag for devices that never want a header 2022-02-21 22:52:45 -06:00
fu-uefi-devpath.c Split out the dump helpers to a new source file 2022-06-14 14:36:52 -05:00
fu-uefi-devpath.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-grub-device.c Split out the path helpers to a new source file 2022-06-14 14:36:52 -05:00
fu-uefi-grub-device.h trivial: Remove the class structs for types that use G_DECLARE_FINAL_TYPE 2022-05-21 12:19:50 +01:00
fu-uefi-nvram-device.c Split out the path helpers to a new source file 2022-06-14 14:36:52 -05:00
fu-uefi-nvram-device.h trivial: Remove the class structs for types that use G_DECLARE_FINAL_TYPE 2022-05-21 12:19:50 +01:00
fu-uefi-tool.c trivial: Add FuProgress to fu_context_load_hwinfo() 2023-01-30 14:47:44 +00:00
fu-uefi-update-info.c Use the GLib functions to convert to UCS2 2022-04-07 15:41:09 +01:00
fu-uefi-update-info.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fwupd.grub.conf.in uefi-capsule: Do not call grub2-probe without arguments 2023-01-18 10:56:26 -06:00
fwupdate.1 trivial: Typofix fwupdate(1) NAME 2022-05-27 08:54:11 -05:00
make-images.py trivial: Fix capsule image generation for broken locales 2022-11-09 14:02:39 +00:00
meson.build Use 'check' when calling run_command() to avoid a warning 2022-12-29 15:49:02 +00:00
README.md Include the plugin README text in the generated docs 2023-01-10 14:58:30 +00:00
uefi_capsule.conf Move the getting the ESP to the context 2022-09-22 14:31:06 +01:00
uefi-capsule.quirk trivial: Add HP Dev One quirk with no-ux-capsule flag 2022-04-01 11:18:12 -05:00

title: Plugin: UEFI Capsule

Introduction

The Unified Extensible Firmware Interface (UEFI) is a specification that defines the software interface between an OS and platform firmware. With the UpdateCapsule boot service it can be used to update system firmware.

If you don't want or need this functionality you can use the -Dplugin_uefi_capsule=disabled option.

When this plugin is enabled, the companion UEFI binary may also be built from the fwupd-efi project if not already present on the filesystem. This behavior can be overridden using the meson option -Defi_binary=false.

For this companion binary to work with secure boot, it will need to be signed by an authority trusted with shim and/or the host environment.

Lenovo Specific Behavior

On Lenovo hardware only the boot label is set to Linux-Firmware-Updater rather than "Linux Firmware Updater" (with spaces) due to long-fixed EFI boot manager bugs. Many users will have these old BIOS versions installed and so we use the use-legacy-bootmgr-desc quirk to use the safe name.

On some Lenovo hardware only one capsule is installable due to possible problems with the UpdateCapsule coalesce operation. As soon as one UEFI device has been scheduled for update the other UEFI devices found in the ESRT will be marked as updatable-hidden rather than updatable. Rebooting will restore them so they can be updated on next OS boot.

Firmware Format

The daemon will decompress the cabinet archive and extract a firmware blob in EFI capsule file format.

See the UEFI specification for details.

This plugin supports the following protocol ID:

  • org.uefi.capsule

Update Behavior

Capsule update on-disk

Described in UEFI specification § 8.5.5 - Delivery of Capsules via file on Mass Storage device.

If the firmware supports this, it will be the preferred method of updating on aarch64 platforms. You can explicitly disable it by by modifying DisableCapsuleUpdateOnDisk in /etc/fwupd/uefi_capsule.conf.

Several models with Insyde firmware have been released where OsIndications advertises support for CoD, but it simply does not work. For this reasons the CoD support is only available by opt-in for x86_64 devices, and can be specified using the uefi-allow-cod plugin flag for the appropriate HwID.

The spec expects runtime SetVariable to be available in order to enable this feature, we need to set EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED in OsIndications variable to trigger processing of submitted capsule on next reboot. However some firmware implementations (e.g U-Boot), can't set the variable at runtime, but ignore the variable in next reboot and apply the capsule anyway.

The directory \EFI\UpdateCapsule is checked for capsules only within the EFI system partition on the device specified in the active boot option determine by reference to BootNext variable or BootOrder variable processing. Since setting BootNext, for capsule update on-disk, is not yet implemented, the only available option is place the \EFI\UpdateCapsule within the ESP partition indicated by the current BootOrder. Note that this will be always needed if your firmware doesn't support SetVariable at runtime (even if BootNext functionality is added).

Runtime capsule updates

The firmware is deployed when the OS is running, but it is only written when the system has been restarted and the fwupd*.efi binary has been run. To achieve this fwupd sets up the EFI BootNext variable, creating the new boot entry if required.

GUID Generation

These devices use the UEFI GUID as provided in the ESRT. Additionally, for the system device the main-system-firmware GUID is also added.

For compatibility with Windows 10, the plugin also adds GUIDs of the form UEFI\RES_{$(esrt)}.

Vendor ID Security

The vendor ID is set from the BIOS vendor, for example DMI:LENOVO for all devices that are not marked as supporting Firmware Management Protocol. For FMP device no vendor ID is set.

UEFI Unlock Support

On some Dell systems it is possible to turn on and off UEFI capsule support from within the BIOS. This functionality can also be adjusted from within the OS by fwupd. This requires compiling with libsmbios support.

When fwupd has been compiled with this support you will be able to enable UEFI support on the device by using the unlock command.

Custom EFI System Partition (ESP)

Since version 1.1.0 fwupd will autodetect the ESP if it is mounted on /boot/efi, /boot, or /efi, and UDisks is available on the system. In other cases the mount point of the ESP needs to be manually specified using the option EspLocation in /etc/fwupd/daemon.conf.

Setting an invalid directory will disable the fwupd plugin.

External Interface Access

This plugin requires:

  • read/write access to the EFI system partition.
  • read access to /sys/firmware/efi/esrt/
  • read access to /sys/firmware/efi/fw_platform_size
  • read/write access to /sys/firmware/efi/efivars