From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com []) by mx.groups.io with SMTP id smtpd.web11.6216.1578634514007423001 for ; Thu, 09 Jan 2020 21:35:17 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: wei6.xu@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 21:35:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,415,1571727600"; d="scan'208";a="371507847" Received: from shwdeopenpsi174.ccr.corp.intel.com ([10.239.157.39]) by orsmga004.jf.intel.com with ESMTP; 09 Jan 2020 21:35:15 -0800 From: "Xu, Wei6" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao Subject: [edk2-devel][PATCH 2/3] MdeModulePkg/CapsuleApp: Enhance CapsuleApp for Fmp Capsule Dependency Date: Fri, 10 Jan 2020 13:34:53 +0800 Message-Id: <20200110053454.15376-3-wei6.xu@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20200110053454.15376-1-wei6.xu@intel.com> References: <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 Cc: Liming Gao Signed-off-by: Wei6 Xu --- 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.
+ Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.
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