mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 20:25:38 +03:00
bootspec: access EFI variables on on EFI boots
This commit is contained in:
parent
a099e0352c
commit
9c4a6c1319
@ -377,6 +377,7 @@ int boot_entries_load_config(const char *esp_path, BootConfig *config) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to uniquify boot entries: %m");
|
return log_error_errno(r, "Failed to uniquify boot entries: %m");
|
||||||
|
|
||||||
|
if (is_efi_boot()) {
|
||||||
r = efi_get_variable_string(EFI_VENDOR_LOADER, "LoaderEntryOneShot", &config->entry_oneshot);
|
r = efi_get_variable_string(EFI_VENDOR_LOADER, "LoaderEntryOneShot", &config->entry_oneshot);
|
||||||
if (r < 0 && r != -ENOENT)
|
if (r < 0 && r != -ENOENT)
|
||||||
return log_error_errno(r, "Failed to read EFI var \"LoaderEntryOneShot\": %m");
|
return log_error_errno(r, "Failed to read EFI var \"LoaderEntryOneShot\": %m");
|
||||||
@ -384,6 +385,7 @@ int boot_entries_load_config(const char *esp_path, BootConfig *config) {
|
|||||||
r = efi_get_variable_string(EFI_VENDOR_LOADER, "LoaderEntryDefault", &config->entry_default);
|
r = efi_get_variable_string(EFI_VENDOR_LOADER, "LoaderEntryDefault", &config->entry_default);
|
||||||
if (r < 0 && r != -ENOENT)
|
if (r < 0 && r != -ENOENT)
|
||||||
return log_error_errno(r, "Failed to read EFI var \"LoaderEntryDefault\": %m");
|
return log_error_errno(r, "Failed to read EFI var \"LoaderEntryDefault\": %m");
|
||||||
|
}
|
||||||
|
|
||||||
config->default_entry = boot_entries_select_default(config);
|
config->default_entry = boot_entries_select_default(config);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user