]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Bds/BootMenu.c
ArmPlatformPkg: Remove PcdStandalone from Sec module and Introduce ArmPlatformSecExtr...
[mirror_edk2.git] / ArmPlatformPkg / Bds / BootMenu.c
index a2360d14f5e50c34b33d96df9afc44a04f77c975..91550df9d42b693d880853e8f3d34be019406b63 100644 (file)
@@ -38,7 +38,8 @@ BootMenuAddBootOption (
   EFI_DEVICE_PATH*  DevicePath;\r
   EFI_DEVICE_PATH_PROTOCOL *DevicePathNode;\r
 \r
-  Attributes = 0;\r
+  Attributes                = 0;\r
+  SupportedBootDevice = NULL;\r
 \r
   //\r
   // List the Boot Devices supported\r
@@ -402,8 +403,9 @@ BootMenuMain (
   UINTN   Index;\r
   UINTN   BootMainEntryCount;\r
 \r
+  BootOption              = NULL;\r
   BootMainEntryCount = sizeof(BootMainEntries) / sizeof(struct BOOT_MAIN_ENTRY);\r
-
+\r
   // Get Boot#### list\r
   BootOptionList (&BootOptionsList);\r
 \r
@@ -425,12 +427,16 @@ BootMenuMain (
         EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol;\r
 \r
         Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);\r
-        ASSERT_EFI_ERROR(Status);\r
+        if (EFI_ERROR(Status)) {\r
+          // You must provide an implementation of DevicePathToTextProtocol in your firmware (eg: DevicePathDxe)\r
+          DEBUG((EFI_D_ERROR,"Error: Bds requires DevicePathToTextProtocol\n"));\r
+          return Status;\r
+        }\r
         DevicePathTxt = DevicePathToTextProtocol->ConvertDevicePathToText(BootOption->FilePathList,TRUE,TRUE);\r
 \r
         Print(L"\t- %s\n",DevicePathTxt);\r
         if (BootOption->OptionalData != NULL) {\r
-          Print(L"\t- LoaderType: %d\n",BootOption->OptionalData->LoaderType);\r
+          Print(L"\t- LoaderType: %d\n", ReadUnaligned32 (&BootOption->OptionalData->LoaderType));\r
           if (BootOption->OptionalData->Arguments != NULL) {\r
             Print(L"\t- Arguments: %a\n",BootOption->OptionalData->Arguments);\r
           }\r