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:42:46 +0200
commit9f6249eb7fe14ea975dd9d48681408005f598fe4 (patch)
tree71227feabac556b80bc96845659f2a05e7b14402
parentbda316cc0a2650f8bf1f1e8c60ef7a7e639189ec (diff)
downloadsystemd-9f6249eb7fe14ea975dd9d48681408005f598fe4.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) (cherry picked from commit a06cf9a5bad917b9ac6016c940c5f0f0238f266f) (cherry picked from commit 387881ae21acc1022c5c8c17f273ecc254fffe24)
-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 a90502b4c3..1d0015f30a 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -1445,7 +1445,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 {