From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 70FED210C281D for ; Thu, 26 Jul 2018 03:17:06 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2018 03:17:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,404,1526367600"; d="scan'208";a="70521144" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.158.46]) by fmsmga002.fm.intel.com with ESMTP; 26 Jul 2018 03:17:05 -0700 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Michael D Kinney , Jiewen Yao , Yonghong Zhu Date: Thu, 26 Jul 2018 18:16:54 +0800 Message-Id: <1532600215-67392-6-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1532600215-67392-1-git-send-email-star.zeng@intel.com> References: <1532600215-67392-1-git-send-email-star.zeng@intel.com> Subject: [PATCH 5/6] MdeModulePkg CapsuleApp: Prompt info for -C option X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2018 10:17:06 -0000 Cc: Michael D Kinney Cc: Jiewen Yao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- MdeModulePkg/Application/CapsuleApp/CapsuleApp.c | 17 +++++++++++++---- MdeModulePkg/Application/CapsuleApp/CapsuleDump.c | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c index 93bf4252bac6..2967b0d1dd18 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 ); @@ -466,11 +466,13 @@ ClearCapsuleStatusVariable ( UINT32 Index; CHAR16 CapsuleVarName[20]; CHAR16 *TempVarName; + BOOLEAN Found; StrCpyS (CapsuleVarName, sizeof(CapsuleVarName)/sizeof(CapsuleVarName[0]), L"Capsule"); TempVarName = CapsuleVarName + StrLen (CapsuleVarName); Index = 0; + Found = FALSE; while (TRUE) { UnicodeSPrint (TempVarName, 5 * sizeof(CHAR16), L"%04x", Index); @@ -481,12 +483,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; } + Found = TRUE; + + Print (L"Clear %s %r\n", CapsuleVarName, Status); Index++; if (Index > 0xFFFF) { @@ -494,6 +499,10 @@ ClearCapsuleStatusVariable ( } } + if (!Found) { + Print (L"No any Capsule#### variable found\n"); + } + return EFI_SUCCESS; } @@ -850,7 +859,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