public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-staging/FceFmmt][PATCH] BaseTools/FCE: Fix multiple FVs with SEC module issue
@ 2020-02-14  9:14 yunhuax.feng
  2020-02-19 13:01 ` Liming Gao
  0 siblings, 1 reply; 2+ messages in thread
From: yunhuax.feng @ 2020-02-14  9:14 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: Gao, Liming, Feng, Bob C, Zhang, Hongbin1

[-- Attachment #1: Type: text/plain, Size: 2145 bytes --]

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2527

One BIOS image may have more than FVs with SEC module.
FCE tool should find the latest FV with SEC module as BFV image.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Yunhua  Feng<yunhuax.feng@intel.com>
---
 BaseTools/Source/C/BfmLib/BinFileManager.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/BaseTools/Source/C/BfmLib/BinFileManager.c b/BaseTools/Source/C/BfmLib/BinFileManager.c
index 9b4e0929f5..69521044b8 100644
--- a/BaseTools/Source/C/BfmLib/BinFileManager.c
+++ b/BaseTools/Source/C/BfmLib/BinFileManager.c
@@ -251,10 +251,11 @@ BfmImageAdd (
   BOOLEAN                     FfsLevelFoundFlag;
   CHAR8                       *OutputFileName;
   CHAR8                       *FvId;
   BOOLEAN                     FirstInFlag;
   BOOLEAN                     FvGuidExisted;
+  FV_INFORMATION              *FvInFdTmp;
 
   NewFvLength                 = 0;
   FvEncapLevel                = 0;
   NewAddedFfsLevel            = 0;
 
@@ -269,10 +270,11 @@ BfmImageAdd (
   TemDir                      = NULL;
   LocalEncapDataTemp          = NULL;
   OutputFileName              = NULL;
   FvId                        = NULL;
   FvGuidExisted               = FALSE;
+  FvInFdTmp                   = NULL;
 
   //
   // Get the size of ffs file to be inserted.
   //
   NewFfsLength = GetFileSize(NewFile);
@@ -306,10 +308,19 @@ BfmImageAdd (
   //
   FvInFd = FdData->Fv;
   do {
     if ((FvGuidExisted && mFvGuidIsSet && FvInFd->IsInputFvFlag) || ((!FvGuidExisted || (!mFvGuidIsSet)) && FvInFd->IsBfvFlag)) {
 
+      if (FvInFd->IsBfvFlag) {
+        FvInFdTmp = FdData->Fv;
+        while (FvInFdTmp != NULL) {
+          if (FvInFdTmp->IsBfvFlag) {
+            FvInFd = FvInFdTmp;
+          }
+          FvInFdTmp = FvInFdTmp->FvNext;
+        }
+      }
       Status = LibLocateBfv (FdData, &FvId, &FvInFd);
 
       if (EFI_ERROR (Status)) {
         printf("Error while locate BFV from FD.\n");
         LibBfmFreeFd(FdData);
-- 
2.12.2.windows.2


[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 5928 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-staging/FceFmmt][PATCH] BaseTools/FCE: Fix multiple FVs with SEC module issue
  2020-02-14  9:14 [edk2-staging/FceFmmt][PATCH] BaseTools/FCE: Fix multiple FVs with SEC module issue yunhuax.feng
@ 2020-02-19 13:01 ` Liming Gao
  0 siblings, 0 replies; 2+ messages in thread
From: Liming Gao @ 2020-02-19 13:01 UTC (permalink / raw)
  To: Feng, YunhuaX, devel@edk2.groups.io; +Cc: Feng, Bob C, Zhang, Hongbin1

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: Feng, YunhuaX <yunhuax.feng@intel.com>
> Sent: Friday, February 14, 2020 5:15 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Zhang, Hongbin1 <hongbin1.zhang@intel.com>
> Subject: [edk2-staging/FceFmmt][PATCH] BaseTools/FCE: Fix multiple FVs with SEC module issue
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2527
> 
> One BIOS image may have more than FVs with SEC module.
> FCE tool should find the latest FV with SEC module as BFV image.
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Yunhua  Feng<yunhuax.feng@intel.com>
> ---
>  BaseTools/Source/C/BfmLib/BinFileManager.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/BaseTools/Source/C/BfmLib/BinFileManager.c b/BaseTools/Source/C/BfmLib/BinFileManager.c
> index 9b4e0929f5..69521044b8 100644
> --- a/BaseTools/Source/C/BfmLib/BinFileManager.c
> +++ b/BaseTools/Source/C/BfmLib/BinFileManager.c
> @@ -251,10 +251,11 @@ BfmImageAdd (
>    BOOLEAN                     FfsLevelFoundFlag;
>    CHAR8                       *OutputFileName;
>    CHAR8                       *FvId;
>    BOOLEAN                     FirstInFlag;
>    BOOLEAN                     FvGuidExisted;
> +  FV_INFORMATION              *FvInFdTmp;
> 
>    NewFvLength                 = 0;
>    FvEncapLevel                = 0;
>    NewAddedFfsLevel            = 0;
> 
> @@ -269,10 +270,11 @@ BfmImageAdd (
>    TemDir                      = NULL;
>    LocalEncapDataTemp          = NULL;
>    OutputFileName              = NULL;
>    FvId                        = NULL;
>    FvGuidExisted               = FALSE;
> +  FvInFdTmp                   = NULL;
> 
>    //
>    // Get the size of ffs file to be inserted.
>    //
>    NewFfsLength = GetFileSize(NewFile);
> @@ -306,10 +308,19 @@ BfmImageAdd (
>    //
>    FvInFd = FdData->Fv;
>    do {
>      if ((FvGuidExisted && mFvGuidIsSet && FvInFd->IsInputFvFlag) || ((!FvGuidExisted || (!mFvGuidIsSet)) && FvInFd->IsBfvFlag)) {
> 
> +      if (FvInFd->IsBfvFlag) {
> +        FvInFdTmp = FdData->Fv;
> +        while (FvInFdTmp != NULL) {
> +          if (FvInFdTmp->IsBfvFlag) {
> +            FvInFd = FvInFdTmp;
> +          }
> +          FvInFdTmp = FvInFdTmp->FvNext;
> +        }
> +      }
>        Status = LibLocateBfv (FdData, &FvId, &FvInFd);
> 
>        if (EFI_ERROR (Status)) {
>          printf("Error while locate BFV from FD.\n");
>          LibBfmFreeFd(FdData);
> --
> 2.12.2.windows.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-19 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-14  9:14 [edk2-staging/FceFmmt][PATCH] BaseTools/FCE: Fix multiple FVs with SEC module issue yunhuax.feng
2020-02-19 13:01 ` Liming Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox