mirror of
https://github.com/systemd/systemd.git
synced 2026-08-05 07:30:30 +00:00
shared/bootspec: treat empty EFI vars as missing
We shouldn't really make any fuss about this. Also, change 'var' to 'variable' for consistency with systemctl.c.
This commit is contained in:
@@ -664,12 +664,12 @@ int boot_entries_load_config(
|
||||
|
||||
if (is_efi_boot()) {
|
||||
r = efi_get_variable_string(EFI_VENDOR_LOADER, "LoaderEntryOneShot", &config->entry_oneshot);
|
||||
if (r < 0 && r != -ENOENT)
|
||||
return log_error_errno(r, "Failed to read EFI var \"LoaderEntryOneShot\": %m");
|
||||
if (r < 0 && !IN_SET(r, -ENOENT, -ENODATA))
|
||||
return log_error_errno(r, "Failed to read EFI variable \"LoaderEntryOneShot\": %m");
|
||||
|
||||
r = efi_get_variable_string(EFI_VENDOR_LOADER, "LoaderEntryDefault", &config->entry_default);
|
||||
if (r < 0 && r != -ENOENT)
|
||||
return log_error_errno(r, "Failed to read EFI var \"LoaderEntryDefault\": %m");
|
||||
if (r < 0 && !IN_SET(r, -ENOENT, -ENODATA))
|
||||
return log_error_errno(r, "Failed to read EFI variable \"LoaderEntryDefault\": %m");
|
||||
}
|
||||
|
||||
config->default_entry = boot_entries_select_default(config);
|
||||
|
||||
@@ -223,7 +223,7 @@ int efi_get_variable(
|
||||
if (fstat(fd, &st) < 0)
|
||||
return -errno;
|
||||
if (st.st_size < 4)
|
||||
return -EIO;
|
||||
return -ENODATA;
|
||||
if (st.st_size > 4*1024*1024 + 4)
|
||||
return -E2BIG;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user