diff options
author | Laszlo Ersek <lersek@redhat.com> | 2013-11-12 18:35:32 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-11-12 18:35:32 +0000 |
commit | 2590861a5b2b453470f1f894c948ec1be514a428 (patch) | |
tree | 84827373ff718a4b6c71e316752e725c50f628e2 | |
parent | 9d35ac2611aecc7c6c28597e69cff18e20e40a05 (diff) | |
download | edk2-2590861a5b2b453470f1f894c948ec1be514a428.zip edk2-2590861a5b2b453470f1f894c948ec1be514a428.tar.gz edk2-2590861a5b2b453470f1f894c948ec1be514a428.tar.bz2 |
OvmfPkg/BdsPlatform: don't restore NvVars from disk when flash is present
QemuFlashFvbServicesRuntimeDxe provides actual persistent storage for
non-volatile variables. When it is active, any on-disk NvVars file counts
as a stale source of variables -- hence don't load these files in BDS.
This also allows Secure Boot settings (eg. enrolled keys) to survive cold
VM reboots.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14844 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c | 15 | ||||
-rw-r--r-- | OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf | 1 |
2 files changed, 11 insertions, 5 deletions
diff --git a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c index ba6af2c..ab9c93e 100644 --- a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c @@ -1073,11 +1073,16 @@ Returns: ConnectRootBridge ();
- //
- // Try to restore variables from the hard disk early so
- // they can be used for the other BDS connect operations.
- //
- PlatformBdsRestoreNvVarsFromHardDisk ();
+ if (PcdGetBool (PcdOvmfFlashVariablesEnable)) {
+ DEBUG ((EFI_D_INFO, "PlatformBdsPolicyBehavior: not restoring NvVars "
+ "from disk since flash variables appear to be supported.\n"));
+ } else {
+ //
+ // Try to restore variables from the hard disk early so
+ // they can be used for the other BDS connect operations.
+ //
+ PlatformBdsRestoreNvVarsFromHardDisk ();
+ }
//
// Init the time out value
diff --git a/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf b/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf index 7f7f473..a2b72ba 100644 --- a/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf +++ b/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf @@ -57,6 +57,7 @@ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPlatformBootTimeOut
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile
gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable
[Pcd.IA32, Pcd.X64]
gEfiMdePkgTokenSpaceGuid.PcdFSBClock
|