]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
OvmfPkg/BdsPlatform: don't restore NvVars from disk when flash is present
[mirror_edk2.git] / OvmfPkg / Library / PlatformBdsLib / BdsPlatform.c
index ba6af2caefd8510708610b11777caf40dd88060d..ab9c93eaf8711a051222f67367710305a0aa2555 100644 (file)
@@ -1073,11 +1073,16 @@ Returns:
 \r
   ConnectRootBridge ();\r
 \r
-  //\r
-  // Try to restore variables from the hard disk early so\r
-  // they can be used for the other BDS connect operations.\r
-  //\r
-  PlatformBdsRestoreNvVarsFromHardDisk ();\r
+  if (PcdGetBool (PcdOvmfFlashVariablesEnable)) {\r
+    DEBUG ((EFI_D_INFO, "PlatformBdsPolicyBehavior: not restoring NvVars "\r
+      "from disk since flash variables appear to be supported.\n"));\r
+  } else {\r
+    //\r
+    // Try to restore variables from the hard disk early so\r
+    // they can be used for the other BDS connect operations.\r
+    //\r
+    PlatformBdsRestoreNvVarsFromHardDisk ();\r
+  }\r
 \r
   //\r
   // Init the time out value\r