public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Xu, Wei6" <wei6.xu@intel.com>
To: devel@edk2.groups.io
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <liming.gao@intel.com>
Subject: [edk2-devel][PATCH 2/3] MdeModulePkg/CapsuleApp: Enhance CapsuleApp for Fmp Capsule Dependency
Date: Fri, 10 Jan 2020 13:34:53 +0800	[thread overview]
Message-ID: <20200110053454.15376-3-wei6.xu@intel.com> (raw)
In-Reply-To: <20200110053454.15376-1-wei6.xu@intel.com>

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>
---
 MdeModulePkg/Application/CapsuleApp/CapsuleDump.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
index 58a93568d0..d65197b256 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
@@ -1,9 +1,9 @@
 /** @file
   Dump Capsule image information.
 
-  Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
 #include "CapsuleApp.h"
@@ -336,10 +336,11 @@ CHAR8 *mLastAttemptStatusString[] = {
   "Error: Incorrect Version",
   "Error: Invalid Format",
   "Error: Auth Error",
   "Error: Power Event AC",
   "Error: Power Event Battery",
+  "Error: Unsatisfied Dependencies",
 };
 
 /**
   Convert FwType to a string.
 
@@ -1005,10 +1006,11 @@ DumpFmpImageInfo (
   IN CHAR16                          *PackageVersionName
   )
 {
   EFI_FIRMWARE_IMAGE_DESCRIPTOR                 *CurrentImageInfo;
   UINTN                                         Index;
+  UINTN                                         Index2;
 
   Print(L"  DescriptorVersion  - 0x%x\n", DescriptorVersion);
   Print(L"  DescriptorCount    - 0x%x\n", DescriptorCount);
   Print(L"  DescriptorSize     - 0x%x\n", DescriptorSize);
   Print(L"  PackageVersion     - 0x%x\n", PackageVersion);
@@ -1041,10 +1043,22 @@ DumpFmpImageInfo (
       Print(L"    LowestSupportedImageVersion - 0x%x\n", CurrentImageInfo->LowestSupportedImageVersion);
       if (DescriptorVersion > 2) {
         Print(L"    LastAttemptVersion          - 0x%x\n", CurrentImageInfo->LastAttemptVersion);
         Print(L"    LastAttemptStatus           - 0x%x (%a)\n", CurrentImageInfo->LastAttemptStatus, LastAttemptStatusToString(CurrentImageInfo->LastAttemptStatus));
         Print(L"    HardwareInstance            - 0x%lx\n", CurrentImageInfo->HardwareInstance);
+        if (DescriptorVersion > 3) {
+          Print(L"    Dependencies                - ");
+          if (CurrentImageInfo->Dependencies == NULL) {
+            Print(L"NULL\n");
+          } else {
+            Index2 = 0;
+            do {
+              Print(L"%02x ", CurrentImageInfo->Dependencies->Dependencies[Index2]);
+            } while (CurrentImageInfo->Dependencies->Dependencies[Index2 ++] != EFI_FMP_DEP_END);
+            Print(L"\n");
+          }
+        }
       }
     }
     //
     // Use DescriptorSize to move ImageInfo Pointer to stay compatible with different ImageInfo version
     //
-- 
2.16.2.windows.1


  parent reply	other threads:[~2020-01-10  5:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10  5:34 [edk2-devel][PATCH 0/3] Fmp Capsule Dependency implementation Xu, Wei6
2020-01-10  5:34 ` [edk2-devel][PATCH 1/3] MdePkg: Add definition for Fmp Capsule Dependency Xu, Wei6
2020-01-10  5:34 ` Xu, Wei6 [this message]
2020-01-10  5:34 ` [edk2-devel][PATCH 3/3] FmdDevicePkg/FmpDxe: Support " Xu, Wei6
2020-01-16 12:25 ` [edk2-devel][PATCH 0/3] Fmp Capsule Dependency implementation Liming Gao
2020-01-16 13:31   ` Xu, Wei6
2020-01-16 13:54     ` Liming Gao
     [not found]     ` <15EA627A19795932.4264@groups.io>
2020-01-17  0:32       ` Liming Gao
2020-01-17  0:49         ` Xu, Wei6

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200110053454.15376-3-wei6.xu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox