]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Bds/BootOptionSupport.c
ArmPlatformPkg/Bds: Remove Linux specific boot path
[mirror_edk2.git] / ArmPlatformPkg / Bds / BootOptionSupport.c
index 974f220553a3f746934efb25de48f89b447b9703..f50f13f71dd23f0dc428d9aeed8ec4fdc193c6ec 100644 (file)
@@ -213,117 +213,6 @@ BootDeviceGetDeviceSupport (
   return EFI_UNSUPPORTED;\r
 }\r
 \r
-EFI_STATUS\r
-BootDeviceGetType (\r
-  IN  EFI_DEVICE_PATH* DevicePath,\r
-  OUT ARM_BDS_LOADER_TYPE *BootType,\r
-  OUT UINT32 *Attributes\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-  BOOLEAN                 IsEfiApp;\r
-  BOOLEAN                 IsBootLoader;\r
-  BOOLEAN                 HasFDTSupport;\r
-  CHAR16*                 FileName;\r
-  EFI_DEVICE_PATH*        PrevDevicePathNode;\r
-  EFI_DEVICE_PATH*        DevicePathNode;\r
-  EFI_PHYSICAL_ADDRESS    Image;\r
-  UINTN                   FileSize;\r
-  EFI_IMAGE_DOS_HEADER*   DosHeader;\r
-  UINTN                   PeCoffHeaderOffset;\r
-  EFI_IMAGE_NT_HEADERS32* NtHeader;\r
-\r
-  //\r
-  // Check if the last node of the device path is a FilePath node\r
-  //\r
-  PrevDevicePathNode = NULL;\r
-  DevicePathNode = DevicePath;\r
-  while ((DevicePathNode != NULL) && !IsDevicePathEnd (DevicePathNode)) {\r
-    PrevDevicePathNode = DevicePathNode;\r
-    DevicePathNode = NextDevicePathNode (DevicePathNode);\r
-  }\r
-\r
-  if ((PrevDevicePathNode != NULL) &&\r
-      (PrevDevicePathNode->Type == MEDIA_DEVICE_PATH) &&\r
-      (PrevDevicePathNode->SubType == MEDIA_FILEPATH_DP))\r
-  {\r
-    FileName = ((FILEPATH_DEVICE_PATH*)PrevDevicePathNode)->PathName;\r
-  } else {\r
-    FileName = NULL;\r
-  }\r
-\r
-  if (FileName == NULL) {\r
-    Print(L"Is an EFI Application? ");\r
-    Status = GetHIInputBoolean (&IsEfiApp);\r
-    if (EFI_ERROR(Status)) {\r
-      return EFI_ABORTED;\r
-    }\r
-  } else if (HasFilePathEfiExtension(FileName)) {\r
-    IsEfiApp = TRUE;\r
-  } else {\r
-    // Check if the file exist\r
-    Status = BdsLoadImage (DevicePath, AllocateAnyPages, &Image, &FileSize);\r
-    if (!EFI_ERROR (Status)) {\r
-\r
-      DosHeader = (EFI_IMAGE_DOS_HEADER *)(UINTN) Image;\r
-      if (DosHeader->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
-        //\r
-        // DOS image header is present,\r
-        // so read the PE header after the DOS image header.\r
-        //\r
-        PeCoffHeaderOffset = DosHeader->e_lfanew;\r
-      } else {\r
-        PeCoffHeaderOffset = 0;\r
-      }\r
-\r
-      //\r
-      // Check PE/COFF image.\r
-      //\r
-      NtHeader = (EFI_IMAGE_NT_HEADERS32 *)(UINTN) (Image + PeCoffHeaderOffset);\r
-      if (NtHeader->Signature != EFI_IMAGE_NT_SIGNATURE) {\r
-        IsEfiApp = FALSE;\r
-      } else {\r
-        IsEfiApp = TRUE;\r
-      }\r
-\r
-      // Free memory\r
-      gBS->FreePages (Image, EFI_SIZE_TO_PAGES(FileSize));\r
-    } else {\r
-      // If we did not manage to open it then ask for the type\r
-      Print(L"Is an EFI Application? ");\r
-      Status = GetHIInputBoolean (&IsEfiApp);\r
-      if (EFI_ERROR(Status)) {\r
-        return EFI_ABORTED;\r
-      }\r
-    }\r
-  }\r
-\r
-  if (IsEfiApp) {\r
-    Print(L"Is your application an OS loader? ");\r
-    Status = GetHIInputBoolean (&IsBootLoader);\r
-    if (EFI_ERROR(Status)) {\r
-      return EFI_ABORTED;\r
-    }\r
-    if (!IsBootLoader) {\r
-      *Attributes |= LOAD_OPTION_CATEGORY_APP;\r
-    }\r
-    *BootType = BDS_LOADER_EFI_APPLICATION;\r
-  } else {\r
-    Print(L"Has FDT support? ");\r
-    Status = GetHIInputBoolean (&HasFDTSupport);\r
-    if (EFI_ERROR(Status)) {\r
-      return EFI_ABORTED;\r
-    }\r
-    if (HasFDTSupport) {\r
-      *BootType = BDS_LOADER_KERNEL_LINUX_FDT;\r
-    } else {\r
-      *BootType = BDS_LOADER_KERNEL_LINUX_ATAG;\r
-    }\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
 EFI_STATUS\r
 BdsLoadOptionFileSystemList (\r
   IN OUT LIST_ENTRY* BdsLoadOptionList\r