}\r
\r
if (IsEfiApp) {\r
- Print(L"Is your application is an OS loader? ");\r
+ Print(L"Is your application an OS loader? ");\r
Status = GetHIInputBoolean (&IsBootLoader);\r
if (EFI_ERROR(Status)) {\r
return EFI_ABORTED;\r
DevicePath = DuplicateDevicePath (OldDevicePath);\r
\r
EndingDevicePath = (FILEPATH_DEVICE_PATH*)GetLastDevicePathNode (DevicePath);\r
- \r
+\r
Print(L"File path of the %s: ", FileName);\r
StrnCpy (BootFilePath, EndingDevicePath->PathName, BOOT_DEVICE_FILEPATH_MAX);\r
Status = EditHIInputStr (BootFilePath, BOOT_DEVICE_FILEPATH_MAX);\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Check if a boot option path is a file system boot option path or not.\r
+\r
+ The device specified by the beginning of the path has to support the Simple File\r
+ System protocol. Furthermore, the remaining part of the path has to be composed of\r
+ a single node of type MEDIA_DEVICE_PATH and sub-type MEDIA_FILEPATH_DP.\r
+\r
+ @param[in] DevicePath Complete device path of a boot option.\r
+\r
+ @retval FALSE The boot option path has not been identified as that of a\r
+ file system boot option.\r
+ @retval TRUE The boot option path is a file system boot option.\r
+**/\r
BOOLEAN\r
BdsLoadOptionFileSystemIsSupported (\r
- IN EFI_DEVICE_PATH *DevicePath\r
+ IN EFI_DEVICE_PATH *DevicePath\r
)\r
{\r
- EFI_DEVICE_PATH* DevicePathNode;\r
+ EFI_STATUS Status;\r
+ EFI_HANDLE Handle;\r
+ EFI_DEVICE_PATH *RemainingDevicePath;\r
+ EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileProtocol;\r
\r
- DevicePathNode = GetLastDevicePathNode (DevicePath);\r
+ Status = BdsConnectDevicePath (DevicePath, &Handle, &RemainingDevicePath);\r
+ if (EFI_ERROR (Status)) {\r
+ return FALSE;\r
+ }\r
\r
- return IS_DEVICE_PATH_NODE(DevicePathNode,MEDIA_DEVICE_PATH,MEDIA_FILEPATH_DP);\r
+ Status = gBS->HandleProtocol (\r
+ Handle,\r
+ &gEfiSimpleFileSystemProtocolGuid,\r
+ (VOID **)(&FileProtocol)\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return FALSE;\r
+ }\r
+\r
+ if (!IS_DEVICE_PATH_NODE (RemainingDevicePath, MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP))\r
+ return FALSE;\r
+\r
+ return TRUE;\r
}\r
\r
STATIC\r
return Status;\r
}\r
\r
+/**\r
+ Check if a boot option path is a memory map boot option path or not.\r
+\r
+ The device specified by the beginning of the path has to support the BlockIo\r
+ protocol. Furthermore, the remaining part of the path has to be composed of\r
+ a single node of type HARDWARE_DEVICE_PATH and sub-type HW_MEMMAP_DP.\r
+\r
+ @param[in] DevicePath Complete device path of a boot option.\r
+\r
+ @retval FALSE The boot option path has not been identified as that of a\r
+ memory map boot option.\r
+ @retval TRUE The boot option path is a a memory map boot option.\r
+**/\r
BOOLEAN\r
BdsLoadOptionMemMapIsSupported (\r
- IN EFI_DEVICE_PATH *DevicePath\r
+ IN EFI_DEVICE_PATH *DevicePath\r
)\r
{\r
- EFI_DEVICE_PATH* DevicePathNode;\r
+ EFI_STATUS Status;\r
+ EFI_HANDLE Handle;\r
+ EFI_DEVICE_PATH *RemainingDevicePath;\r
+ EFI_BLOCK_IO_PROTOCOL *BlockIoProtocol;\r
\r
- DevicePathNode = GetLastDevicePathNode (DevicePath);\r
+ Status = BdsConnectDevicePath (DevicePath, &Handle, &RemainingDevicePath);\r
+ if (EFI_ERROR (Status)) {\r
+ return FALSE;\r
+ }\r
+\r
+ Status = gBS->HandleProtocol (\r
+ Handle,\r
+ &gEfiBlockIoProtocolGuid,\r
+ (VOID **)(&BlockIoProtocol)\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return FALSE;\r
+ }\r
\r
- return IS_DEVICE_PATH_NODE(DevicePathNode,HARDWARE_DEVICE_PATH,HW_MEMMAP_DP);\r
+ if (!IS_DEVICE_PATH_NODE (RemainingDevicePath, HARDWARE_DEVICE_PATH, HW_MEMMAP_DP))\r
+ return FALSE;\r
+\r
+ return TRUE;\r
}\r
\r
EFI_STATUS\r
\r
BOOLEAN\r
BdsLoadOptionPxeIsSupported (\r
- IN EFI_DEVICE_PATH *DevicePath\r
+ IN EFI_DEVICE_PATH *DevicePath\r
)\r
{\r
EFI_STATUS Status;\r