[edk2-devel] [PATCH] SimicsOpenBoardPkg: Always set the boot priority by default

David Wei david.y.wei at intel.com
Fri Sep 13 16:57:54 UTC 2019


When running networks of multiple machines, Simics assigns different disk IDs to each disk created.
this change the boot priority and can't boot from SATA HDD directly.
Clear boot priority in NVRAM can fix this issue.

Cc: Hao Wu <hao.a.wu at intel.com>
Cc: Liming Gao <liming.gao at intel.com>
Cc: Ankit Sinha <ankit.sinha at intel.com>
Cc: Agyeman Prince <prince.agyeman at intel.com>
Cc: Kubacki Michael A <michael.a.kubacki at intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
Cc: Michael D Kinney <michael.d.kinney at intel.com>

Signed-off-by: David Wei <david.y.wei at intel.com>
---
 .../Library/PlatformBootManagerLib/BdsPlatform.c           | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index 953a4a6c15..926ed94ca1 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -338,10 +338,18 @@ PlatformBootManagerBeforeConsole (
   VOID
   )
 {
-//  EFI_HANDLE    Handle;
-//  EFI_STATUS    Status;
+  EFI_BOOT_MANAGER_LOAD_OPTION  *NvBootOptions;
+  UINTN                         NvBootOptionCount;
+  UINTN                         Index;
+  EFI_STATUS    Status;
+
+  DEBUG((EFI_D_INFO, "PlatformBootManagerBeforeConsole\n"));
+
+  NvBootOptions = EfiBootManagerGetLoadOptions(&NvBootOptionCount, LoadOptionTypeBoot);
+  for (Index = 0; Index < NvBootOptionCount; Index++) {
+    Status = EfiBootManagerDeleteLoadOptionVariable(NvBootOptions[Index].OptionNumber, LoadOptionTypeBoot);
+  }
 
-  DEBUG ((EFI_D_INFO, "PlatformBootManagerBeforeConsole\n"));
   InstallDevicePathCallback ();
 
   VisitAllInstancesOfProtocol (&gEfiPciRootBridgeIoProtocolGuid,
-- 
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47221): https://edk2.groups.io/g/devel/message/47221
Mute This Topic: https://groups.io/mt/34129361/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list