systemd-boot: Make automatic entries configurable

Hiding automatic entries allows for giving custom entry names like
"Windows 10" instead of "Windows Boot Manager" by creating an appropriate
loader file in the loader/entries folder.
Note that it is already doable by renaming bootmgfw.efi (or the other auto-detected
boot loaders) and then using the renamed file for a custom entry. But windows will
automatically recreate the boot loader on updates, including the default EFI
bootloader entry if that one is missing.

Make hiding EFI reboot a separate option because there is no simple way to create
it with a custom loader entry and people may still want that around while still
hiding the other auto entries.

Also, turn no_editor into a positive boolean name while we're touching this code.
This commit is contained in:
Jan Janssen
2018-01-28 17:20:41 +01:00
parent 33d4ba32c9
commit c1d4e298bc
3 changed files with 46 additions and 6 deletions
+6
View File
@@ -142,6 +142,8 @@ void boot_config_free(BootConfig *config) {
free(config->default_pattern);
free(config->timeout);
free(config->editor);
free(config->auto_entries);
free(config->auto_firmware);
free(config->entry_oneshot);
free(config->entry_default);
@@ -194,6 +196,10 @@ int boot_loader_read_conf(const char *path, BootConfig *config) {
r = free_and_strdup(&config->timeout, p);
else if (streq(buf, "editor"))
r = free_and_strdup(&config->editor, p);
else if (streq(buf, "auto-entries"))
r = free_and_strdup(&config->auto_entries, p);
else if (streq(buf, "auto-firmware"))
r = free_and_strdup(&config->auto_firmware, p);
else {
log_notice("%s:%u: Unknown line \"%s\"", path, line, buf);
continue;