]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: prefix all paths with the mountpoint prefix 37524/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 May 2025 14:28:51 +0000 (16:28 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 May 2025 16:20:36 +0000 (18:20 +0200)
Continuation of 7851732262ec94f50598c4a289589a6ddb97ebfd and
5a65d2e53531f99ee03b576bee3464775d000f48. Absolute paths are always
nicer for the user because it's much easier to figure out where the
file is located. And printing some paths with the prefix and some
without was quite confusing.

src/bootctl/bootctl-status.c

index 0fc86acc841f04c7f141ff542014a00f7a94d048..da1f23d5f89c7eb532a6d85c7c8ab16544b60e44 100644 (file)
@@ -144,7 +144,8 @@ static int print_efi_option(uint16_t id, int *n_printed, bool in_order) {
         printf("       Status: %sactive%s\n", active ? "" : "in", in_order ? ", boot-order" : "");
         printf("    Partition: /dev/disk/by-partuuid/" SD_ID128_UUID_FORMAT_STR "\n",
                SD_ID128_FORMAT_VAL(partition));
-        printf("         File: %s%s\n", glyph(GLYPH_TREE_RIGHT), path);
+        printf("         File: %s%s%s/%s%s\n",
+               glyph(GLYPH_TREE_RIGHT), ansi_grey(), arg_esp_path, ansi_normal(), path);
         printf("\n");
 
         (*n_printed)++;
@@ -229,7 +230,6 @@ static int enumerate_binaries(
                         return log_error_errno(errno, "Failed to open file for reading: %m");
 
                 r = get_file_version(fd, &v);
-
                 if (r < 0 && r != -ESRCH)
                         return r;
 
@@ -246,9 +246,12 @@ static int enumerate_binaries(
                  * variable, because we only will know the tree glyph to print (branch or final edge) once we
                  * read one more entry */
                 if (r == -ESRCH) /* No systemd-owned file but still interesting to print */
-                        r = asprintf(previous, "/%s/%s", path, de->d_name);
+                        r = asprintf(previous, "%s%s/%s/%s/%s",
+                                     ansi_grey(), esp_path, ansi_normal(), path, de->d_name);
                 else /* if (r >= 0) */
-                        r = asprintf(previous, "/%s/%s (%s%s%s)", path, de->d_name, ansi_highlight(), v, ansi_normal());
+                        r = asprintf(previous, "%s%s/%s/%s/%s (%s%s%s)",
+                                     ansi_grey(), esp_path, ansi_normal(), path, de->d_name,
+                                     ansi_highlight(), v, ansi_normal());
                 if (r < 0)
                         return log_oom();
 
@@ -515,7 +518,8 @@ int verb_status(int argc, char *argv[], void *userdata) {
                                 printf("     Partition: n/a\n");
 
                         if (loader_path)
-                                printf("        Loader: %s%s\n", glyph(GLYPH_TREE_RIGHT), strna(loader_path));
+                                printf("        Loader: %s%s%s/%s%s\n",
+                                       glyph(GLYPH_TREE_RIGHT), ansi_grey(), arg_esp_path, ansi_normal(), loader_path);
 
                         if (loader_url)
                                 printf("  Net Boot URL: %s\n", loader_url);