bootctl: prefix all paths with the mountpoint prefix

Continuation of 7851732262 and
5a65d2e535. 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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-05-20 18:20:36 +02:00
parent e187450648
commit 5270c085d4
+9 -5
View 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);