summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-09-14 12:35:19 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-09-20 12:01:04 +0200
commita06cf9a5bad917b9ac6016c940c5f0f0238f266f (patch)
tree9bbf935824a55d574ceb5987771d3ef9e89f5c05
parente2c0023dd2c18500ffa9a07522b9a860f358311f (diff)
downloadsystemd-a06cf9a5bad917b9ac6016c940c5f0f0238f266f.tar.gz
bootctl: handle if LoaderSystemToken is invalid for some reason
This points to some firmware issue, but we should still be able to correct things if this happens. Hence log about this and fix it. Fixes: #17041 (cherry picked from commit ad0b610b0c1c2595c32b6235e7ac5ad7fba6e0aa)
-rw-r--r--src/boot/bootctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index 3a80aafcca..1a085ffa66 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -1472,7 +1472,9 @@ static int install_random_seed(const char *esp) {
}
r = efi_get_variable(EFI_VENDOR_LOADER, "LoaderSystemToken", NULL, NULL, &token_size);
- if (r < 0) {
+ if (r == -ENODATA)
+ log_debug_errno(r, "LoaderSystemToken EFI variable is invalid (too short?), replacing.");
+ else if (r < 0) {
if (r != -ENOENT)
return log_error_errno(r, "Failed to test system token validity: %m");
} else {