diff options
| author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-05 14:01:35 +0200 |
|---|---|---|
| committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-05 14:01:35 +0200 |
| commit | cce9457c70b6bb94213dfba0010b3ae25950b845 (patch) | |
| tree | 959a73975b5a2e1d311a0eaf15270727e759ed06 /src/boot | |
| parent | d3eb60722da215da3f0fe09cfdb65ec1cdc1113e (diff) | |
| download | systemd-cce9457c70b6bb94213dfba0010b3ae25950b845.tar.gz | |
bootctl: urlify .conf files
Just because we can ;)
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/bootctl.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index c26250c60a..9df181a10c 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -351,8 +351,16 @@ static int boot_entry_show(const BootEntry *e, bool show_as_default) { if (e->id) printf(" id: %s\n", e->id); - if (e->path) - printf(" source: %s\n", e->path); + if (e->path) { + _cleanup_free_ char *link = NULL; + + /* Let's urlify the link to make it easy to view in an editor, but only if it is a text + * file. Unified images are binary ELFs, and EFI variables are not pure text either. */ + if (e->type == BOOT_ENTRY_CONF) + (void) terminal_urlify_path(e->path, NULL, &link); + + printf(" source: %s\n", link ?: e->path); + } if (e->version) printf(" version: %s\n", e->version); if (e->machine_id) |
