X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FBootMaintenanceManagerUiLib%2FBootMaintenance.c;h=fdcb56a9df2b5d7012767eef22c980f12d6d31dc;hp=f40c61a0fb909877ef8a070fdba9808685375bca;hb=14923c1a6bf9940b48feeaf47cb5d6c662b6528c;hpb=6eeeb2882637f081bf4e44bdbfb599f4f3b1ba84 diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c index f40c61a0fb..fdcb56a9df 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c @@ -1,7 +1,7 @@ /** @file The functions for Boot Maintainence Main menu. -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2017, 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 may be found at @@ -571,6 +571,7 @@ UpdateTerminalContent ( /** Update the console content in ConsoleMenu. + @param ConsoleName The name for the console device type. @param BmmData The BMM fake NV data. **/ @@ -1110,6 +1111,7 @@ BootMaintCallback ( // 2. Re-scan the BootOption menus (including the legacy boot option). // CustomizeMenus (); + EfiBootManagerRefreshAllBootOption (); BOpt_GetBootOptions (Private); mFirstEnterBMMForm = TRUE; } @@ -1213,9 +1215,11 @@ BootMaintCallback ( } if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_BOOT) { + CleanUselessBeforeSubmit (Private); CurrentFakeNVMap->BootOptionChanged = FALSE; *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT; } else if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_DRIVER) { + CleanUselessBeforeSubmit (Private); CurrentFakeNVMap->DriverOptionChanged = FALSE; *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT; } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER) { @@ -1268,6 +1272,7 @@ BootMaintCallback ( case KEY_VALUE_SAVE_AND_EXIT: case KEY_VALUE_NO_SAVE_AND_EXIT: if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) { + CleanUselessBeforeSubmit (Private); *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT; } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) { DiscardChangeHandler (Private, CurrentFakeNVMap); @@ -1298,7 +1303,7 @@ BootMaintCallback ( } else if ((QuestionId >= CON_OUT_DEVICE_QUESTION_ID) && (QuestionId < CON_OUT_DEVICE_QUESTION_ID + MAX_MENU_NUMBER)) { UpdateConsoleContent (L"ConOut", CurrentFakeNVMap); } else if ((QuestionId >= CON_ERR_DEVICE_QUESTION_ID) && (QuestionId < CON_ERR_DEVICE_QUESTION_ID + MAX_MENU_NUMBER)) { - UpdateConsoleContent (L"ConErr", CurrentFakeNVMap); + UpdateConsoleContent (L"ErrOut", CurrentFakeNVMap); } } @@ -1369,6 +1374,36 @@ DiscardChangeHandler ( } } +/** + This function is to clean some useless data before submit changes. + + @param Private The BMM context data. + +**/ +VOID +CleanUselessBeforeSubmit ( + IN BMM_CALLBACK_DATA *Private + ) +{ + UINT16 Index; + if (Private->BmmPreviousPageId != FORM_BOOT_DEL_ID) { + for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) { + if (Private->BmmFakeNvData.BootOptionDel[Index] && !Private->BmmFakeNvData.BootOptionDelMark[Index]) { + Private->BmmFakeNvData.BootOptionDel[Index] = FALSE; + Private->BmmOldFakeNVData.BootOptionDel[Index] = FALSE; + } + } + } + if (Private->BmmPreviousPageId != FORM_DRV_DEL_ID) { + for (Index = 0; Index < DriverOptionMenu.MenuNumber; Index++) { + if (Private->BmmFakeNvData.DriverOptionDel[Index] && !Private->BmmFakeNvData.DriverOptionDelMark[Index]) { + Private->BmmFakeNvData.DriverOptionDel[Index] = FALSE; + Private->BmmOldFakeNVData.DriverOptionDel[Index] = FALSE; + } + } + } +} + /** Update the menus in the BMM page. @@ -1656,8 +1691,6 @@ BootMaintenanceManagerUiLibConstructor ( Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &mBmmCallbackInfo->FormBrowser2); ASSERT_EFI_ERROR (Status); - EfiBootManagerRefreshAllBootOption (); - // // Create LoadOption in BmmCallbackInfo for Driver Callback //