public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Dong, Eric" <eric.dong@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
	"Tian, Feng" <feng.tian@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>
Subject: Re: [PATCH 2/4] MdeModulePkg/UiApp: Show test key warning info in FrontPage.
Date: Mon, 10 Oct 2016 03:49:07 +0000	[thread overview]
Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386A0821@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <ED077930C258884BBCB450DB737E66224866310F@shsmsx102.ccr.corp.intel.com>

Thanks. Got it.
I will fix it.

From: Dong, Eric
Sent: Monday, October 10, 2016 9:28 AM
To: Yao, Jiewen <jiewen.yao@intel.com>; edk2-devel@lists.01.org
Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Tian, Feng <feng.tian@intel.com>; Zeng, Star <star.zeng@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
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, you should free the old buffer before point to new one.

> +    if (TestKeyForRecovery && TestKeyForFirmwareUpdate) {
> +      *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle,
> STRING_TOKEN(STR_TEST_KEY_USED_RECOVERY_AND_FIRMWARE_UPDATE), NULL);
> +    }
> +    else if (TestKeyForRecovery) {
> +      *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle, STRING_TOKEN(STR_TEST_KEY_USED_RECOVERY), NULL);
> +    }
> +    else if (TestKeyForFirmwareUpdate) {
> +      *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle, STRING_TOKEN(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<mailto: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 FrontPage.
>
> 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 <eric.dong@intel.com<mailto:eric.dong@intel.com>>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com<mailto:ruiyu.ni@intel.com>>
> Cc: Feng Tian <feng.tian@intel.com<mailto:feng.tian@intel.com>>
> Cc: Star Zeng <star.zeng@intel.com<mailto:star.zeng@intel.com>>
> Cc: Michael D Kinney <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>
> Cc: Liming Gao <liming.gao@intel.com<mailto:liming.gao@intel.com>>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>
> ---
>  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/MdeModulePkg/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, EITHER EXPRESS OR IMPLIED.
>  #include <Protocol/HiiConfigAccess.h>
>  #include <Library/BaseLib.h>
>  #include <Library/MemoryAllocationLib.h>
> +#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 == 5) && LeftOrRight) {
> +    // Update STR_CUSTOMIZE_BANNER_LINE5_LEFT
> +    TestKeyUsed = PcdGet64(PcdTestKeyUsed);
> +    if ((TestKeyUsed & TEST_KEY_USED_RECOVERY) == TEST_KEY_USED_RECOVERY) {
> +      TestKeyForRecovery = TRUE;
> +    } else {
> +      TestKeyForRecovery = FALSE;
> +    }
> +    if ((TestKeyUsed & TEST_KEY_USED_FIRMWARE_UPDATE) == TEST_KEY_USED_FIRMWARE_UPDATE) {
> +      TestKeyForFirmwareUpdate = TRUE;
> +    } else {
> +      TestKeyForFirmwareUpdate = FALSE;
> +    }
> +    if (TestKeyForRecovery && TestKeyForFirmwareUpdate) {
> +      *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle,
> STRING_TOKEN(STR_TEST_KEY_USED_RECOVERY_AND_FIRMWARE_UPDATE), NULL);
> +    }
> +    else if (TestKeyForRecovery) {
> +      *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle, STRING_TOKEN(STR_TEST_KEY_USED_RECOVERY), NULL);
> +    }
> +    else if (TestKeyForFirmwareUpdate) {
> +      *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle, STRING_TOKEN(STR_TEST_KEY_USED_FIRMWARE_UPDATE), NULL);
> +    }
> +  }
> +  return;
>  }
> diff --git a/MdeModulePkg/Application/UiApp/FrontPageStrings.uni b/MdeModulePkg/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.<BR>
> +//  Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
>  //  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 may 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/Application/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.<BR>
> +#  Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
>  #  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 may be found at
> @@ -82,6 +82,7 @@
>    gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution  ## CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution    ## CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString           ## CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed                     ## CONSUMES
>
>  [UserExtensions.TianoCore."ExtraFiles"]
>    UiAppExtra.uni
> --
> 2.7.4.windows.1


  reply	other threads:[~2016-10-10  3:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-09 11:58 [PATCH 0/4] Show test key info on front page Jiewen Yao
2016-10-09 11:58 ` [PATCH 1/4] MdeModulePkg/dec: Add PcdTestKeyUsed PCD Jiewen Yao
2016-10-09 11:58 ` [PATCH 2/4] MdeModulePkg/UiApp: Show test key warning info in FrontPage Jiewen Yao
2016-10-10  1:28   ` Dong, Eric
2016-10-10  3:49     ` Yao, Jiewen [this message]
2016-10-09 11:58 ` [PATCH 3/4] QuarkPlatformPkg/Bds: Produce PcdTestKeyUsed Jiewen Yao
2016-10-09 11:58 ` [PATCH 4/4] Vlv2TbleDevicePkg/Bds: " Jiewen Yao
2016-10-10  1:19   ` Wei, David
2016-10-09 17:25 ` [PATCH 0/4] Show test key info on front page Kinney, Michael D
2016-10-10  3:43   ` Yao, Jiewen
2016-10-10  2:14 ` Gao, Liming

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=74D8A39837DF1E4DA445A8C0B3885C50386A0821@shsmsx102.ccr.corp.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