diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-11-16 12:27:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 12:27:30 +0100 |
commit | b8d6b1608e9dd554d499eab0e6527d1f6177a85e (patch) | |
tree | 338f410afb119a8702f08f2fd369cc075c16b7a2 | |
parent | localectl,analyze: some minor vertical table rework fixes (diff) | |
parent | boot: Correctly handle @saved default patterns (diff) | |
download | systemd-b8d6b1608e9dd554d499eab0e6527d1f6177a85e.tar.xz systemd-b8d6b1608e9dd554d499eab0e6527d1f6177a85e.zip |
Merge pull request #24555 from medhefgo/bootctl
bootctl: Small improvements
-rw-r--r-- | src/shared/bootspec.c | 14 |
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()); |