From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: david.y.wei@intel.com) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Fri, 13 Sep 2019 09:57:55 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2019 09:57:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,492,1559545200"; d="scan'208";a="176341823" Received: from ydwei-desk.amr.corp.intel.com ([10.24.15.168]) by orsmga007.jf.intel.com with ESMTP; 13 Sep 2019 09:57:54 -0700 From: "David Wei" To: devel@edk2.groups.io Cc: Hao Wu , Liming Gao , Ankit Sinha , Agyeman Prince , Kubacki Michael A , Nate DeSimone , Michael D Kinney Subject: [PATCH] SimicsOpenBoardPkg: Always set the boot priority by default Date: Fri, 13 Sep 2019 09:57:54 -0700 Message-Id: <075b6bb19fdbcdd6bb8415af088f6eff5e3e9c1d.1568393577.git.david.y.wei@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 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 Cc: Liming Gao Cc: Ankit Sinha Cc: Agyeman Prince Cc: Kubacki Michael A Cc: Nate DeSimone Cc: Michael D Kinney Signed-off-by: David Wei --- .../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