public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/5] CapsuleApp: Some enhancements
@ 2018-07-26  4:54 Star Zeng
  2018-07-26  4:54 ` [PATCH 1/5] MdeModulePkg CapsuleApp: Fix VS2012 build failure caused by 5410502 Star Zeng
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Star Zeng @ 2018-07-26  4:54 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Michael D Kinney, Jiewen Yao, Yonghong Zhu

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>

Star Zeng (5):
  MdeModulePkg CapsuleApp: Fix VS2012 build failure caused by 5410502
  MdeModulePkg CapsuleApp: Fix -D failed to dump Nest FMP capsule
  MdeModulePkg CapsuleApp: Refine -N option help information
  MdeModulePkg CapsuleApp: Index need be decimal for -P GET option
  MdeModulePkg CapsuleApp: Prompt info for -C option

 MdeModulePkg/Application/CapsuleApp/CapsuleApp.c  | 46 +++++++++++++----------
 MdeModulePkg/Application/CapsuleApp/CapsuleDump.c |  4 +-
 2 files changed, 28 insertions(+), 22 deletions(-)

-- 
2.7.0.windows.1



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

* [PATCH 1/5] MdeModulePkg CapsuleApp: Fix VS2012 build failure caused by 5410502
  2018-07-26  4:54 [PATCH 0/5] CapsuleApp: Some enhancements Star Zeng
@ 2018-07-26  4:54 ` Star Zeng
  2018-07-26  4:54 ` [PATCH 2/5] MdeModulePkg CapsuleApp: Fix -D failed to dump Nest FMP capsule Star Zeng
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Star Zeng @ 2018-07-26  4:54 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Jiewen Yao, Dandan Bi

The build failure is like below.
xxx\CapsuleApp.c(868) : error C2275: 'EFI_GUID' :
  illegal use of this type as an expression
        xxx/UefiBaseType.h(29) : see declaration of 'EFI_GUID'
xxx\CapsuleApp.c(868) : error C2146: syntax error :
  missing ';' before identifier 'ImageTypeId'
xxx\CapsuleApp.c(868) : error C2065: 'ImageTypeId' : undeclared identifier
xxx\CapsuleApp.c(869) : error C2275: 'UINTN' :
  illegal use of this type as an expression
        xxx\ProcessorBind.h(224) : see declaration of 'UINTN'
xxx\CapsuleApp.c(869) : error C2146: syntax error :
  missing ';' before identifier 'ImageIndex'
xxx\CapsuleApp.c(869) : error C2065: 'ImageIndex' : undeclared identifier

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
index df5de91ef524..95aa20760560 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
@@ -809,14 +809,16 @@ UefiMain (
   UINTN                         FileSize[MAX_CAPSULE_NUM];
   VOID                          *CapsuleBuffer[MAX_CAPSULE_NUM];
   EFI_CAPSULE_BLOCK_DESCRIPTOR  *BlockDescriptors;
-  EFI_CAPSULE_HEADER             *CapsuleHeaderArray[MAX_CAPSULE_NUM + 1];
-  UINT64                         MaxCapsuleSize;
-  EFI_RESET_TYPE                 ResetType;
-  BOOLEAN                        NeedReset;
-  BOOLEAN                        NoReset;
-  CHAR16                         *CapsuleName;
-  UINTN                          CapsuleNum;
-  UINTN                          Index;
+  EFI_CAPSULE_HEADER            *CapsuleHeaderArray[MAX_CAPSULE_NUM + 1];
+  UINT64                        MaxCapsuleSize;
+  EFI_RESET_TYPE                ResetType;
+  BOOLEAN                       NeedReset;
+  BOOLEAN                       NoReset;
+  CHAR16                        *CapsuleName;
+  UINTN                         CapsuleNum;
+  UINTN                         Index;
+  EFI_GUID                      ImageTypeId;
+  UINTN                         ImageIndex;
 
   Status = GetArg();
   if (EFI_ERROR(Status)) {
@@ -865,8 +867,6 @@ UefiMain (
           return EFI_UNSUPPORTED;
         }
 
-        EFI_GUID  ImageTypeId;
-        UINTN     ImageIndex;
         //
         // FMP->GetImage()
         //
-- 
2.7.0.windows.1



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

* [PATCH 2/5] MdeModulePkg CapsuleApp: Fix -D failed to dump Nest FMP capsule
  2018-07-26  4:54 [PATCH 0/5] CapsuleApp: Some enhancements Star Zeng
  2018-07-26  4:54 ` [PATCH 1/5] MdeModulePkg CapsuleApp: Fix VS2012 build failure caused by 5410502 Star Zeng
@ 2018-07-26  4:54 ` Star Zeng
  2018-07-26  4:54 ` [PATCH 3/5] MdeModulePkg CapsuleApp: Refine -N option help information Star Zeng
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Star Zeng @ 2018-07-26  4:54 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Michael D Kinney, Jiewen Yao, Yonghong Zhu

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Application/CapsuleApp/CapsuleDump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
index 97f1893ef433..4c85e8c23dff 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
@@ -214,7 +214,7 @@ IsNestedFmpCapsule (
   // FMP GUID after ESRT one
   //
   NestedCapsuleHeader = (EFI_CAPSULE_HEADER *)((UINT8 *)CapsuleHeader + CapsuleHeader->HeaderSize);
-  NestedCapsuleSize = (UINTN)CapsuleHeader + CapsuleHeader->HeaderSize - (UINTN)NestedCapsuleHeader;
+  NestedCapsuleSize = (UINTN)CapsuleHeader + CapsuleHeader->CapsuleImageSize- (UINTN)NestedCapsuleHeader;
   if (NestedCapsuleSize < sizeof(EFI_CAPSULE_HEADER)) {
     return FALSE;
   }
-- 
2.7.0.windows.1



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

* [PATCH 3/5] MdeModulePkg CapsuleApp: Refine -N option help information
  2018-07-26  4:54 [PATCH 0/5] CapsuleApp: Some enhancements Star Zeng
  2018-07-26  4:54 ` [PATCH 1/5] MdeModulePkg CapsuleApp: Fix VS2012 build failure caused by 5410502 Star Zeng
  2018-07-26  4:54 ` [PATCH 2/5] MdeModulePkg CapsuleApp: Fix -D failed to dump Nest FMP capsule Star Zeng
@ 2018-07-26  4:54 ` Star Zeng
  2018-07-26  4:54 ` [PATCH 4/5] MdeModulePkg CapsuleApp: Index need be decimal for -P GET option Star Zeng
  2018-07-26  4:54 ` [PATCH 5/5] MdeModulePkg CapsuleApp: Prompt info for -C option Star Zeng
  4 siblings, 0 replies; 8+ messages in thread
From: Star Zeng @ 2018-07-26  4:54 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Michael D Kinney, Jiewen Yao, Yonghong Zhu

-N option is used to append a Capsule Header to an existing
FMP capsule image with its ImageTypeId supported by the system.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
index 95aa20760560..3a87439f104e 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
@@ -779,7 +779,8 @@ PrintUsage (
   Print(L"  -E:  Dump UEFI ESRT table info.\n");
   Print(L"  -G:  Convert a BMP file to be an UX capsule,\n");
   Print(L"       according to Windows Firmware Update document\n");
-  Print(L"  -N:  Append a Capsule Header to an existing capsule image,\n");
+  Print(L"  -N:  Append a Capsule Header to an existing FMP capsule image\n");
+  Print(L"       with its ImageTypeId supported by the system,\n");
   Print(L"       according to Windows Firmware Update document\n");
   Print(L"  -O:  Output new Capsule file name\n");
   Print(L"  -D:  Dump Capsule image header information, image payload information if it is an UX capsule\n");
-- 
2.7.0.windows.1



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

* [PATCH 4/5] MdeModulePkg CapsuleApp: Index need be decimal for -P GET option
  2018-07-26  4:54 [PATCH 0/5] CapsuleApp: Some enhancements Star Zeng
                   ` (2 preceding siblings ...)
  2018-07-26  4:54 ` [PATCH 3/5] MdeModulePkg CapsuleApp: Refine -N option help information Star Zeng
@ 2018-07-26  4:54 ` Star Zeng
  2018-07-26  4:54 ` [PATCH 5/5] MdeModulePkg CapsuleApp: Prompt info for -C option Star Zeng
  4 siblings, 0 replies; 8+ messages in thread
From: Star Zeng @ 2018-07-26  4:54 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Michael D Kinney, Jiewen Yao, Yonghong Zhu

Also adjust the help information to be not too long to be suitable
for different display resolutions.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
index 3a87439f104e..93bf4252bac6 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
@@ -768,14 +768,16 @@ PrintUsage (
   Print(L"  CapsuleApp -D <Capsule>\n");
   Print(L"  CapsuleApp -P GET <ImageTypeId> <Index> -O <FileName>\n");
   Print(L"Parameter:\n");
-  Print(L"  -NR: No reset will be triggered for the capsule\n");
-  Print(L"       with CAPSULE_FLAGS_PERSIST_ACROSS_RESET and without CAPSULE_FLAGS_INITIATE_RESET.\n");
+  Print(L"  -NR: No reset will be triggered for the capsule with\n");
+  Print(L"       CAPSULE_FLAGS_PERSIST_ACROSS_RESET and without\n");
+  Print(L"       CAPSULE_FLAGS_INITIATE_RESET.\n");
   Print(L"  -S:  Dump capsule report variable (EFI_CAPSULE_REPORT_GUID),\n");
   Print(L"       which is defined in UEFI specification.\n");
   Print(L"  -C:  Clear capsule report variable (EFI_CAPSULE_REPORT_GUID),\n");
   Print(L"       which is defined in UEFI specification.\n");
   Print(L"  -P:  Dump UEFI FMP protocol info, or get image with specified\n");
-  Print(L"       ImageTypeId and index to a file if 'GET' option is used.\n");
+  Print(L"       ImageTypeId and Index (decimal format) to a file if 'GET'\n");
+  Print(L"       option is used.\n");
   Print(L"  -E:  Dump UEFI ESRT table info.\n");
   Print(L"  -G:  Convert a BMP file to be an UX capsule,\n");
   Print(L"       according to Windows Firmware Update document\n");
@@ -783,8 +785,9 @@ PrintUsage (
   Print(L"       with its ImageTypeId supported by the system,\n");
   Print(L"       according to Windows Firmware Update document\n");
   Print(L"  -O:  Output new Capsule file name\n");
-  Print(L"  -D:  Dump Capsule image header information, image payload information if it is an UX capsule\n");
-  Print(L"       and FMP header information if it is a FMP capsule.\n");
+  Print(L"  -D:  Dump Capsule image header information, image payload\n");
+  Print(L"       information if it is an UX capsule and FMP header\n");
+  Print(L"       information if it is a FMP capsule.\n");
 }
 
 /**
-- 
2.7.0.windows.1



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

* [PATCH 5/5] MdeModulePkg CapsuleApp: Prompt info for -C option
  2018-07-26  4:54 [PATCH 0/5] CapsuleApp: Some enhancements Star Zeng
                   ` (3 preceding siblings ...)
  2018-07-26  4:54 ` [PATCH 4/5] MdeModulePkg CapsuleApp: Index need be decimal for -P GET option Star Zeng
@ 2018-07-26  4:54 ` Star Zeng
  4 siblings, 0 replies; 8+ messages in thread
From: Star Zeng @ 2018-07-26  4:54 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Michael D Kinney, Jiewen Yao, Yonghong Zhu

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Application/CapsuleApp/CapsuleApp.c  | 10 ++++++----
 MdeModulePkg/Application/CapsuleApp/CapsuleDump.c |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
index 93bf4252bac6..cf81eee71235 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
@@ -70,7 +70,7 @@ DumpCapsule (
   @retval EFI_UNSUPPORTED        Input parameter is not valid.
 **/
 EFI_STATUS
-DmpCapsuleStatusVariable (
+DumpCapsuleStatusVariable (
   VOID
   );
 
@@ -481,13 +481,15 @@ ClearCapsuleStatusVariable (
                     0,
                     (VOID *)NULL
                     );
-    if (EFI_ERROR(Status)) {
+    if (Status == EFI_NOT_FOUND) {
       //
-      // There is no capsule variables, quit
+      // There is no more capsule variables, quit
       //
       break;
     }
 
+    Print (L"%s is cleared (%r)\n", CapsuleVarName, Status);
+
     Index++;
     if (Index > 0xFFFF) {
       break;
@@ -850,7 +852,7 @@ UefiMain (
     return Status;
   }
   if (StrCmp(Argv[1], L"-S") == 0) {
-    Status = DmpCapsuleStatusVariable();
+    Status = DumpCapsuleStatusVariable();
     return EFI_SUCCESS;
   }
   if (StrCmp(Argv[1], L"-C") == 0) {
diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
index 4c85e8c23dff..11bf2e1d4530 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
@@ -283,7 +283,7 @@ Done:
   @retval EFI_UNSUPPORTED        Input parameter is not valid.
 **/
 EFI_STATUS
-DmpCapsuleStatusVariable (
+DumpCapsuleStatusVariable (
   VOID
   )
 {
-- 
2.7.0.windows.1



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

* [PATCH 0/5] CapsuleApp: Some enhancements
@ 2018-07-26 10:16 Star Zeng
  2018-07-26 12:50 ` Yao, Jiewen
  0 siblings, 1 reply; 8+ messages in thread
From: Star Zeng @ 2018-07-26 10:16 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Michael D Kinney, Jiewen Yao, Yonghong Zhu

V2: Last patch is new added.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>

Star Zeng (6):
  MdeModulePkg CapsuleApp: Fix VS2012 build failure caused by 5410502
  MdeModulePkg CapsuleApp: Fix -D failed to dump Nest FMP capsule
  MdeModulePkg CapsuleApp: Refine -N option help information
  MdeModulePkg CapsuleApp: Index need be decimal for -P GET option
  MdeModulePkg CapsuleApp: Prompt info for -C option
  MdeModulePkg CapsuleApp: Check capsule header for -D and -N options

 MdeModulePkg/Application/CapsuleApp/CapsuleApp.c  | 154 ++++++++++++++--------
 MdeModulePkg/Application/CapsuleApp/CapsuleDump.c |  27 +++-
 2 files changed, 125 insertions(+), 56 deletions(-)

-- 
2.7.0.windows.1



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

* Re: [PATCH 0/5] CapsuleApp: Some enhancements
  2018-07-26 10:16 [PATCH 0/5] CapsuleApp: Some enhancements Star Zeng
@ 2018-07-26 12:50 ` Yao, Jiewen
  0 siblings, 0 replies; 8+ messages in thread
From: Yao, Jiewen @ 2018-07-26 12:50 UTC (permalink / raw)
  To: Zeng, Star, edk2-devel@lists.01.org; +Cc: Kinney, Michael D, Zhu, Yonghong

Reviewed-by: Jiewen.yao@intel.com

> -----Original Message-----
> From: Zeng, Star
> Sent: Thursday, July 26, 2018 6:17 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Zhu,
> Yonghong <yonghong.zhu@intel.com>
> Subject: [PATCH 0/5] CapsuleApp: Some enhancements
> 
> V2: Last patch is new added.
> 
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Yonghong Zhu <yonghong.zhu@intel.com>
> 
> Star Zeng (6):
>   MdeModulePkg CapsuleApp: Fix VS2012 build failure caused by 5410502
>   MdeModulePkg CapsuleApp: Fix -D failed to dump Nest FMP capsule
>   MdeModulePkg CapsuleApp: Refine -N option help information
>   MdeModulePkg CapsuleApp: Index need be decimal for -P GET option
>   MdeModulePkg CapsuleApp: Prompt info for -C option
>   MdeModulePkg CapsuleApp: Check capsule header for -D and -N options
> 
>  MdeModulePkg/Application/CapsuleApp/CapsuleApp.c  | 154
> ++++++++++++++--------
>  MdeModulePkg/Application/CapsuleApp/CapsuleDump.c |  27 +++-
>  2 files changed, 125 insertions(+), 56 deletions(-)
> 
> --
> 2.7.0.windows.1



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

end of thread, other threads:[~2018-07-26 12:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-26  4:54 [PATCH 0/5] CapsuleApp: Some enhancements Star Zeng
2018-07-26  4:54 ` [PATCH 1/5] MdeModulePkg CapsuleApp: Fix VS2012 build failure caused by 5410502 Star Zeng
2018-07-26  4:54 ` [PATCH 2/5] MdeModulePkg CapsuleApp: Fix -D failed to dump Nest FMP capsule Star Zeng
2018-07-26  4:54 ` [PATCH 3/5] MdeModulePkg CapsuleApp: Refine -N option help information Star Zeng
2018-07-26  4:54 ` [PATCH 4/5] MdeModulePkg CapsuleApp: Index need be decimal for -P GET option Star Zeng
2018-07-26  4:54 ` [PATCH 5/5] MdeModulePkg CapsuleApp: Prompt info for -C option Star Zeng
  -- strict thread matches above, loose matches on Subject: below --
2018-07-26 10:16 [PATCH 0/5] CapsuleApp: Some enhancements Star Zeng
2018-07-26 12:50 ` Yao, Jiewen

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