From 8110e144ff5c3a95a2ac82691ee11528b4e6642a Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 29 Jul 2015 19:26:49 +0200 Subject: sd-boot: stub - export LoaderDevicePartUUID --- src/boot/efi/stub.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/boot/efi/stub.c') diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index 0b1bc491ed..0c5ee4e9ff 100644 --- a/src/boot/efi/stub.c +++ b/src/boot/efi/stub.c @@ -18,6 +18,7 @@ #include "util.h" #include "pefile.h" +#include "disk.h" #include "graphics.h" #include "splash.h" #include "linux.h" @@ -46,6 +47,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { UINTN szs[ELEMENTSOF(sections)-1] = {}; CHAR8 *cmdline = NULL; UINTN cmdline_len; + CHAR16 uuid[37]; EFI_STATUS err; InitializeLib(image, sys_table); @@ -99,6 +101,10 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { cmdline = line; } + /* 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); + if (szs[3] > 0) graphics_splash((UINT8 *)((UINTN)loaded_image->ImageBase + addrs[3]), szs[3], NULL); -- cgit v1.2.3-54-g00ecf