From: Lennart Poettering Date: Thu, 28 Sep 2023 08:45:39 +0000 (+0200) Subject: bootctl: if we can't access the ESP, show this in regular status output X-Git-Tag: v255-rc1~402^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a730a8f608a3a8dbef4ce1a6e939ced47c63063c;p=thirdparty%2Fsystemd.git bootctl: if we can't access the ESP, show this in regular status output --- diff --git a/src/boot/bootctl-status.c b/src/boot/bootctl-status.c index 73893dee69e..00bc0a91c2c 100644 --- a/src/boot/bootctl-status.c +++ b/src/boot/bootctl-status.c @@ -273,15 +273,13 @@ static int status_binaries(const char *esp_path, sd_id128_t partition) { printf("\n"); r = enumerate_binaries(esp_path, "EFI/systemd", NULL, &last, &is_first); - if (r < 0) { - printf("\n"); - return r; - } + if (r < 0) + goto fail; k = enumerate_binaries(esp_path, "EFI/BOOT", "boot", &last, &is_first); if (k < 0) { - printf("\n"); - return k; + r = k; + goto fail; } if (last) /* let's output the last entry now, since now we know that there will be no more, and can draw the tree glyph properly */ @@ -296,6 +294,11 @@ static int status_binaries(const char *esp_path, sd_id128_t partition) { printf("\n"); return 0; + +fail: + errno = -r; + printf(" File: (can't access %s: %m)\n\n", esp_path); + return r; } static void read_efi_var(const char *variable, char **ret) {