public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] SimicsOpenBoardPkg: Always set the boot priority by default
@ 2019-09-13 16:57 David Wei
  2019-09-13 21:54 ` [edk2-devel] " Kubacki, Michael A
  0 siblings, 1 reply; 2+ messages in thread
From: David Wei @ 2019-09-13 16:57 UTC (permalink / raw)
  To: devel
  Cc: Hao Wu, Liming Gao, Ankit Sinha, Agyeman Prince,
	Kubacki Michael A, Nate DeSimone, Michael D Kinney

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@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Agyeman Prince <prince.agyeman@intel.com>
Cc: Kubacki Michael A <michael.a.kubacki@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>

Signed-off-by: David Wei <david.y.wei@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-13 21:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-13 16:57 [PATCH] SimicsOpenBoardPkg: Always set the boot priority by default David Wei
2019-09-13 21:54 ` [edk2-devel] " Kubacki, Michael A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox