Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F112036228
D20513.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20513.diff
View Options
Index: head/stand/efi/include/efilib.h
===================================================================
--- head/stand/efi/include/efilib.h
+++ head/stand/efi/include/efilib.h
@@ -90,6 +90,7 @@
bool efi_devpath_is_prefix(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *);
CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *);
void efi_free_devpath_name(CHAR16 *);
+bool efi_devpath_same_disk(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *);
EFI_DEVICE_PATH *efi_devpath_to_media_path(EFI_DEVICE_PATH *);
UINTN efi_devpath_length(EFI_DEVICE_PATH *);
EFI_DEVICE_PATH *efi_name_to_devpath(const char *path);
Index: head/stand/efi/libefi/devpath.c
===================================================================
--- head/stand/efi/libefi/devpath.c
+++ head/stand/efi/libefi/devpath.c
@@ -197,14 +197,19 @@
return (true);
}
-bool
-efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2)
+static bool
+_efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2,
+ bool ignore_media)
{
if (devpath1 == NULL || devpath2 == NULL)
return (false);
while (true) {
+ if (ignore_media &&
+ IsDevicePathType(devpath1, MEDIA_DEVICE_PATH) &&
+ IsDevicePathType(devpath2, MEDIA_DEVICE_PATH))
+ return (true);
if (!efi_devpath_match_node(devpath1, devpath2))
return false;
if (IsDevicePathEnd(devpath1))
@@ -213,6 +218,25 @@
devpath2 = NextDevicePathNode(devpath2);
}
return (true);
+}
+/*
+ * Are two devpaths identical?
+ */
+bool
+efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2)
+{
+ return _efi_devpath_match(devpath1, devpath2, false);
+}
+
+/*
+ * Like efi_devpath_match, but stops at when we hit the media device
+ * path node that specifies the partition information. If we match
+ * up to that point, then we're on the same disk.
+ */
+bool
+efi_devpath_same_disk(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2)
+{
+ return _efi_devpath_match(devpath1, devpath2, true);
}
bool
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 12, 9:52 PM (10 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17120682
Default Alt Text
D20513.diff (1 KB)
Attached To
Mode
D20513: Fix regression in r347193 in selecting which drive to boot.
Attached
Detach File
Event Timeline
Log In to Comment