1 /* SPDX-License-Identifier: LGPL-2.1+ */
8 EFI_STATUS
disk_get_part_uuid(EFI_HANDLE
*handle
, CHAR16 uuid
[37]) {
9 EFI_DEVICE_PATH
*device_path
;
11 /* export the device path this image is started from */
12 device_path
= DevicePathFromHandle(handle
);
14 _cleanup_freepool_ EFI_DEVICE_PATH
*paths
= NULL
;
15 EFI_DEVICE_PATH
*path
;
17 paths
= UnpackDevicePath(device_path
);
18 for (path
= paths
; !IsDevicePathEnd(path
); path
= NextDevicePathNode(path
)) {
19 HARDDRIVE_DEVICE_PATH
*drive
;
21 if (DevicePathType(path
) != MEDIA_DEVICE_PATH
)
23 if (DevicePathSubType(path
) != MEDIA_HARDDRIVE_DP
)
25 drive
= (HARDDRIVE_DEVICE_PATH
*)path
;
26 if (drive
->SignatureType
!= SIGNATURE_TYPE_GUID
)
29 GuidToString(uuid
, (EFI_GUID
*)&drive
->Signature
);