fwupd/plugins/uefi-capsule
Richard Hughes 2d00cda464 Remove PLUGINBUILDDIR and use G_TEST_SRCDIR and G_TEST_BUILDDIR instead
This allows us to override the location we load data files from, which
allows us to do more kinds of installed tests in the future.

Also, move the global data/tests content into the place that it is used
as it was getting impossible to manage.
2021-10-21 18:36:22 +01:00
..
tests uefi-capsule: Add support for CapsuleOnDisk 2021-07-28 17:11:39 +01:00
fu-plugin-uefi-capsule.c Show the user a warning if updating may affect full-disk-encryption 2021-10-09 08:09:38 +01:00
fu-self-test.c Remove PLUGINBUILDDIR and use G_TEST_SRCDIR and G_TEST_BUILDDIR instead 2021-10-21 18:36:22 +01:00
fu-ucs2.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-ucs2.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-backend-freebsd.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -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: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-backend-linux.h uefi-capsule: Add support for CapsuleOnDisk 2021-07-28 17:11:39 +01:00
fu-uefi-backend.c uefi-capsule: Add support for CapsuleOnDisk 2021-07-28 17:11:39 +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 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -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 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-bootmgr.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-cod-device.c Allow using a per-device global percentage completion 2021-09-13 14:28:15 +01:00
fu-uefi-cod-device.h uefi-capsule: Add support for CapsuleOnDisk 2021-07-28 17:11:39 +01:00
fu-uefi-common.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-common.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-device.c uefi-capsule: Use accurate FuProgress values 2021-09-27 19:51:26 +01:00
fu-uefi-device.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-devpath.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -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 Allow using a per-device global percentage completion 2021-09-13 14:28:15 +01:00
fu-uefi-grub-device.h uefi-capsule: Add support for installing UEFI updates from GRUB 2021-07-28 17:11:39 +01:00
fu-uefi-nvram-device.c Allow using a per-device global percentage completion 2021-09-13 14:28:15 +01:00
fu-uefi-nvram-device.h uefi-capsule: Add support for CapsuleOnDisk 2021-07-28 17:11:39 +01:00
fu-uefi-pcrs.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-pcrs.h trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
fu-uefi-tool.c trivial: Load SMBIOS when using fwupdate to avoid a warning 2021-09-28 13:00:22 +01:00
fu-uefi-update-info.c trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05: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 trivial: fix the grub configuration from 684bc03 2021-09-01 09:40:24 -05:00
fwupdate.1 Do not use help2man to build manual pages 2021-04-11 13:42:04 +01:00
make-images.py Write the BMP image upside down to avoid using a negative bitmap height 2021-09-30 08:34:14 +01:00
meson.build Remove PLUGINBUILDDIR and use G_TEST_SRCDIR and G_TEST_BUILDDIR instead 2021-10-21 18:36:22 +01:00
README.md uefi-capsule: Update documentation for CoD 2021-09-02 17:54:34 +01:00
uefi_capsule.conf uefi-capsule: Add support for installing UEFI updates from GRUB 2021-07-28 17:11:39 +01:00
uefi-capsule.quirk plugins/uefi-capsule: Remove ux capsule for StarLite (#3885) 2021-10-20 08:05:16 +01:00

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=false 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. You can explicitly disable it by by modifying DisableCapsuleUpdateOnDisk in /etc/fwupd/uefi_capsule.conf.

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

Since version 1.1.0 fwupd will autodetect the ESP when it is mounted on /boot/efi, /boot, or /efi. A custom EFI system partition location can be used by modifying OverrideESPMountPoint in /etc/fwupd/uefi_capsule.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