]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/CapsuleApp: Enhance CapsuleApp for Fmp Capsule Dependency
authorXu, Wei6 <wei6.xu@intel.com>
Fri, 10 Jan 2020 05:34:53 +0000 (13:34 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 19 Jan 2020 02:47:47 +0000 (02:47 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2421

1. Enhance "CapsuleApp -P" to output the depex expression op-codes in
the EFI_FIRMWARE_IMAGE_DESCRIPTOR.
2. Enhance Last Attempt Status String with a new string to describe the
error LAST_ATTEMPT_STATUS_ERROR_UNSATISFIED_DEPENDENCIES.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdeModulePkg/Application/CapsuleApp/CapsuleDump.c

index 58a93568d01350d22744572defa943e0c44eaadc..d65197b256b4ec1f858953e758382f9f4cdf4374 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Dump Capsule image information.\r
 \r
-  Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -338,6 +338,7 @@ CHAR8 *mLastAttemptStatusString[] = {
   "Error: Auth Error",\r
   "Error: Power Event AC",\r
   "Error: Power Event Battery",\r
+  "Error: Unsatisfied Dependencies",\r
 };\r
 \r
 /**\r
@@ -1007,6 +1008,7 @@ DumpFmpImageInfo (
 {\r
   EFI_FIRMWARE_IMAGE_DESCRIPTOR                 *CurrentImageInfo;\r
   UINTN                                         Index;\r
+  UINTN                                         Index2;\r
 \r
   Print(L"  DescriptorVersion  - 0x%x\n", DescriptorVersion);\r
   Print(L"  DescriptorCount    - 0x%x\n", DescriptorCount);\r
@@ -1043,6 +1045,18 @@ DumpFmpImageInfo (
         Print(L"    LastAttemptVersion          - 0x%x\n", CurrentImageInfo->LastAttemptVersion);\r
         Print(L"    LastAttemptStatus           - 0x%x (%a)\n", CurrentImageInfo->LastAttemptStatus, LastAttemptStatusToString(CurrentImageInfo->LastAttemptStatus));\r
         Print(L"    HardwareInstance            - 0x%lx\n", CurrentImageInfo->HardwareInstance);\r
+        if (DescriptorVersion > 3) {\r
+          Print(L"    Dependencies                - ");\r
+          if (CurrentImageInfo->Dependencies == NULL) {\r
+            Print(L"NULL\n");\r
+          } else {\r
+            Index2 = 0;\r
+            do {\r
+              Print(L"%02x ", CurrentImageInfo->Dependencies->Dependencies[Index2]);\r
+            } while (CurrentImageInfo->Dependencies->Dependencies[Index2 ++] != EFI_FMP_DEP_END);\r
+            Print(L"\n");\r
+          }\r
+        }\r
       }\r
     }\r
     //\r