]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-boot: use sysfail entry for UEFI firmware update failure 34856/head
authorIgor Opaniuk <igor.opaniuk@foundries.io>
Thu, 23 Jan 2025 12:31:04 +0000 (13:31 +0100)
committerIgor Opaniuk <igor.opaniuk@foundries.io>
Mon, 12 May 2025 13:37:47 +0000 (15:37 +0200)
commit9c56688e8740b1141252902360bebecde7800d60
tree557c09a9d9a364275eeb54cdb785677624f82dd8
parent2857a8397507ca3decb01c188b4d79ee36185424
sd-boot: use sysfail entry for UEFI firmware update failure

Add support for using a sysfail boot entry in case of UEFI firmware
capsule update failure [1]. The status of a firmware update is obtained from
the EFI System Resource Table (ESRT), which provides an optional mechanism
for identifying device and system firmware resources for the purposes of
targeting firmware updates to those resources.

Current implementation uses the value of LastAttemptStatus field from
ESRT, which describes the result of the last firmware update attempt for
the firmware resource entry. The field is updated each time an
UpdateCapsule() is attempted for an ESRT entry and is preserved across
reboots (non-volatile).

This can be be used in setups with support for A/B OTA updates, where
the boot firmware and Linux/RootFS might be updated synchronously.

[1] https://uefi.org/specs/UEFI/2.10/23_Firmware_Update_and_Reporting.html
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
src/boot/efi.h
src/boot/sysfail.c
src/boot/sysfail.h