FatPkg/FatPei: Use PcdRecoveryFileName PCD.

This PCD is used to indicated the recovery file name.
The previous name - FvMain.Fv is hardcoded in FatPei.
It does not make sense to force the name.

Now a platform may use any recovery file name.

Tested-by: Michael D Kinney <michael.d.kinney@intel.com>

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
Jiewen Yao 2016-10-08 09:55:59 +08:00
parent 9753360756
commit 46cd2cb6a7
3 changed files with 9 additions and 8 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
FAT recovery PEIM entry point, Ppi Functions and FAT Api functions. FAT recovery PEIM entry point, Ppi Functions and FAT Api functions.
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this under the terms and conditions of the BSD License which accompanies this
@ -370,7 +370,7 @@ GetNumberRecoveryCapsules (
// //
RecoveryCapsuleCount = 0; RecoveryCapsuleCount = 0;
for (Index = 0; Index < PrivateData->VolumeCount; Index++) { for (Index = 0; Index < PrivateData->VolumeCount; Index++) {
Status = FindRecoveryFile (PrivateData, Index, PEI_FAT_RECOVERY_CAPSULE_WITHOUT_NT_EMULATOR, &Handle); Status = FindRecoveryFile (PrivateData, Index, (CHAR16 *)PcdGetPtr(PcdRecoveryFileName), &Handle);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
continue; continue;
} }
@ -452,7 +452,7 @@ GetRecoveryCapsuleInfo (
// //
RecoveryCapsuleCount = 0; RecoveryCapsuleCount = 0;
for (Index = 0; Index < PrivateData->VolumeCount; Index++) { for (Index = 0; Index < PrivateData->VolumeCount; Index++) {
Status = FindRecoveryFile (PrivateData, Index, PEI_FAT_RECOVERY_CAPSULE_WITHOUT_NT_EMULATOR, &Handle); Status = FindRecoveryFile (PrivateData, Index, (CHAR16 *)PcdGetPtr(PcdRecoveryFileName), &Handle);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
continue; continue;
@ -576,7 +576,7 @@ LoadRecoveryCapsule (
// //
RecoveryCapsuleCount = 0; RecoveryCapsuleCount = 0;
for (Index = 0; Index < PrivateData->VolumeCount; Index++) { for (Index = 0; Index < PrivateData->VolumeCount; Index++) {
Status = FindRecoveryFile (PrivateData, Index, PEI_FAT_RECOVERY_CAPSULE_WITHOUT_NT_EMULATOR, &Handle); Status = FindRecoveryFile (PrivateData, Index, (CHAR16 *)PcdGetPtr(PcdRecoveryFileName), &Handle);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
continue; continue;
} }

View File

@ -1,7 +1,7 @@
/** @file /** @file
Data structures for FAT recovery PEIM Data structures for FAT recovery PEIM
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this under the terms and conditions of the BSD License which accompanies this
@ -37,8 +37,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //
// Definitions // Definitions
// //
#define PEI_FAT_RECOVERY_CAPSULE_WITH_NT_EMULATOR L"fv0001.fv"
#define PEI_FAT_RECOVERY_CAPSULE_WITHOUT_NT_EMULATOR L"fvmain.fv"
#define PEI_FAT_CACHE_SIZE 4 #define PEI_FAT_CACHE_SIZE 4
#define PEI_FAT_MAX_BLOCK_SIZE 8192 #define PEI_FAT_MAX_BLOCK_SIZE 8192

View File

@ -1,7 +1,7 @@
## @file ## @file
# Lite Fat driver only used in Pei Phase. # Lite Fat driver only used in Pei Phase.
# #
# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
# #
# This program and the accompanying materials are licensed and made available # This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this # under the terms and conditions of the BSD License which accompanies this
@ -69,6 +69,9 @@
[FeaturePcd] [FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdRecoveryFileName ## CONSUMES
[Depex] [Depex]
gEfiPeiMemoryDiscoveredPpiGuid AND gEfiPeiBootInRecoveryModePpiGuid gEfiPeiMemoryDiscoveredPpiGuid AND gEfiPeiBootInRecoveryModePpiGuid