summaryrefslogtreecommitdiffstats
path: root/src/boot/efi/boot.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-07-03 15:36:28 +0200
committerLennart Poettering <lennart@poettering.net>2024-07-03 16:15:04 +0200
commit38faff48e59284c4bdab9e10d604585bac402171 (patch)
tree26b60a26efa9f3cd315f1f84b0b50682cb386947 /src/boot/efi/boot.c
parentboot: cover for hardware keys on phones/tablets (diff)
downloadsystemd-38faff48e59284c4bdab9e10d604585bac402171.tar.xz
systemd-38faff48e59284c4bdab9e10d604585bac402171.zip
boot: don't set OsIndications field if already set correctly
Diffstat (limited to '')
-rw-r--r--src/boot/efi/boot.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index b281136c05..6333cdade6 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -620,16 +620,21 @@ static void print_status(Config *config, char16_t *loaded_image_path) {
}
static EFI_STATUS set_reboot_into_firmware(void) {
- uint64_t osind = 0;
EFI_STATUS err;
+ uint64_t osind = 0;
(void) efivar_get_uint64_le(MAKE_GUID_PTR(EFI_GLOBAL_VARIABLE), u"OsIndications", &osind);
+
+ if (FLAGS_SET(osind, EFI_OS_INDICATIONS_BOOT_TO_FW_UI))
+ return EFI_SUCCESS;
+
osind |= EFI_OS_INDICATIONS_BOOT_TO_FW_UI;
err = efivar_set_uint64_le(MAKE_GUID_PTR(EFI_GLOBAL_VARIABLE), u"OsIndications", osind, EFI_VARIABLE_NON_VOLATILE);
if (err != EFI_SUCCESS)
- log_error_status(err, "Error setting OsIndications: %m");
- return err;
+ return log_error_status(err, "Error setting OsIndications, ignoring: %m");
+
+ return EFI_SUCCESS;
}
_noreturn_ static EFI_STATUS poweroff_system(void) {