summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2022-05-26 13:07:30 +0200
committerJan Janssen <medhefgo@web.de>2022-06-09 12:50:13 +0200
commit5594ebee99aaa2d66978b1c39d7e2084110dc76c (patch)
treeb1d40d11c20522331213cca72cacce5a28447baa /src
parentboot: Drop use of LibLocateProtocol (diff)
downloadsystemd-5594ebee99aaa2d66978b1c39d7e2084110dc76c.tar.xz
systemd-5594ebee99aaa2d66978b1c39d7e2084110dc76c.zip
boot: Drop use of DevicePathFromHandle
Diffstat (limited to 'src')
-rw-r--r--src/boot/efi/disk.c10
-rw-r--r--src/boot/efi/xbootldr.c7
2 files changed, 10 insertions, 7 deletions
diff --git a/src/boot/efi/disk.c b/src/boot/efi/disk.c
index b7beac3d08..fcd5812ff1 100644
--- a/src/boot/efi/disk.c
+++ b/src/boot/efi/disk.c
@@ -7,16 +7,18 @@
#include "util.h"
EFI_STATUS disk_get_part_uuid(EFI_HANDLE *handle, CHAR16 uuid[static 37]) {
+ EFI_STATUS err;
EFI_DEVICE_PATH *device_path;
_cleanup_freepool_ EFI_DEVICE_PATH *paths = NULL;
+ /* export the device path this image is started from */
+
if (!handle)
return EFI_NOT_FOUND;
- /* export the device path this image is started from */
- device_path = DevicePathFromHandle(handle);
- if (!device_path)
- return EFI_NOT_FOUND;
+ err = BS->HandleProtocol(handle, &DevicePathProtocol, (void **) &device_path);
+ if (err != EFI_SUCCESS)
+ return err;
paths = UnpackDevicePath(device_path);
for (EFI_DEVICE_PATH *path = paths; !IsDevicePathEnd(path); path = NextDevicePathNode(path)) {
diff --git a/src/boot/efi/xbootldr.c b/src/boot/efi/xbootldr.c
index 583bc4216f..84e443135c 100644
--- a/src/boot/efi/xbootldr.c
+++ b/src/boot/efi/xbootldr.c
@@ -154,9 +154,10 @@ static EFI_STATUS find_device(EFI_HANDLE *device, EFI_DEVICE_PATH **ret_device_p
assert(device);
assert(ret_device_path);
- EFI_DEVICE_PATH *partition_path = DevicePathFromHandle(device);
- if (!partition_path)
- return EFI_NOT_FOUND;
+ EFI_DEVICE_PATH *partition_path;
+ err = BS->HandleProtocol(device, &DevicePathProtocol, (void **) &partition_path);
+ if (err != EFI_SUCCESS)
+ return err;
/* Find the (last) partition node itself. */
EFI_DEVICE_PATH *part_node = NULL;