]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: handle if LoaderSystemToken is invalid for some reason
authorLennart Poettering <lennart@poettering.net>
Mon, 14 Sep 2020 10:35:19 +0000 (12:35 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 14 Sep 2020 19:33:31 +0000 (21:33 +0200)
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
src/boot/bootctl.c

index 4c84421f22f1e9787e8937c5f551ca257a3fad27..f464882186fcc7b65e802c7a29ff1c53f61367c8 100644 (file)
@@ -1454,7 +1454,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 {