Revert "Capsule-on-Disk entire Patch

This reverts commit 0d4aa276d1,
                    6470a43160,
                    fd72860895,
                    7837d12498,
                    6b32af2e10,
                    8636f70b5a,
                    f17935321a
due to incorrect review process.

Cc: Wei6 Xu <wei6.xu@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
Zhang, Chao B
2019-06-21 10:24:10 +08:00
parent 425d8d487f
commit 57ec204e69
28 changed files with 68 additions and 3266 deletions

View File

@@ -1,7 +1,7 @@
/** @file
DXE capsule report related function.
Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -29,18 +29,6 @@
#include <IndustryStandard/WindowsUxCapsule.h>
/**
This routine is called to clear CapsuleOnDisk Relocation Info variable.
Total Capsule On Disk length is recorded in this variable
@retval EFI_SUCCESS Capsule On Disk flags are cleared
**/
EFI_STATUS
CoDClearCapsuleRelocationInfo(
VOID
);
/**
Get current capsule last variable index.
@@ -186,7 +174,6 @@ RecordCapsuleStatusVariable (
@param[in] PayloadIndex FMP payload index
@param[in] ImageHeader FMP image header
@param[in] FmpDevicePath DevicePath associated with the FMP producer
@param[in] CapFileName Capsule file name
@retval EFI_SUCCESS The capsule status variable is recorded.
@retval EFI_OUT_OF_RESOURCES No resource to record the capsule status variable.
@@ -197,8 +184,7 @@ RecordFmpCapsuleStatusVariable (
IN EFI_STATUS CapsuleStatus,
IN UINTN PayloadIndex,
IN EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *ImageHeader,
IN EFI_DEVICE_PATH_PROTOCOL *FmpDevicePath, OPTIONAL
IN CHAR16 *CapFileName OPTIONAL
IN EFI_DEVICE_PATH_PROTOCOL *FmpDevicePath OPTIONAL
)
{
EFI_CAPSULE_RESULT_VARIABLE_HEADER *CapsuleResultVariableHeader;
@@ -208,11 +194,8 @@ RecordFmpCapsuleStatusVariable (
UINTN CapsuleResultVariableSize;
CHAR16 *DevicePathStr;
UINTN DevicePathStrSize;
UINTN CapFileNameSize;
DevicePathStr = NULL;
CapFileNameSize = sizeof(CHAR16);
DevicePathStr = NULL;
if (FmpDevicePath != NULL) {
DevicePathStr = ConvertDevicePathToText (FmpDevicePath, FALSE, FALSE);
}
@@ -221,16 +204,10 @@ RecordFmpCapsuleStatusVariable (
} else {
DevicePathStrSize = sizeof(CHAR16);
}
if (CapFileName != NULL) {
CapFileNameSize = StrSize(CapFileName);
}
//
// Allocate room for CapsuleFileName.
// Allocate zero CHAR16 for CapsuleFileName.
//
CapsuleResultVariableSize = sizeof(EFI_CAPSULE_RESULT_VARIABLE_HEADER) + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP) + CapFileNameSize + DevicePathStrSize;
CapsuleResultVariableSize = sizeof(EFI_CAPSULE_RESULT_VARIABLE_HEADER) + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP) + sizeof(CHAR16) + DevicePathStrSize;
CapsuleResultVariable = AllocateZeroPool (CapsuleResultVariableSize);
if (CapsuleResultVariable == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -248,13 +225,8 @@ RecordFmpCapsuleStatusVariable (
CapsuleResultVariableFmp->PayloadIndex = (UINT8)PayloadIndex;
CapsuleResultVariableFmp->UpdateImageIndex = ImageHeader->UpdateImageIndex;
CopyGuid (&CapsuleResultVariableFmp->UpdateImageTypeId, &ImageHeader->UpdateImageTypeId);
if (CapFileName != NULL) {
CopyMem((UINT8 *)CapsuleResultVariableFmp + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP), CapFileName, CapFileNameSize);
}
if (DevicePathStr != NULL) {
CopyMem ((UINT8 *)CapsuleResultVariableFmp + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP) + CapFileNameSize, DevicePathStr, DevicePathStrSize);
CopyMem ((UINT8 *)CapsuleResultVariableFmp + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP) + sizeof(CHAR16), DevicePathStr, DevicePathStrSize);
FreePool (DevicePathStr);
DevicePathStr = NULL;
}
@@ -428,31 +400,6 @@ InitCapsuleUpdateVariable (
}
}
/**
Initialize capsule relocation info variable.
**/
VOID
InitCapsuleRelocationInfo (
VOID
)
{
EFI_STATUS Status;
EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock;
CoDClearCapsuleRelocationInfo();
//
// Unlock Capsule On Disk relocation Info variable only when Capsule On Disk flag is enabled
//
if (!CoDCheckCapsuleOnDiskFlag()) {
Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock);
if (!EFI_ERROR (Status)) {
Status = VariableLock->RequestToLock (VariableLock, COD_RELOCATION_INFO_VAR_NAME, &gEfiCapsuleVendorGuid);
ASSERT_EFI_ERROR (Status);
}
}
}
/**
Initialize capsule related variables.
**/
@@ -464,8 +411,6 @@ InitCapsuleVariable (
InitCapsuleUpdateVariable();
InitCapsuleMaxVariable();
InitCapsuleLastVariable();
InitCapsuleRelocationInfo();
//
// No need to clear L"Capsule####", because OS/APP should refer L"CapsuleLast"
// to check status and delete them.