summaryrefslogtreecommitdiff
path: root/src/shared/bootspec.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-11-16 12:27:30 +0100
committerGitHub <noreply@github.com>2022-11-16 12:27:30 +0100
commitb8d6b1608e9dd554d499eab0e6527d1f6177a85e (patch)
tree338f410afb119a8702f08f2fd369cc075c16b7a2 /src/shared/bootspec.c
parentf038576943cafab8b5983ea9c2cf0039a040e05a (diff)
parent7941f11acb67c4f8ec857a791a51f3148af67b32 (diff)
downloadsystemd-b8d6b1608e9dd554d499eab0e6527d1f6177a85e.tar.gz
Merge pull request #24555 from medhefgo/bootctl
bootctl: Small improvements
Diffstat (limited to 'src/shared/bootspec.c')
-rw-r--r--src/shared/bootspec.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c
index 0afc41d200..ff5cd9bc1f 100644
--- a/src/shared/bootspec.c
+++ b/src/shared/bootspec.c
@@ -710,7 +710,7 @@ static int boot_entry_load_unified(
if (!tmp.root)
return log_oom();
- tmp.kernel = strdup(skip_leading_chars(k, "/"));
+ tmp.kernel = path_make_absolute(k, "/");
if (!tmp.kernel)
return log_oom();
@@ -978,6 +978,12 @@ static int boot_config_find(const BootConfig *config, const char *id) {
if (!id)
return -1;
+ if (id[0] == '@') {
+ if (!strcaseeq(id, "@saved"))
+ return -1;
+ id = config->entry_selected;
+ }
+
for (size_t i = 0; i < config->n_entries; i++)
if (fnmatch(id, config->entries[i].id, FNM_CASEFOLD) == 0)
return i;
@@ -1262,7 +1268,11 @@ static void boot_entry_file_list(
int status = chase_symlinks_and_access(p, root, CHASE_PREFIX_ROOT|CHASE_PROHIBIT_SYMLINKS, F_OK, NULL, NULL);
- printf("%13s%s ", strempty(field), field ? ":" : " ");
+ /* Note that this shows two '/' between the root and the file. This is intentional to highlight (in
+ * the abscence of color support) to the user that the boot loader is only interested in the second
+ * part of the file. */
+ printf("%13s%s %s%s/%s", strempty(field), field ? ":" : " ", ansi_grey(), root, ansi_normal());
+
if (status < 0) {
errno = -status;
printf("%s%s%s (%m)\n", ansi_highlight_red(), p, ansi_normal());