]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: if we can't access the ESP, show this in regular status output
authorLennart Poettering <lennart@poettering.net>
Thu, 28 Sep 2023 08:45:39 +0000 (10:45 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 28 Sep 2023 10:07:15 +0000 (12:07 +0200)
src/boot/bootctl-status.c

index 73893dee69ebe1f20551225534e76bcd0b324974..00bc0a91c2c26133be056976f5b9f2ab80b0c072 100644 (file)
@@ -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) {