summaryrefslogtreecommitdiff
path: root/src/boot/efi/boot.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-07-29 20:31:15 +0200
committerDaniel Mack <daniel@zonque.org>2015-07-29 20:31:15 +0200
commitc2570b3de2430b06f545e78ff32b97503f81f09f (patch)
tree9f58e23600a681723f393f71bb19d10f23df5050 /src/boot/efi/boot.c
parent7fc309b3a83c6f8a6f06b9bbea0c5ea379cef68e (diff)
parent8110e144ff5c3a95a2ac82691ee11528b4e6642a (diff)
Merge branch 'master' of github.com:systemd/systemd
Diffstat (limited to 'src/boot/efi/boot.c')
-rw-r--r--src/boot/efi/boot.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index e8cd8abd26..dde0c41744 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -22,6 +22,7 @@
#include "console.h"
#include "graphics.h"
#include "pefile.h"
+#include "disk.h"
#include "linux.h"
#ifndef EFI_OS_INDICATIONS_BOOT_TO_FW_UI
@@ -1696,11 +1697,11 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
EFI_LOADED_IMAGE *loaded_image;
EFI_FILE *root_dir;
CHAR16 *loaded_image_path;
- EFI_DEVICE_PATH *device_path;
EFI_STATUS err;
Config config;
UINT64 init_usec;
BOOLEAN menu = FALSE;
+ CHAR16 uuid[37];
InitializeLib(image, sys_table);
init_usec = time_usec();
@@ -1722,29 +1723,8 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
}
/* export the device path this image is started from */
- device_path = DevicePathFromHandle(loaded_image->DeviceHandle);
- if (device_path) {
- EFI_DEVICE_PATH *path, *paths;
-
- paths = UnpackDevicePath(device_path);
- for (path = paths; !IsDevicePathEnd(path); path = NextDevicePathNode(path)) {
- HARDDRIVE_DEVICE_PATH *drive;
- CHAR16 uuid[37];
-
- if (DevicePathType(path) != MEDIA_DEVICE_PATH)
- continue;
- if (DevicePathSubType(path) != MEDIA_HARDDRIVE_DP)
- continue;
- drive = (HARDDRIVE_DEVICE_PATH *)path;
- if (drive->SignatureType != SIGNATURE_TYPE_GUID)
- continue;
-
- GuidToString(uuid, (EFI_GUID *)&drive->Signature);
- efivar_set(L"LoaderDevicePartUUID", uuid, FALSE);
- break;
- }
- FreePool(paths);
- }
+ if (disk_get_part_uuid(loaded_image->DeviceHandle, uuid) == EFI_SUCCESS)
+ efivar_set(L"LoaderDevicePartUUID", uuid, FALSE);
root_dir = LibOpenRoot(loaded_image->DeviceHandle);
if (!root_dir) {