SecurityPkg/OpalPassword: Add warning message for Secure Erase

https://bugzilla.tianocore.org/show_bug.cgi?id=1753
Add pop-up warning messages before secure erase action.
In order to notify user the secure erase action will take a longer time.
This change also fix some pop-up windows are unable to show up
complete message due to some strings are too long.

Signed-off-by: Maggie Chu <maggie.chu@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
Chu, Maggie
2019-05-07 14:19:35 +08:00
committed by Eric Dong
parent fbb0ec7ea4
commit f5245a1db1
2 changed files with 112 additions and 42 deletions

View File

@@ -511,13 +511,15 @@ GetDiskNameStringId(
/**
Confirm whether user truly want to do the revert action.
@param OpalDisk The device which need to do the revert action.
@param OpalDisk The device which need to perform data removal action.
@param ActionString Specifies the action name shown on pop up menu.
@retval EFI_SUCCESS Confirmed user want to do the revert action.
**/
EFI_STATUS
HiiConfirmRevertAction (
IN OPAL_DISK *OpalDisk
HiiConfirmDataRemovalAction (
IN OPAL_DISK *OpalDisk,
IN CHAR16 *ActionString
)
{
@@ -537,14 +539,14 @@ HiiConfirmRevertAction (
ApproveResponse = L'Y';
RejectResponse = L'N';
UnicodeSPrint(Unicode, StrSize(L"WARNING: Revert device needs about ####### seconds"), L"WARNING: Revert device needs about %d seconds", OpalDisk->EstimateTimeCost);
UnicodeSPrint(Unicode, StrSize(L"WARNING: ############# action needs about ####### seconds"), L"WARNING: %s action needs about %d seconds", ActionString, OpalDisk->EstimateTimeCost);
do {
CreatePopUp(
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
&Key,
Unicode,
L" System should not be powered off until revert completion ",
L" System should not be powered off until action completion ",
L" ",
L" Press 'Y/y' to continue, press 'N/n' to cancal ",
NULL
@@ -634,7 +636,16 @@ DriverCallback(
case HII_KEY_ID_PSID_REVERT:
OpalDisk = HiiGetOpalDiskCB(gHiiConfiguration.SelectedDiskIndex);
if (OpalDisk != NULL) {
return HiiConfirmRevertAction (OpalDisk);
return HiiConfirmDataRemovalAction (OpalDisk, L"Revert");
} else {
ASSERT (FALSE);
return EFI_SUCCESS;
}
case HII_KEY_ID_SECURE_ERASE:
OpalDisk = HiiGetOpalDiskCB(gHiiConfiguration.SelectedDiskIndex);
if (OpalDisk != NULL) {
return HiiConfirmDataRemovalAction (OpalDisk, L"Secure erase");
} else {
ASSERT (FALSE);
return EFI_SUCCESS;