mirror of
https://github.com/systemd/systemd.git
synced 2025-03-29 06:50:16 +03:00
stub: don't override LoaderDevicePartUUID EFI var
We document and all our code assumes that LoaderDevicePartUUID is initialized to the ESP's UUID. Let's hence not override the variable if it is already set, in order to not confuse userspace if the kernel's EFI image is run from a different partition than the ESP. This matches behaviour for all other variables set by the EFI stub, in particular the closely related LoaderImageIdentifier variable.
This commit is contained in:
parent
8118fb3c83
commit
c8b32d06bd
@ -87,9 +87,10 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/* export the device path this image is started from */
|
||||
if (disk_get_part_uuid(loaded_image->DeviceHandle, uuid) == EFI_SUCCESS)
|
||||
efivar_set(L"LoaderDevicePartUUID", uuid, FALSE);
|
||||
/* Export the device path this image is started from, if it's not set yet */
|
||||
if (efivar_get_raw(&loader_guid, L"LoaderDevicePartUUID", NULL, NULL) != EFI_SUCCESS)
|
||||
if (disk_get_part_uuid(loaded_image->DeviceHandle, uuid) == EFI_SUCCESS)
|
||||
efivar_set(L"LoaderDevicePartUUID", uuid, FALSE);
|
||||
|
||||
/* if LoaderImageIdentifier is not set, assume the image with this stub was loaded directly from UEFI */
|
||||
if (efivar_get_raw(&loader_guid, L"LoaderImageIdentifier", NULL, NULL) != EFI_SUCCESS) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user