FakeCapsuleDxe is a system for emulating capsule updates.

The basic mechanism is simple - create variables with the GUID
32e678e9-263f-4eae-a239-38a3cad6a1b5 and whatever names you choose.
When the firmware starts, each one of these variables will become an
entry in the EFI System Resource Table (ESRT).

When UpdateCapsule() is called, the GUID from the Capsule header will be
checked against the GUID in each variable, and the first one it finds
(with unspecified search order) will be examined.  The capsule data
should be also be a valid ESRT table entry with the same GUID.  If the
FwVersion field in the new payload entry is less than or equal to the
LowestSupportedFwVersion field in the existing entry, and the flags
match correctly, the old variable data is replaced with the new capsule
payload data.  In any case its LastAttemptVersion and LastAttemptStatus
are updated and a Capsule#### variable is created to reflect the status.

Additionally, this patch enables this feature on OvmfPkg and
ArmPlatformPkg/ArmVirtualizationPkg builds.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Peter Jones <[email protected]>
---
 .../ArmVirtualizationPkg/ArmVirtualization.dsc.inc |   4 +-
 .../ArmVirtualizationPkg/ArmVirtualizationQemu.dsc |   4 +-
 .../ArmVirtualizationPkg/ArmVirtualizationQemu.fdf |   1 +
 .../ArmVirtualizationPkg/ArmVirtualizationXen.dsc  |   4 +-
 .../ArmVirtualizationPkg/ArmVirtualizationXen.fdf  |   1 +
 .../Universal/BdsDxe/BdsDxe.inf                    |   1 +
 .../Universal/BdsDxe/BdsEntry.c                    |   3 +
 MdeModulePkg/Include/Guid/FakeCapsuleDxe.h         |  29 ++
 .../Include/Library/Esrt.h                         |  33 +--
 MdeModulePkg/Include/Library/FakeCapsuleLib.h      |  73 +++++
 .../Library/FakeCapsuleLib/FakeCapsuleBase.c       | 231 +++++++++++++++
 .../Library/FakeCapsuleLib/FakeCapsuleBase.inf     |  56 ++++
 .../Library/FakeCapsuleLib/FakeCapsuleLib.c        | 295 +++++++++++++++++++
 .../Library/FakeCapsuleLib/FakeCapsuleLib.inf      |  55 ++++
 MdeModulePkg/MdeModulePkg.dec                      |  24 ++
 .../Universal/FakeCapsuleDxe/FakeCapsuleDxe.c      | 325 +++++++++++++++++++++
 .../Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf    |  57 ++++
 OvmfPkg/OvmfPkgIa32.dsc                            |   7 +-
 OvmfPkg/OvmfPkgIa32.fdf                            |   1 +
 OvmfPkg/OvmfPkgIa32X64.dsc                         |   7 +-
 OvmfPkg/OvmfPkgIa32X64.fdf                         |   1 +
 OvmfPkg/OvmfPkgX64.dsc                             |   7 +-
 OvmfPkg/OvmfPkgX64.fdf                             |   1 +
 Vlv2TbltDevicePkg/PlatformPkg.dec                  |   2 -
 24 files changed, 1197 insertions(+), 25 deletions(-)
 create mode 100644 MdeModulePkg/Include/Guid/FakeCapsuleDxe.h
 rename {Vlv2TbltDevicePkg => MdeModulePkg}/Include/Library/Esrt.h (56%)
 create mode 100644 MdeModulePkg/Include/Library/FakeCapsuleLib.h
 create mode 100644 MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.c
 create mode 100644 MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
 create mode 100644 MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.c
 create mode 100644 MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
 create mode 100644 MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.c
 create mode 100644 MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf

diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc 
b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc
index 51c1632..af4e2da 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc
@@ -195,7 +195,8 @@
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
-  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
+  CapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
+  FakeCapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
 
 [LibraryClasses.ARM]
   #
@@ -249,6 +250,7 @@
   gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|TRUE
 
   gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportCapsuleResultVar|TRUE
 
 [PcdsFixedAtBuild.common]
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Virtualization Platform"
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc 
b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc
index 07ae63a..d50ffe9 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc
@@ -50,7 +50,8 @@
   TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
 
 !ifdef INTEL_BDS
-  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
+  CapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
+  FakeCapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
   GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
   
PlatformBdsLib|ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -254,6 +255,7 @@
   ArmPkg/Drivers/CpuDxe/CpuDxe.inf
   MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
   MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
+  MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.fdf 
b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.fdf
index e0ec44b..594ab0e 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.fdf
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.fdf
@@ -114,6 +114,7 @@ READ_LOCK_STATUS   = TRUE
   INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
   INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
   INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
+  INF MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
   INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
   INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
   INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.dsc 
b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.dsc
index b24d096..f3030c4 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.dsc
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.dsc
@@ -53,7 +53,8 @@
 
   TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
 
-  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
+  CapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
+  FakeCapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
   GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
   
PlatformBdsLib|ArmPlatformPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -185,6 +186,7 @@
   ArmPkg/Drivers/CpuDxe/CpuDxe.inf
   MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
   MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
+  MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
 
   MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf
diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.fdf 
b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.fdf
index 270a14c..dd9bb61 100644
--- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.fdf
+++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.fdf
@@ -119,6 +119,7 @@ READ_LOCK_STATUS   = TRUE
   INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
   INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
   INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
+  INF MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
   INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
 
   INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf 
b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
index d8b845f..7a8ca05 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -183,6 +183,7 @@
 [FeaturePcd]
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDeprecate    ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport                   ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdSupportCapsuleResultVar             ## CONSUMES
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootlogoOnlyEnable ## CONSUMES
 
 [Pcd]
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c 
b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
index ae7ad21..f005f2a 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -412,6 +412,9 @@ BdsFormalizeEfiGlobalVariable (
   //
   OsIndicationSupport = EFI_OS_INDICATIONS_BOOT_TO_FW_UI \
                       | EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED;
+  if (FeaturePcdGet(PcdSupportCapsuleResultVar)) {
+    OsIndicationsSupport |= EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED;
+  }
 
   BdsDxeSetVariableAndReportStatusCodeOnError (
     L"OsIndicationsSupported",
diff --git a/MdeModulePkg/Include/Guid/FakeCapsuleDxe.h 
b/MdeModulePkg/Include/Guid/FakeCapsuleDxe.h
new file mode 100644
index 0000000..ff086cd
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/FakeCapsuleDxe.h
@@ -0,0 +1,29 @@
+/** @file
+  GUID to be used to identify the DxeCapsuleFake payloads.
+
+  Copyright (C) 2015, Red Hat, Inc.
+
+  This program and the accompanying materials are licensed and made
+  available under the terms and conditions of the BSD License that
+  accompanies this distribution. The full text of the license may be found
+  at http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+  IMPLIED.
+
+**/
+
+#ifndef __FAKE_CAPSULE_HEADER_GUID__
+#define __FAKE_CAPSULE_HEADER_GUID__
+
+#define FAKE_CAPSULE_HEADER_GUID \
+{0x32e678e9, 0x263f, 0x4eae, {0xa2, 0x39, 0x38, 0xa3, 0xca, 0xd6, 0xa1, 0xb5}}
+
+#define EFI_CAPSULE_REPORT_GUID \
+{0x39b68c46, 0xf7fb, 0x441b, {0xb6, 0xec, 0x16, 0xb0, 0xf6, 0x98, 0x21, 0xf3}}
+
+extern EFI_GUID gFakeCapsuleHeaderGuid;
+extern EFI_GUID gEfiCapsuleReportGuid;
+
+#endif
diff --git a/Vlv2TbltDevicePkg/Include/Library/Esrt.h 
b/MdeModulePkg/Include/Library/Esrt.h
similarity index 56%
rename from Vlv2TbltDevicePkg/Include/Library/Esrt.h
rename to MdeModulePkg/Include/Library/Esrt.h
index 06977b6..15e15ee 100644
--- a/Vlv2TbltDevicePkg/Include/Library/Esrt.h
+++ b/MdeModulePkg/Include/Library/Esrt.h
@@ -1,16 +1,15 @@
 /*++
 
   Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>
-                                                                               
    

-  This program and the accompanying materials are licensed and made available 
under

-  the terms and conditions of the BSD License that accompanies this 
distribution.  

-  The full text of the license may be found at                                 
    

-  http://opensource.org/licenses/bsd-license.php.                              
    

-                                                                               
    

-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,        
    

-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.    

-                                                                               
    

 
+  This program and the accompanying materials are licensed and made
+  available under the terms and conditions of the BSD License that
+  accompanies this distribution.  The full text of the license may be
+  found at http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+  IMPLIED.
 
 Module Name:
 
@@ -54,26 +53,26 @@ EFI_STATUS
 typedef
 EFI_STATUS
 (EFIAPI *ESRT_UPDATE_TABLE_ENTRY_BY_GUID) (
-       IN EFI_GUID FwEntryGuid,
-       IN FW_RES_ENTRY *FwEntry
+  IN EFI_GUID FwEntryGuid,
+  IN FW_RES_ENTRY *FwEntry
 );
 
 typedef
 EFI_STATUS
 (EFIAPI *ESRT_GET_FW_ENTRY_BY_GUID) (
-    IN EFI_GUID FwEntryGuid,
-       OUT FW_RES_ENTRY *FwEntry
+  IN EFI_GUID FwEntryGuid,
+  OUT FW_RES_ENTRY *FwEntry
 );
 
-
 #pragma pack()
 
 typedef struct _ESRT_OPERATION_PROTOCOL {
-   ESRT_POPULATE_TABLE                                 EsrtPopulateTable;
-   ESRT_UPDATE_TABLE_ENTRY_BY_GUID             EsrtUpdateTableEntryByGuid;
-   ESRT_GET_FW_ENTRY_BY_GUID                   EsrtGetFwEntryByGuid;
+  ESRT_POPULATE_TABLE             EsrtPopulateTable;
+  ESRT_UPDATE_TABLE_ENTRY_BY_GUID EsrtUpdateTableEntryByGuid;
+  ESRT_GET_FW_ENTRY_BY_GUID       EsrtGetFwEntryByGuid;
 } ESRT_OPERATION_PROTOCOL;
 
 extern EFI_GUID gEfiEsrtOperationProtocolGuid;
+extern EFI_GUID gEfiEsrtTableGuid;
 
 #endif
diff --git a/MdeModulePkg/Include/Library/FakeCapsuleLib.h 
b/MdeModulePkg/Include/Library/FakeCapsuleLib.h
new file mode 100644
index 0000000..d329cb2
--- /dev/null
+++ b/MdeModulePkg/Include/Library/FakeCapsuleLib.h
@@ -0,0 +1,73 @@
+/** @file
+  Fake Dxe Capsule Library instance that just keeps ESRT data in UEFI
+  Variables.
+
+  Copyright 2015 Red Hat, Inc.
+
+  This program and the accompanying materials are licensed and made
+  available under the terms and conditions of the BSD License which
+  accompanies this distribution.  The full text of the license may be
+  found at http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+  IMPLIED.
+
+**/
+#ifndef _FAKE_CAPSULE_H
+#define _FAKE_CAPSULE_H
+
+//
+// Firmware Type Definitions
+//
+#define ESRT_FW_TYPE_UNKNOWN        0x00000000
+#define ESRT_FW_TYPE_SYSTEMFIRMWARE 0x00000001
+#define ESRT_FW_TYPE_DEVICEFIRMWARE 0x00000002
+#define ESRT_FW_TYPE_UEFIDRIVER     0x00000003
+//
+// Last Attempt Status Values
+//
+#define LAST_ATTEMPT_STATUS_SUCCESS                       0x00000000
+#define LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL            0x00000001
+#define LAST_ATTEMPT_STATUS_ERROR_INSUFFICIENT_RESOURCES  0x00000002
+#define LAST_ATTEMPT_STATUS_ERROR_INCORRECT_VERSION       0x00000003
+#define LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT          0x00000004
+#define LAST_ATTEMPT_STATUS_ERROR_AUTH_ERROR              0x00000005
+#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_AC              0x00000006
+#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_BATT            0x00000007
+
+typedef struct {
+  UINT32      VariableTotalSize;
+  UINT32      Reserved; //for alignment
+  EFI_GUID    CapsuleGuid;
+  EFI_TIME    CapsuleProcessed;
+  EFI_STATUS  CapsuleStatus;
+} EFI_CAPSULE_RESULT_VARIABLE_HEADER;
+
+EFI_STATUS
+EFIAPI
+FindEsrtVariableByCapsuleGuid (
+  IN EFI_GUID *CapsuleGuid,
+  IN OUT EFI_GUID *VendorGuid,
+  IN OUT CHAR16 **VariableName,
+  IN OUT VOID **VariableData,
+  OUT UINTN *VariableDataSize,
+  OUT UINT32 *VariableAttributes
+  );
+
+EFI_STATUS
+EFIAPI
+FindFreeNumberName (
+  CHAR16 **Name,
+  CHAR16 *Prefix,
+  EFI_GUID *VendorGuid,
+  UINT16 Limit
+  );
+
+EFI_STATUS
+EFIAPI
+FakeCapsuleCountEntries(
+  UINTN *NEntries
+  );
+
+#endif /* _FAKE_CAPSULE_H */
diff --git a/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.c 
b/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.c
new file mode 100644
index 0000000..f88549e
--- /dev/null
+++ b/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.c
@@ -0,0 +1,231 @@
+/** @file
+  Fake Dxe Capsule Library instance that just keeps ESRT data in UEFI
+  Variables.
+
+  Copyright 2015 Red Hat, Inc.
+
+  This program and the accompanying materials are licensed and made
+  available under the terms and conditions of the BSD License which
+  accompanies this distribution.  The full text of the license may be
+  found at http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+  IMPLIED.
+
+**/
+#include <Uefi.h>
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/CapsuleLib.h>
+#include <Library/DebugLib.h>
+#include <Library/Esrt.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/PrintLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Guid/FakeCapsuleDxe.h>
+#include <Guid/EventGroup.h>
+
+#include <Library/FakeCapsuleLib.h>
+
+/**
+  The firmware checks whether the capsule image is supported by the CapsuleGuid
+  in CapsuleHeader or other specific information in capsule image.
+
+  @param  CapsuleHeader    Point to the UEFI capsule image to be checked.
+
+  @retval EFI_UNSUPPORTED  Input capsule is not supported by the firmware.
+**/
+EFI_STATUS
+EFIAPI
+SupportCapsuleImage (
+  IN EFI_CAPSULE_HEADER *CapsuleHeader
+  )
+{
+  RETURN_STATUS Status;
+  FW_RES_ENTRY  *CapPayload;
+  EFI_GUID      VendorGuid = { 0, };
+  CHAR16        *VariableName = NULL;
+  VOID          *VariableData = NULL;
+  UINTN         VariableDataSize = 0;
+  UINT32        VariableAttributes = 0;
+
+  DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
+  if (CapsuleHeader->CapsuleImageSize - CapsuleHeader->HeaderSize
+      != sizeof (FW_RES_ENTRY)) {
+    DEBUG ((EFI_D_ERROR,
+            "%a:%d: CapsuleImageSize: %d sizeof (FW_RES_ENTRY): %d\n",
+            __FUNCTION__, __LINE__,
+            CapsuleHeader->CapsuleImageSize, sizeof (FW_RES_ENTRY)));
+    return EFI_UNSUPPORTED;
+  }
+
+  CapPayload = (FW_RES_ENTRY *)
+    ((UINT8 *)CapsuleHeader + CapsuleHeader->HeaderSize);
+
+  Status = FindEsrtVariableByCapsuleGuid (&CapPayload->FwClass,
+                                          &VendorGuid,
+                                          &VariableName,
+                                          &VariableData,
+                                          &VariableDataSize,
+                                          &VariableAttributes
+                                         );
+  if (EFI_ERROR (Status)) {
+    DEBUG ((EFI_D_ERROR, "%a:%d: FindEsrtVariableByCapsuleGuid: %r\n",
+            __FUNCTION__, __LINE__, Status));
+    return EFI_UNSUPPORTED;
+  }
+
+  FreePool (VariableName);
+  FreePool (VariableData);
+
+  if (CapPayload->FwType > ESRT_FW_TYPE_UEFIDRIVER) {
+    DEBUG ((EFI_D_ERROR, "%a:%d: CapPayload->FwType: %d\n",
+            __FUNCTION__, __LINE__, CapPayload->FwType));
+    return EFI_UNSUPPORTED;
+  }
+
+  return EFI_SUCCESS;
+}
+
+STATIC
+EFI_STATUS
+EFIAPI
+ReportStatus (
+  IN EFI_CAPSULE_HEADER *CapsuleHeader,
+  IN FW_RES_ENTRY *CapPayload,
+  IN FW_RES_ENTRY *VarPayload,
+  IN UINT32 LastAttemptStatus
+  )
+{
+  RETURN_STATUS                       Status;
+  CHAR16                              *Name = NULL;
+  EFI_CAPSULE_RESULT_VARIABLE_HEADER  Result;
+  UINTN                               NEntries = 0;
+
+  DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
+  Status = FakeCapsuleCountEntries (&NEntries);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  Status = FindFreeNumberName (&Name,
+                               L"Capsule",
+                               &gEfiCapsuleReportGuid,
+                               NEntries * 3
+                               );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  if (VarPayload) {
+    VarPayload->LastAttemptStatus = LastAttemptStatus;
+  }
+
+  Result.VariableTotalSize = sizeof (Result);
+  Result.Reserved = 0;
+  CopyMem (&Result.CapsuleGuid, &CapPayload->FwClass, sizeof (EFI_GUID));
+  gRT->GetTime (&Result.CapsuleProcessed, NULL);
+  Result.CapsuleStatus = LastAttemptStatus;
+
+  Status = gRT->SetVariable (Name,
+                             &gEfiCapsuleReportGuid,
+                             EFI_VARIABLE_NON_VOLATILE
+                             | EFI_VARIABLE_BOOTSERVICE_ACCESS
+                             | EFI_VARIABLE_RUNTIME_ACCESS,
+                             sizeof (Result),
+                             &Result
+                             );
+  if (EFI_ERROR (Status)) {
+    FreePool (Name);
+    return Status;
+  }
+
+  Status = gRT->SetVariable (L"CapsuleLast",
+                             &gEfiCapsuleReportGuid,
+                             EFI_VARIABLE_NON_VOLATILE
+                             | EFI_VARIABLE_BOOTSERVICE_ACCESS
+                             | EFI_VARIABLE_RUNTIME_ACCESS,
+                             StrLen (Name),
+                             Name
+                             );
+  FreePool (Name);
+
+  return Status;
+}
+
+/**
+  The firmware specific implementation processes the capsule image
+  if it recognized the format of this capsule image.
+
+  @param  CapsuleHeader    Point to the UEFI capsule image to be processed.
+
+  @retval EFI_UNSUPPORTED  Capsule image is not supported by the firmware.
+**/
+EFI_STATUS
+EFIAPI
+ProcessCapsuleImage (
+  IN EFI_CAPSULE_HEADER *CapsuleHeader
+  )
+{
+  RETURN_STATUS Status;
+  FW_RES_ENTRY  *CapPayload;
+  EFI_GUID      VendorGuid = { 0, };
+  CHAR16        *VariableName = NULL;
+  VOID          *VariableData = NULL;
+  UINTN         VariableDataSize = 0;
+  UINT32        VariableAttributes = 0;
+  FW_RES_ENTRY  *VarPayload;
+
+  DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
+  CapPayload = (FW_RES_ENTRY *)
+    ((UINT8 *)CapsuleHeader + CapsuleHeader->HeaderSize);
+  Status = FindEsrtVariableByCapsuleGuid (&CapPayload->FwClass,
+                                          &VendorGuid,
+                                          &VariableName,
+                                          &VariableData,
+                                          &VariableDataSize,
+                                          &VariableAttributes
+                                          );
+  if (EFI_ERROR (Status)) {
+    return ReportStatus (CapsuleHeader,
+                         CapPayload,
+                         NULL,
+                         Status == EFI_OUT_OF_RESOURCES
+                         ? LAST_ATTEMPT_STATUS_ERROR_INSUFFICIENT_RESOURCES
+                         : LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL
+                         );
+  }
+
+  VarPayload = (FW_RES_ENTRY *)VariableData;
+  VarPayload->LastAttemptVersion = CapPayload->FwVersion;
+  if (CapPayload->FwVersion < VarPayload->FwLstCompatVersion) {
+    Status = ReportStatus (CapsuleHeader,
+                           CapPayload,
+                           VarPayload,
+                           LAST_ATTEMPT_STATUS_ERROR_INCORRECT_VERSION
+                           );
+  } else {
+    VarPayload->LastAttemptStatus = LAST_ATTEMPT_STATUS_SUCCESS;
+    VarPayload->FwVersion = CapPayload->FwVersion;
+
+    Status = ReportStatus (CapsuleHeader,
+                           CapPayload,
+                           VarPayload,
+                           LAST_ATTEMPT_STATUS_SUCCESS
+                           );
+  }
+
+  Status = gRT->SetVariable (VariableName,
+                             &gFakeCapsuleHeaderGuid,
+                             VariableAttributes,
+                             sizeof (FW_RES_ENTRY),
+                             VarPayload
+                             );
+  FreePool (VariableName);
+  FreePool (VariableData);
+
+  return Status;
+}
diff --git a/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf 
b/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
new file mode 100644
index 0000000..16f7912
--- /dev/null
+++ b/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
@@ -0,0 +1,56 @@
+## @file
+#  Fake Capsule Library.
+#
+#  Copyright 2015 Red Hat, Inc.
+#
+#  This program and the accompanying materials are licensed and made
+#  available under the terms and conditions of the BSD License which
+#  accompanies this distribution. The full text of the license may be
+#  found at http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+#  IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = FakeCapsuleBase
+  FILE_GUID                      = 0964d598-b0e8-4d63-beb8-93498557e23d
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = CapsuleLib
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC
+#
+
+[Sources]
+  FakeCapsuleBase.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseLib
+  BaseMemoryLib
+  DebugLib
+  MemoryAllocationLib
+  PrintLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+  UefiRuntimeServicesTableLib
+  FakeCapsuleLib
+
+[Protocols]
+  gEfiEsrtOperationProtocolGuid
+
+[Guids]
+  gEfiCapsuleReportGuid
+  gEfiEndOfDxeEventGroupGuid
+  gEfiEsrtTableGuid
+  gFakeCapsuleHeaderGuid
diff --git a/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.c 
b/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.c
new file mode 100644
index 0000000..21f90c5
--- /dev/null
+++ b/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.c
@@ -0,0 +1,295 @@
+/** @file
+  Fake Dxe Capsule Library instance that just keeps ESRT data in UEFI
+  Variables.
+
+  Copyright 2015 Red Hat, Inc.
+
+  This program and the accompanying materials are licensed and made
+  available under the terms and conditions of the BSD License which
+  accompanies this distribution.  The full text of the license may be
+  found at http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+  IMPLIED.
+
+**/
+#include <Uefi.h>
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/CapsuleLib.h>
+#include <Library/DebugLib.h>
+#include <Library/Esrt.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/PrintLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Guid/FakeCapsuleDxe.h>
+#include <Guid/EventGroup.h>
+
+#include <Library/FakeCapsuleLib.h>
+
+//
+// Find a variable in our guidspace, with the capsule guid as the key.
+//
+EFI_STATUS
+EFIAPI
+FindEsrtVariableByCapsuleGuid (
+  IN EFI_GUID *CapsuleGuid,
+  IN OUT EFI_GUID *VendorGuid,
+  IN OUT CHAR16 **VariableName,
+  IN OUT VOID **VariableData,
+  OUT UINTN *VariableDataSize,
+  OUT UINT32 *VariableAttributes
+  )
+{
+  RETURN_STATUS Status;
+  FW_RES_ENTRY  *VarPayload;
+  UINTN         VariableNameBufferSize;
+  UINTN         VariableNameSize;
+  UINTN         VariableDataBufferSize;
+
+  DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
+  if (!VariableName) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  if (!*VariableName) {
+    VariableNameBufferSize = sizeof (CHAR16);
+    *VariableName = AllocateZeroPool (VariableNameBufferSize);
+    if (!*VariableName) {
+      return EFI_OUT_OF_RESOURCES;
+    }
+  } else {
+    VariableNameBufferSize = StrSize (*VariableName);
+  }
+
+  VariableDataBufferSize = *VariableDataSize;
+
+  while (1) {
+    //
+    // Get the next variable name and guid
+    //
+    VariableNameSize = VariableNameBufferSize;
+    Status = gRT->GetNextVariableName (&VariableNameSize,
+                                       *VariableName,
+                                       VendorGuid
+                                       );
+    if (Status == EFI_BUFFER_TOO_SMALL) {
+      VOID  *NewBuffer;
+      //
+      // The currently allocated VariableName buffer is too small,
+      // so we allocate a larger buffer, and copy the old buffer
+      // to it.
+      //
+      NewBuffer = AllocatePool (VariableNameSize);
+      if (NewBuffer == NULL) {
+        Status = EFI_OUT_OF_RESOURCES;
+        break;
+      }
+      if (*VariableName != NULL) {
+        CopyMem (NewBuffer, *VariableName, VariableNameBufferSize);
+        FreePool (*VariableName);
+        *VariableName = NULL;
+      }
+      *VariableName = NewBuffer;
+      VariableNameBufferSize = VariableNameSize;
+
+      //
+      // Try to get the next variable name again with the larger buffer.
+      //
+      Status = gRT->GetNextVariableName (&VariableNameSize,
+                                         *VariableName,
+                                         VendorGuid
+                                        );
+    }
+
+    if (EFI_ERROR (Status)) {
+      break;
+    }
+
+    Status = EFI_NOT_FOUND;
+    if (!CompareGuid(VendorGuid, &gFakeCapsuleHeaderGuid)) {
+      continue;
+    }
+
+    //
+    // Get the variable data and attributes
+    //
+    *VariableDataSize = VariableDataBufferSize;
+    Status = gRT->GetVariable (*VariableName,
+                               VendorGuid,
+                               VariableAttributes,
+                               VariableDataSize,
+                               *VariableData
+                               );
+    if (Status == EFI_BUFFER_TOO_SMALL) {
+      if (*VariableDataSize != sizeof (FW_RES_ENTRY)) {
+        *VariableDataSize = sizeof (FW_RES_ENTRY);
+        Status = EFI_NOT_FOUND;
+        continue;
+      }
+      //
+      // The currently allocated VariableData buffer is too small,
+      // so we allocate a larger buffer.
+      //
+      if (VariableDataBufferSize != 0) {
+        FreePool (*VariableData);
+        *VariableData = NULL;
+        VariableDataBufferSize = 0;
+      }
+      *VariableData = AllocatePool (*VariableDataSize);
+      if (*VariableData == NULL) {
+        Status = EFI_OUT_OF_RESOURCES;
+        break;
+      }
+      VariableDataBufferSize = *VariableDataSize;
+
+      //
+      // Try to read the variable again with the larger buffer.
+      //
+      Status = gRT->GetVariable (*VariableName,
+                                 VendorGuid,
+                                 VariableAttributes,
+                                 VariableDataSize,
+                                 *VariableData
+                                 );
+    }
+    if (EFI_ERROR (Status)) {
+      break;
+    }
+
+    Status = EFI_NOT_FOUND;
+    if (*VariableDataSize != sizeof (FW_RES_ENTRY)) {
+      continue;
+    }
+
+    VarPayload = *VariableData;
+    if (CapsuleGuid && !CompareGuid(CapsuleGuid, &VarPayload->FwClass)) {
+      continue;
+    }
+
+    Status = EFI_SUCCESS;
+    break;
+  }
+
+  if (EFI_ERROR (Status)) {
+    if (Status != EFI_NOT_FOUND) {
+      DEBUG ((EFI_D_ERROR, "%a:%d: Error: %r\n", __FUNCTION__, __LINE__,
+              Status));
+    }
+    if (*VariableName != NULL) {
+      FreePool (*VariableName);
+      *VariableName = NULL;
+    }
+
+    if (*VariableData != NULL) {
+      FreePool (*VariableData);
+      *VariableData = NULL;
+      *VariableDataSize = 0;
+    }
+  }
+  return Status;
+}
+
+EFI_STATUS
+EFIAPI
+FindFreeNumberName (
+  CHAR16 **Name,
+  CHAR16 *Prefix,
+  EFI_GUID *VendorGuid,
+  UINT16 Limit
+  )
+{
+  RETURN_STATUS Status;
+  UINT32        i;
+  CHAR16        *NameBuf;
+  UINTN         BufferSize;
+
+  DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
+  BufferSize = (StrLen(Prefix) + StrSize(L"0000")) * sizeof (CHAR16);
+
+  NameBuf = AllocateZeroPool (BufferSize);
+  if (!NameBuf) {
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  for (i = 0; i <= Limit; i++) {
+    UINT32  Attributes;
+    UINTN   VariableDataSize = 0;
+
+    UnicodeSPrint (NameBuf, BufferSize, L"%s%04X", Prefix, i);
+
+    Status = gRT->GetVariable (NameBuf,
+                               VendorGuid,
+                               &Attributes,
+                               &VariableDataSize,
+                               NULL
+                               );
+    if (Status == EFI_NOT_FOUND) {
+      *Name = NameBuf;
+      return EFI_SUCCESS;
+    }
+  }
+
+  FreePool (NameBuf);
+
+  return EFI_NOT_FOUND;
+}
+
+EFI_STATUS
+EFIAPI
+FakeCapsuleCountEntries(
+  UINTN *NEntries
+  )
+{
+  RETURN_STATUS             Status;
+  EFI_GUID                  VendorGuid = { 0, };
+  CHAR16                    *VariableName = NULL;
+  VOID                      *VariableData = NULL;
+  UINTN                     VariableDataSize = sizeof (FW_RES_ENTRY);
+  UINT32                    VariableAttributes = 0;
+
+  DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
+  if (!NEntries) {
+    return EFI_INVALID_PARAMETER;
+  }
+  *NEntries = 0;
+
+  VariableData = AllocateZeroPool (VariableDataSize);
+  if (!VariableData) {
+    DEBUG ((EFI_D_ERROR, "%a:%d: AllocateZeroPool(%d) failed\n", __FUNCTION__,
+           __LINE__, VariableDataSize));
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  while (1) {
+    Status = FindEsrtVariableByCapsuleGuid (NULL,
+                                            &VendorGuid,
+                                            &VariableName,
+                                            &VariableData,
+                                            &VariableDataSize,
+                                            &VariableAttributes
+                                            );
+    if (Status == EFI_NOT_FOUND) {
+      Status = EFI_SUCCESS;
+      break;
+    }
+    if (EFI_ERROR (Status)) {
+      DEBUG ((EFI_D_ERROR,
+              "%a: FindEsrtVariableByCapsuleGuid failed: %r\n",
+              __FUNCTION__,
+              Status
+             ));
+      break;
+    }
+    (*NEntries)++;
+  }
+
+  if (VariableData) {
+    FreePool (VariableData);
+  }
+
+  return Status;
+}
diff --git a/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf 
b/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
new file mode 100644
index 0000000..d6f0ece
--- /dev/null
+++ b/MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
@@ -0,0 +1,55 @@
+## @file
+#  Fake Capsule Library.
+#
+#  Copyright 2015 Red Hat, Inc.
+#
+#  This program and the accompanying materials are licensed and made
+#  available under the terms and conditions of the BSD License which
+#  accompanies this distribution. The full text of the license may be
+#  found at http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+#  IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = FakeCapsuleLib
+  FILE_GUID                      = 735f6e33-97fd-4796-b386-bbeabfad5b2f
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = FakeCapsuleLib
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC
+#
+
+[Sources]
+  FakeCapsuleLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseLib
+  BaseMemoryLib
+  DebugLib
+  MemoryAllocationLib
+  PrintLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+  UefiRuntimeServicesTableLib
+
+[Protocols]
+  gEfiEsrtOperationProtocolGuid
+
+[Guids]
+  gEfiCapsuleReportGuid
+  gEfiEndOfDxeEventGroupGuid
+  gEfiEsrtTableGuid
+  gFakeCapsuleHeaderGuid
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index c00319a..de6aed1 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -62,6 +62,9 @@
   ##  @libraryclass  Defines a set of interfaces on how to process capusle 
image update.
   CapsuleLib|Include/Library/CapsuleLib.h
 
+  ##  @libraryclass  Defines a set of interfaces on how to create capusle 
image update options.
+  FakeCapsuleLib|Include/Library/FakeCapsuleLib.h
+
   ##  @libraryclass  Library for Deferred Procedure Calls.
   DpcLib|Include/Library/DpcLib.h
 
@@ -154,6 +157,18 @@
   #  Include/Guid/CapsuleVendor.h
   gEfiCapsuleVendorGuid          = { 0x711C703F, 0xC285, 0x4B10, { 0xA3, 0xB0, 
0x36, 0xEC, 0xBD, 0x3C, 0x8B, 0xE2 }}
 
+  ## Fake capsule variable VendorGuid
+  #  Include/Guid/FakeCapsuleDxe.h
+  gFakeCapsuleHeaderGuid          = {0x32e678e9, 0x263f, 0x4eae, {0xa2, 0x39, 
0x38, 0xa3, 0xca, 0xd6, 0xa1, 0xb5}}
+
+  ## Guid for reporting capsule results
+  #  Include/Guid/FakeCapsuleDxe.h
+  gEfiCapsuleReportGuid           = {0x39b68c46, 0xf7fb, 0x441b, {0xb6, 0xec, 
0x16, 0xb0, 0xf6, 0x98, 0x21, 0xf3}}
+
+  ## ESRT configuration table guid
+  #  Include/Library/Esrt.h
+  gEfiEsrtTableGuid               = {0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 
0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80}}
+
   ## Guid specifiy the device is the StdErr device.
   #  Include/Guid/StandardErrorDevice.h
   gEfiStandardErrorDeviceGuid    = { 0xD3B36F2D, 0xD551, 0x11D4, { 0x9A, 0x46, 
0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }}
@@ -396,6 +411,9 @@
   ## Include/Protocol/FormBrowserEx2.h
   gEdkiiFormBrowserEx2ProtocolGuid = { 0xa770c357, 0xb693, 0x4e6d, { 0xa6, 
0xcf, 0xd2, 0x1c, 0x72, 0x8e, 0x55, 0xb } }
 
+  ## Include/Protocol/Es
+  gEfiEsrtOperationProtocolGuid     = { 0x4549AB47, 0x6E60, 0x4293, { 0xB9, 
0x1D, 0x31, 0xB6, 0x10, 0xAD, 0x80, 0x56 }}
+
 #
 # [Error.gEfiMdeModulePkgTokenSpaceGuid]
 #   0x80000001 | Invalid value provided.
@@ -612,6 +630,12 @@
   # @Prompt Enable S3 performance data support.
   
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwarePerformanceDataTableS3Support|TRUE|BOOLEAN|0x00010064
 
+  ## Indicates if the platform can support Capsule Result Variables.
+  #   TRUE  - Supports update capsule across a system reset.
+  #   FALSE - Does not support update capsule across a system reset.
+  # @Prompt Enable update capsule capsule result variables.
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|FALSE|BOOLEAN|0x00010069
+
 [PcdsFeatureFlag.IA32, PcdsFeatureFlag.X64]
   ## Indicates if DxeIpl should switch to long mode to enter DXE phase.
   #  It is assumed that 64-bit DxeCore is built in firmware if it is true; 
otherwise 32-bit DxeCore
diff --git a/MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.c 
b/MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.c
new file mode 100644
index 0000000..87e1e0b
--- /dev/null
+++ b/MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.c
@@ -0,0 +1,325 @@
+/** @file
+  Fake Dxe Capsule Library instance that just keeps ESRT data in UEFI
+  Variables.
+
+  Copyright 2015 Red Hat, Inc.
+
+  This program and the accompanying materials are licensed and made
+  available under the terms and conditions of the BSD License which
+  accompanies this distribution.  The full text of the license may be
+  found at http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+  IMPLIED.
+
+**/
+#include <Uefi.h>
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/CapsuleLib.h>
+#include <Library/DebugLib.h>
+#include <Library/Esrt.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/PrintLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Guid/FakeCapsuleDxe.h>
+#include <Guid/EventGroup.h>
+
+#include <Library/FakeCapsuleLib.h>
+
+//
+// Find an ESRT entry by the FwClass GUID
+//
+STATIC
+EFI_STATUS
+EFIAPI
+FakeEsrtGetFwEntryByGuid (
+  IN EFI_GUID FwEntryGuid,
+  OUT FW_RES_ENTRY *FwEntry
+  )
+{
+  RETURN_STATUS Status;
+  CHAR16        *VariableName = NULL;
+  VOID          *VariableData = NULL;
+  UINTN         VariableDataSize = 0;
+  UINT32        VariableAttributes;
+  EFI_GUID      VendorGuid = { 0, };
+
+  DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
+
+  Status = FindEsrtVariableByCapsuleGuid (&FwEntryGuid,
+                                          &VendorGuid,
+                                          &VariableName,
+                                          &VariableData,
+                                          &VariableDataSize,
+                                          &VariableAttributes);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((EFI_D_ERROR,
+            "%a: FindEsrtVariableByCapsuleGuid failed: %r\n",
+            __FUNCTION__,
+            Status
+           ));
+    return Status;
+  }
+
+  FreePool (VariableName);
+  CopyMem (FwEntry, VariableData, VariableDataSize);
+  FreePool (VariableData);
+  return EFI_SUCCESS;
+}
+
+//
+// set new values in an ESRT entry
+//
+STATIC
+EFI_STATUS
+EFIAPI
+FakeEsrtUpdateTableEntryByGuid (
+  IN EFI_GUID FwEntryGuid,
+  IN FW_RES_ENTRY *FwEntry
+  )
+{
+  RETURN_STATUS Status;
+  EFI_GUID      VendorGuid = { 0, };
+  CHAR16        *VariableName = NULL;
+  VOID          *VariableData = NULL;
+  UINTN         VariableDataSize = sizeof (FW_RES_ENTRY);
+  UINT32        VariableAttributes;
+  UINTN         NEntries = 0;
+
+  DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
+  Status = FakeCapsuleCountEntries(&NEntries);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  VariableData = AllocateZeroPool (VariableDataSize);
+  if (!VariableData) {
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  CopyMem (VariableData, FwEntry, sizeof (FW_RES_ENTRY));
+  Status = FindEsrtVariableByCapsuleGuid (&FwEntryGuid,
+                                          &VendorGuid,
+                                          &VariableName,
+                                          &VariableData,
+                                          &VariableDataSize,
+                                          &VariableAttributes
+                                          );
+  FreePool (VariableData);
+  VariableData = NULL;
+  if (Status == EFI_NOT_FOUND) {
+    VariableName = NULL;
+    Status = FindFreeNumberName (&VariableName,
+                                 L"Esrt",
+                                 &gFakeCapsuleHeaderGuid,
+                                 NEntries * 3);
+    if (EFI_ERROR (Status)) {
+      if (Status == EFI_NOT_FOUND) {
+        Status = EFI_OUT_OF_RESOURCES;
+      }
+      return Status;
+    }
+  }
+
+  Status = gRT->SetVariable(VariableName,
+                            &gFakeCapsuleHeaderGuid,
+                            EFI_VARIABLE_NON_VOLATILE
+                            | EFI_VARIABLE_BOOTSERVICE_ACCESS
+                            | EFI_VARIABLE_RUNTIME_ACCESS,
+                            sizeof (FW_RES_ENTRY),
+                            FwEntry
+                            );
+  FreePool (VariableName);
+  return Status;
+}
+
+STATIC
+EFI_STATUS
+EFIAPI
+FakeEsrtPopulateTable (
+  )
+{
+  RETURN_STATUS             Status;
+  CHAR16                    *VariableName = NULL;
+  VOID                      *VariableData = NULL;
+  UINTN                     VariableDataSize = sizeof (FW_RES_ENTRY);
+  UINT32                    VariableAttributes = 0;
+  EFI_GUID                  VendorGuid = { 0, };
+  UINTN                     NEntries = 0;
+  EFI_SYSTEM_RESOURCE_TABLE Esrt;
+  UINTN                     TableSize;
+  EFI_PHYSICAL_ADDRESS      TableAddr = 0;
+  UINT8                     *TableBuf;
+  UINTN                     i;
+  CHAR16                    CapsuleMax[] = L"Capsule0000";
+  UINTN                     NChars;
+  VOID                      *Esre;
+
+  DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
+  Status = FakeCapsuleCountEntries(&NEntries);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  VariableData = AllocateZeroPool (VariableDataSize);
+  if (!VariableData) {
+    DEBUG ((EFI_D_ERROR, "%a:%d AllocateZeroPool(%d) failed\n",
+            __FUNCTION__, __LINE__, VariableDataSize));
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  TableSize = sizeof (Esrt) + NEntries * sizeof (FW_RES_ENTRY);
+  if (TableSize % 4096) {
+    TableSize += (4096 - (TableSize & 0xfff)) & 0xfff;
+  }
+
+  Status = gBS->AllocatePages (AllocateAnyPages,
+                               EfiRuntimeServicesData,
+                               TableSize / 4096,
+                               &TableAddr
+                               );
+  if (EFI_ERROR (Status)) {
+    DEBUG ((EFI_D_ERROR, "%a:%d AllocatePages(%d) failed: %r\n",
+            __FUNCTION__, __LINE__, TableSize, Status));
+    return Status;
+  }
+  TableBuf = (UINT8 *)(UINTN)TableAddr;
+
+  Esrt.FwResourceVersion = 1;
+  Esrt.FwResourceMax = (TableSize - sizeof (Esrt)) / sizeof (FW_RES_ENTRY);
+  Esrt.FwResourceCount = 0;
+
+  Esre = TableBuf + sizeof (Esrt);
+
+  for (i = 0; i < NEntries; i++) {
+    Esre = TableBuf + sizeof (Esrt) + sizeof (FW_RES_ENTRY) * i;
+    VariableData = NULL;
+    VariableDataSize = 0;
+    Status = FindEsrtVariableByCapsuleGuid (NULL,
+                                            &VendorGuid,
+                                            &VariableName,
+                                            &VariableData,
+                                            &VariableDataSize,
+                                            &VariableAttributes
+                                            );
+    if (Status == EFI_NOT_FOUND) {
+      Status = EFI_SUCCESS;
+      break;
+    }
+    if (EFI_ERROR (Status)) {
+      DEBUG ((EFI_D_ERROR, "%a:%d: FindEsrtVariableByCapsuleGuid failed: %r\n",
+              __FUNCTION__, __LINE__, Status));
+      break;
+    }
+    if (VariableData && VariableDataSize) {
+      CopyMem (Esre, VariableData, VariableDataSize);
+      FreePool (VariableData);
+      VariableData = NULL;
+    }
+  }
+  if (VariableName) {
+    FreePool (VariableName);
+    VariableName = NULL;
+  }
+
+  Esrt.FwResourceCount = i;
+  CopyMem (TableBuf, &Esrt, sizeof (Esrt));
+
+  if (EFI_ERROR (Status)) {
+    DEBUG ((EFI_D_ERROR, "%a:%d: Couldn't get variable: %r\n",
+            __FUNCTION__, __LINE__, Status));
+    gBS->FreePages (TableAddr, TableSize / 4096);
+    return Status;
+  }
+
+  Status = gBS->InstallConfigurationTable (&gEfiEsrtTableGuid, TableBuf);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((EFI_D_ERROR, "%a:%d InstallConfigurationTable failed: %r\n",
+            __FUNCTION__, __LINE__, Status));
+    gBS->FreePages (TableAddr, TableSize / 4096);
+    return Status;
+  }
+
+  NChars = UnicodeSPrint (CapsuleMax, sizeof (CapsuleMax), L"Capsule%04X",
+                          NEntries * 3);
+  if (NChars != 11) {
+    DEBUG ((EFI_D_ERROR, "%a:%d UnicodeSPrint(Capsule####)=%d (should be 
11)\n",
+            __FUNCTION__,__LINE__, NChars));
+    gBS->FreePages (TableAddr, TableSize / 4096);
+    return EFI_ABORTED;
+  }
+  Status = gRT->SetVariable (L"CapsuleMax",
+                             &gEfiCapsuleReportGuid,
+                             EFI_VARIABLE_NON_VOLATILE
+                             | EFI_VARIABLE_BOOTSERVICE_ACCESS
+                             | EFI_VARIABLE_RUNTIME_ACCESS,
+                             NChars * sizeof (CHAR16),
+                             CapsuleMax
+                             );
+  if (EFI_ERROR (Status)) {
+    DEBUG ((EFI_D_ERROR, "%a:%d: SetVariable(CapsuleMax) failed: %r\n",
+            __FUNCTION__, __LINE__, Status));
+  }
+
+  return Status;
+}
+
+STATIC CONST ESRT_OPERATION_PROTOCOL mFakeEsrtOperationProtocol = {
+  FakeEsrtPopulateTable,
+  FakeEsrtUpdateTableEntryByGuid,
+  FakeEsrtGetFwEntryByGuid,
+};
+
+STATIC
+VOID
+EFIAPI
+OnReadyToBoot (
+  IN EFI_EVENT  Event,
+  IN VOID       *Context
+  )
+{
+  DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
+  FakeEsrtPopulateTable();
+  gBS->CloseEvent (Event);
+}
+
+EFI_STATUS
+EFIAPI
+FakeCapsuleDxeEntryPoint (
+  IN EFI_HANDLE       ImageHandle,
+  IN EFI_SYSTEM_TABLE *SystemTable
+  )
+{
+  RETURN_STATUS Status;
+  EFI_EVENT     ReadyToBootEvent;
+
+  DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));
+
+  Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL,
+                               TPL_CALLBACK,
+                               OnReadyToBoot,
+                               NULL,
+                               &gEfiEventReadyToBootGuid,
+                               &ReadyToBootEvent
+                               );
+  if (EFI_ERROR (Status)) {
+    DEBUG ((EFI_D_ERROR, "%a: CreateEventEx failed: %r\n", __FUNCTION__,
+            Status));
+    return Status;
+  }
+
+  Status = gBS->InstallMultipleProtocolInterfaces (&ImageHandle,
+                                                &gEfiEsrtOperationProtocolGuid,
+                                                &mFakeEsrtOperationProtocol,
+                                                NULL
+                                                );
+  if (EFI_ERROR (Status)) {
+    DEBUG ((EFI_D_ERROR, "%a: InstallMultipleProtocolInterfaces failed: %r\n",
+            __FUNCTION__, Status));
+  }
+  return Status;
+}
diff --git a/MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf 
b/MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
new file mode 100644
index 0000000..87646a4
--- /dev/null
+++ b/MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
@@ -0,0 +1,57 @@
+## @file
+#  Fake Dxe Capsule library instance.
+#  It can make core modules pass package level build.
+#
+#  Copyright 2015 Red Hat, Inc.
+#
+#  This program and the accompanying materials are licensed and made
+#  available under the terms and conditions of the BSD License which
+#  accompanies this distribution. The full text of the license may be
+#  found at http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+#  IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = FakeCapsuleDxe
+  FILE_GUID                      = ef3f0157-4c04-493a-8904-cb6bef9a62aa
+  MODULE_TYPE                    = UEFI_DRIVER
+  VERSION_STRING                 = 1.0
+  ENTRY_POINT                    = FakeCapsuleDxeEntryPoint
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC
+#
+
+[Sources]
+  FakeCapsuleDxe.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseLib
+  BaseMemoryLib
+  DebugLib
+  MemoryAllocationLib
+  PrintLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+  UefiRuntimeServicesTableLib
+  FakeCapsuleLib
+
+[Protocols]
+  gEfiEsrtOperationProtocolGuid
+
+[Guids]
+  gEfiCapsuleReportGuid
+  gEfiEventReadyToBootGuid
+  gEfiEsrtTableGuid
+  gFakeCapsuleHeaderGuid
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 6b0ffc6..47047c0 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -71,7 +71,8 @@
   
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
   HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
   GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
-  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
+  CapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
+  FakeCapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
   DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
   
DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
   
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
@@ -214,6 +215,8 @@
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   
ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
+  CapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
+  FakeCapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
 !ifdef $(DEBUG_ON_SERIAL_PORT)
   DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
 !else
@@ -293,6 +296,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportCapsuleResultVar|TRUE
 !if $(SECURE_BOOT_ENABLE) == TRUE
   gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|TRUE
 !endif
@@ -455,6 +459,7 @@
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
   
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
+  MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
   MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
   MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index cc70bb7..bfb077d 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -240,6 +240,7 @@ INF  OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf
 
 INF  MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
 INF  
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
+INF  MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
 INF  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
 INF  MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
 INF  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index d89a297..ba562de 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -76,7 +76,8 @@
   
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
   HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
   GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
-  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
+  CapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
+  FakeCapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
   DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
   
DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
   
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
@@ -219,6 +220,8 @@
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   
ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
+  CapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
+  FakeCapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
 !ifdef $(DEBUG_ON_SERIAL_PORT)
   DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
 !else
@@ -298,6 +301,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportCapsuleResultVar|TRUE
 !if $(SECURE_BOOT_ENABLE) == TRUE
   gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|TRUE
 !endif
@@ -462,6 +466,7 @@
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
   
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
+  MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
   MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
   MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index 7256ff3..675840a 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -240,6 +240,7 @@ INF  OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf
 
 INF  MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
 INF  
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
+INF  MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
 INF  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
 INF  MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
 INF  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 6b7aea7..99952d7 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -76,7 +76,8 @@
   
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
   HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
   GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
-  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
+  CapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
+  FakeCapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
   DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
   
DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
   
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
@@ -219,6 +220,8 @@
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   
ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf
+  CapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleBase.inf
+  FakeCapsuleLib|MdeModulePkg/Library/FakeCapsuleLib/FakeCapsuleLib.inf
 !ifdef $(DEBUG_ON_SERIAL_PORT)
   DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
 !else
@@ -298,6 +301,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportCapsuleResultVar|TRUE
 !if $(SECURE_BOOT_ENABLE) == TRUE
   gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|TRUE
 !endif
@@ -460,6 +464,7 @@
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
   
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
+  MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
   MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
   MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index 80fd827..f958362 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -240,6 +240,7 @@ INF  OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf
 
 INF  MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
 INF  
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
+INF  MdeModulePkg/Universal/FakeCapsuleDxe/FakeCapsuleDxe.inf
 INF  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
 INF  MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
 INF  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
diff --git a/Vlv2TbltDevicePkg/PlatformPkg.dec 
b/Vlv2TbltDevicePkg/PlatformPkg.dec
index 378cb53..af62b18 100644
--- a/Vlv2TbltDevicePkg/PlatformPkg.dec
+++ b/Vlv2TbltDevicePkg/PlatformPkg.dec
@@ -197,12 +197,10 @@
 #  gLpssDummyProtocolGuid = { 0xaf4cc162, 0xd41c, 0x455a, { 0xab, 0x45, 0x6d, 
0xbc, 0xc1, 0xcd, 0x32, 0xf3 } }
   gEfiSpiProtocolGuid               = { 0x1156efc6, 0xea32, 0x4396, { 0xb5, 
0xd5, 0x26, 0x93, 0x2e, 0x83, 0xc3, 0x13 }}
   gEfiGpioOperationProtocolGuid     = { 0x38DDFE8F, 0x8991, 0x44AA, { 0x98, 
0x89, 0x83, 0xF4, 0x91, 0x84, 0x65, 0xB0 }}
-  gEfiEsrtOperationProtocolGuid     = { 0x4549AB47, 0x6E60, 0x4293, { 0xB9, 
0x1D, 0x31, 0xB6, 0x10, 0xAD, 0x80, 0x56 }}
 
 [Guids]
   gEfiFwDisplayCapsuleGuid       = { 0x3b8c8162, 0x188c, 0x46a4, { 0xae, 0xc9, 
0xbe, 0x43, 0xf1, 0xd6, 0x56, 0x97 } }
   gEfiFirmwareClassGuid          = { 0xb122a262, 0x3551, 0x4f48, { 0x88, 0x92, 
0x55, 0xf6, 0xc0, 0x61, 0x42, 0x90 } }
   gEfiDFUVerGuid                 = { 0x0dc73aed, 0xcbf6, 0x4a25, { 0xa6, 0x8d, 
0x59, 0xc8, 0x0f, 0x44, 0xc7, 0xc3 } }
-  gEfiEsrtTableGuid              = { 0xb122a263, 0x3661, 0x4f68, { 0x99, 0x29, 
0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80 } }
   gEfiCapsuleCrashLogVarGuid     = { 0xf3ff1468, 0x04ba, 0x4966, { 0x9f, 0xb2, 
0xe4, 0xa7, 0x90, 0x05, 0x46, 0x50 } }
   gEfiCapsuleCrashGuid           = { 0x0e1d2972, 0x65af, 0x4ac1, { 0xbf, 0xa3, 
0xce, 0xf4, 0xab, 0x0c, 0x38, 0xfe } }
-- 
2.1.0


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to