From: Lennart Poettering Date: Mon, 14 Sep 2020 10:35:19 +0000 (+0200) Subject: bootctl: handle if LoaderSystemToken is invalid for some reason X-Git-Tag: v247-rc1~242 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ad0b610b0c1c2595c32b6235e7ac5ad7fba6e0aa;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 4c84421f22f..f464882186f 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -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 {