From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 E21271A1E34 for ; Sun, 9 Oct 2016 20:49:12 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 09 Oct 2016 20:49:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,470,1473145200"; d="scan'208,217";a="1062633925" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 09 Oct 2016 20:49:12 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 9 Oct 2016 20:49:11 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.15]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.96]) with mapi id 14.03.0248.002; Mon, 10 Oct 2016 11:49:07 +0800 From: "Yao, Jiewen" To: "Dong, Eric" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , "Tian, Feng" , "Zeng, Star" , "Kinney, Michael D" , "Gao, Liming" Thread-Topic: [PATCH 2/4] MdeModulePkg/UiApp: Show test key warning info in FrontPage. Thread-Index: AQHSIpWZVwILga0N40mrIGffMdDq0aChDTzg Date: Mon, 10 Oct 2016 03:49:07 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386A0821@shsmsx102.ccr.corp.intel.com> References: <1476014313-11992-1-git-send-email-jiewen.yao@intel.com> <1476014313-11992-3-git-send-email-jiewen.yao@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [PATCH 2/4] MdeModulePkg/UiApp: Show test key warning info in FrontPage. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 03:49:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks. Got it. I will fix it. From: Dong, Eric Sent: Monday, October 10, 2016 9:28 AM To: Yao, Jiewen ; edk2-devel@lists.01.org Cc: Ni, Ruiyu ; Tian, Feng ; Zeng,= Star ; Kinney, Michael D = ; Gao, Liming Subject: RE: [PATCH 2/4] MdeModulePkg/UiApp: Show test key warning info in = FrontPage. Jiewen, For below code, the Banner is IN/OUT type. If the old value is not NULL, yo= u should free the old buffer before point to new one. > + if (TestKeyForRecovery && TestKeyForFirmwareUpdate) { > + *BannerStr =3D HiiGetString(gFrontPagePrivate.HiiHandle, > STRING_TOKEN(STR_TEST_KEY_USED_RECOVERY_AND_FIRMWARE_UPDATE), NULL); > + } > + else if (TestKeyForRecovery) { > + *BannerStr =3D HiiGetString(gFrontPagePrivate.HiiHandle, STRING_TO= KEN(STR_TEST_KEY_USED_RECOVERY), NULL); > + } > + else if (TestKeyForFirmwareUpdate) { > + *BannerStr =3D HiiGetString(gFrontPagePrivate.HiiHandle, STRING_TO= KEN(STR_TEST_KEY_USED_FIRMWARE_UPDATE), NULL); > + } Thanks, Eric > -----Original Message----- > From: Yao, Jiewen > Sent: Sunday, October 09, 2016 7:59 PM > To: edk2-devel@lists.01.org > Cc: Dong, Eric; Ni, Ruiyu; Tian, Feng; Zeng, Star; Kinney, Michael D; Gao= , Liming > Subject: [PATCH 2/4] MdeModulePkg/UiApp: Show test key warning info in Fr= ontPage. > > The UiApp is updated to consume PcdTestKeyUsed to know if there is any > test key used in current BIOS, such as recovery key, > or capsule update key. > Then UiApp show warning information in front page. > > Cc: Eric Dong > > Cc: Ruiyu Ni > > Cc: Feng Tian > > Cc: Star Zeng > > Cc: Michael D Kinney > > Cc: Liming Gao > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jiewen Yao > > --- > MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c | 34 ++++++++++++= ++++++++ > MdeModulePkg/Application/UiApp/FrontPageStrings.uni | 8 ++++- > MdeModulePkg/Application/UiApp/UiApp.inf | 3 +- > 3 files changed, 43 insertions(+), 2 deletions(-) > > diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c b/Mde= ModulePkg/Application/UiApp/FrontPageCustomizedUi.c > index 6e4f7b5..4070cd5 100644 > --- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c > +++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c > @@ -16,8 +16,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EIT= HER EXPRESS OR IMPLIED. > #include > #include > #include > +#include "FrontPage.h" > #include "FrontPageCustomizedUiSupport.h" > > +#define TEST_KEY_USED_RECOVERY (BIT0 + BIT32) > +#define TEST_KEY_USED_FIRMWARE_UPDATE (BIT1 + BIT33) > + > +extern FRONT_PAGE_CALLBACK_DATA gFrontPagePrivate; > + > /** > Customize menus in the page. > > @@ -129,4 +135,32 @@ UiCustomizeFrontPageBanner ( > IN OUT EFI_STRING *BannerStr > ) > { > + UINT64 TestKeyUsed; > + BOOLEAN TestKeyForRecovery; > + BOOLEAN TestKeyForFirmwareUpdate; > + > + if ((LineIndex =3D=3D 5) && LeftOrRight) { > + // Update STR_CUSTOMIZE_BANNER_LINE5_LEFT > + TestKeyUsed =3D PcdGet64(PcdTestKeyUsed); > + if ((TestKeyUsed & TEST_KEY_USED_RECOVERY) =3D=3D TEST_KEY_USED_RECO= VERY) { > + TestKeyForRecovery =3D TRUE; > + } else { > + TestKeyForRecovery =3D FALSE; > + } > + if ((TestKeyUsed & TEST_KEY_USED_FIRMWARE_UPDATE) =3D=3D TEST_KEY_US= ED_FIRMWARE_UPDATE) { > + TestKeyForFirmwareUpdate =3D TRUE; > + } else { > + TestKeyForFirmwareUpdate =3D FALSE; > + } > + if (TestKeyForRecovery && TestKeyForFirmwareUpdate) { > + *BannerStr =3D HiiGetString(gFrontPagePrivate.HiiHandle, > STRING_TOKEN(STR_TEST_KEY_USED_RECOVERY_AND_FIRMWARE_UPDATE), NULL); > + } > + else if (TestKeyForRecovery) { > + *BannerStr =3D HiiGetString(gFrontPagePrivate.HiiHandle, STRING_TO= KEN(STR_TEST_KEY_USED_RECOVERY), NULL); > + } > + else if (TestKeyForFirmwareUpdate) { > + *BannerStr =3D HiiGetString(gFrontPagePrivate.HiiHandle, STRING_TO= KEN(STR_TEST_KEY_USED_FIRMWARE_UPDATE), NULL); > + } > + } > + return; > } > diff --git a/MdeModulePkg/Application/UiApp/FrontPageStrings.uni b/MdeMod= ulePkg/Application/UiApp/FrontPageStrings.uni > index 71cb788..8ba19dc 100644 > --- a/MdeModulePkg/Application/UiApp/FrontPageStrings.uni > +++ b/MdeModulePkg/Application/UiApp/FrontPageStrings.uni > @@ -2,7 +2,7 @@ > // > // String definitions for BdsPlatform formset. > // > -// Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved. > +// Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved. > // This program and the accompanying materials > // are licensed and made available under the terms and conditions of th= e BSD License > // which accompanies this distribution. The full text of the license m= ay be found at > @@ -68,5 +68,11 @@ > #language fr-FR "" > #string STR_CUSTOMIZE_BANNER_LINE5_RIGHT #language en-US "" > #language fr-FR "" > +#string STR_TEST_KEY_USED_RECOVERY #language en-US= "WARNING: Test key is used for recovery." > + #language fr-FR= "WARNING: Test key is used for recovery." > +#string STR_TEST_KEY_USED_FIRMWARE_UPDATE #language en-US= "WARNING: Test key is used for firmware update." > + #language fr-FR= "WARNING: Test key is used for firmware update." > +#string STR_TEST_KEY_USED_RECOVERY_AND_FIRMWARE_UPDATE #language en-US= "WARNING: Test key is used for recovery and > update." > + #language fr-FR= "WARNING: Test key is used for recovery and update." > #string STR_NULL_STRING #language en-US " " > #language fr-FR " " > diff --git a/MdeModulePkg/Application/UiApp/UiApp.inf b/MdeModulePkg/Appl= ication/UiApp/UiApp.inf > index 6df6e47..d144462 100644 > --- a/MdeModulePkg/Application/UiApp/UiApp.inf > +++ b/MdeModulePkg/Application/UiApp/UiApp.inf > @@ -1,7 +1,7 @@ > ## @file > # UiApp module is driver for BDS phase. > # > -# Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved. > +# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved. > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the= BSD License > # which accompanies this distribution. The full text of the license ma= y be found at > @@ -82,6 +82,7 @@ > gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution ## C= ONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution ## C= ONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString ## C= ONSUMES > + gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed ## C= ONSUMES > > [UserExtensions.TianoCore."ExtraFiles"] > UiAppExtra.uni > -- > 2.7.4.windows.1