summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-04 22:20:19 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-05 13:50:34 +0200
commitce4c4f810876b2d6e50041c8bbe089e8a9e2576e (patch)
treeec1a60592d1e01507819b15520028eba89655dee
parentefivars: add helper to format efivarfs path (diff)
downloadsystemd-ce4c4f810876b2d6e50041c8bbe089e8a9e2576e.tar.xz
systemd-ce4c4f810876b2d6e50041c8bbe089e8a9e2576e.zip
bootctl: replace "type" with "source" in output
I think this is more useful (because it's easy to stick the path into an editor command when one wants to change the options or inspect the files), and more self-explanatory. Example output: title: Fedora 30 (Workstation Edition) (4.20.16-200.fc29.x86_64) id: 08a5690a2eed47cf92ac0a5d2e3cf6b0-4.20.16-200.fc29.x86_64 source: /boot/efi/loader/entries/08a5690a2eed47cf92ac0a5d2e3cf6b0-4.20.16-200.fc29.x86_64.conf version: 4.20.16-200.fc29.x86_64 ... title: Fedora 30 (Workstation Edition) id: fedora-30 source: /boot/efi/EFI/Linux/linux-5.0.5-300.fc30.x86_64-08a5690a2eed47cf92ac0a5d2e3cf6b0.efi linux: EFI/Linux/linux-5.0.5-300.fc30.x86_64-08a5690a2eed47cf92ac0a5d2e3cf6b0.efi ... title: Reboot Into Firmware Interface id: auto-reboot-to-firmware-setup source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
-rw-r--r--TODO1
-rw-r--r--src/boot/bootctl.c14
-rw-r--r--src/shared/bootspec.c7
3 files changed, 11 insertions, 11 deletions
diff --git a/TODO b/TODO
index 663e4fedd8..f9e86677ab 100644
--- a/TODO
+++ b/TODO
@@ -688,7 +688,6 @@ Features:
* bootctl
- verify that the files boot entries point to exist
- recognize the case when not booted on EFI
- - specify paths for boot entries
* maybe do not install getty@tty1.service symlink in /etc but in /usr?
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index 0595f873f0..3257574100 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -313,18 +313,14 @@ static int status_variables(void) {
static int boot_entry_show(const BootEntry *e, bool show_as_default) {
assert(e);
- printf(" title: %s%s%s%s%s%s\n"
- " type: %s\n",
- ansi_highlight(),
- boot_entry_title(e),
- ansi_normal(),
- ansi_highlight_green(),
- show_as_default ? " (default)" : "",
- ansi_normal(),
- boot_entry_type_to_string(e->type));
+ printf(" title: %s%s%s" "%s%s%s\n",
+ ansi_highlight(), boot_entry_title(e), ansi_normal(),
+ ansi_highlight_green(), show_as_default ? " (default)" : "", ansi_normal());
if (e->id)
printf(" id: %s\n", e->id);
+ if (e->path)
+ printf(" source: %s\n", e->path);
if (e->version)
printf(" version: %s\n", e->version);
if (e->machine_id)
diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c
index 9a0dc29153..b088b04da0 100644
--- a/src/shared/bootspec.c
+++ b/src/shared/bootspec.c
@@ -755,7 +755,7 @@ int boot_entries_augment_from_loader(BootConfig *config, bool only_auto) {
n_allocated = config->n_entries;
STRV_FOREACH(i, found_by_loader) {
- _cleanup_free_ char *c = NULL, *t = NULL;
+ _cleanup_free_ char *c = NULL, *t = NULL, *p = NULL;
char **a, **b;
if (boot_config_has_entry(config, *i))
@@ -776,6 +776,10 @@ int boot_entries_augment_from_loader(BootConfig *config, bool only_auto) {
break;
}
+ p = efi_variable_path(EFI_VENDOR_LOADER, "LoaderEntries");
+ if (!p)
+ return log_oom();
+
if (!GREEDY_REALLOC0(config->entries, n_allocated, config->n_entries + 1))
return log_oom();
@@ -783,6 +787,7 @@ int boot_entries_augment_from_loader(BootConfig *config, bool only_auto) {
.type = BOOT_ENTRY_LOADER,
.id = TAKE_PTR(c),
.title = TAKE_PTR(t),
+ .path = TAKE_PTR(p),
};
}