From: Zbigniew Jędrzejewski-Szmek Date: Tue, 20 May 2025 14:28:51 +0000 (+0200) Subject: bootctl: prefix all paths with the mountpoint prefix X-Git-Tag: v258-rc1~562^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5270c085d486742fa5d49a959db46219bb48691b;p=thirdparty%2Fsystemd.git bootctl: prefix all paths with the mountpoint prefix 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. --- diff --git a/src/bootctl/bootctl-status.c b/src/bootctl/bootctl-status.c index 0fc86acc841..da1f23d5f89 100644 --- a/src/bootctl/bootctl-status.c +++ b/src/bootctl/bootctl-status.c @@ -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);