MdeModulePkg/BMMUiLib: Replace same logic with API in UefiBootManagerLib

Use the API EfiBootManagerDeleteLoadOptionVariable in UefiBootManagerLib to
replace the same logic in function Var_DelBootOption/Var_DelDriverOption.
This can make code clean and prevent potential bugs.

https://bugzilla.tianocore.org/show_bug.cgi?id=391

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
Dandan Bi
2017-02-27 13:33:06 +08:00
committed by Hao Wu
parent 31abcf1dc7
commit bdc8cb0d3b
2 changed files with 11 additions and 228 deletions

View File

@@ -633,8 +633,6 @@ Var_UpdateBootOption (
/**
Delete Boot Option that represent a Deleted state in BootOptionMenu.
After deleting this boot option, call Var_ChangeBootOrder to
make sure BootOrder is in valid state.
@retval EFI_SUCCESS If all boot load option EFI Variables corresponding to
BM_LOAD_CONTEXT marked for deletion is deleted
@@ -646,21 +644,6 @@ Var_DelBootOption (
VOID
);
/**
After any operation on Boot####, there will be a discrepancy in BootOrder.
Since some are missing but in BootOrder, while some are present but are
not reflected by BootOrder. Then a function rebuild BootOrder from
scratch by content from BootOptionMenu is needed.
@retval EFI_SUCCESS The boot order is updated successfully.
@return other than EFI_SUCCESS if failed to change the "BootOrder" EFI Variable.
**/
EFI_STATUS
Var_ChangeBootOrder (
VOID
);
/**
This function create a currently loaded Drive Option from
the BMM. It then appends this Driver Option to the end of
@@ -687,9 +670,7 @@ Var_UpdateDriverOption (
);
/**
Delete Load Option that represent a Deleted state in BootOptionMenu.
After deleting this Driver option, call Var_ChangeDriverOrder to
make sure DriverOrder is in valid state.
Delete Load Option that represent a Deleted state in DriverOptionMenu.
@retval EFI_SUCCESS Load Option is successfully updated.
@return Other value than EFI_SUCCESS if failed to update "Driver Order" EFI
@@ -701,22 +682,6 @@ Var_DelDriverOption (
VOID
);
/**
After any operation on Driver####, there will be a discrepancy in
DriverOrder. Since some are missing but in DriverOrder, while some
are present but are not reflected by DriverOrder. Then a function
rebuild DriverOrder from scratch by content from DriverOptionMenu is
needed.
@retval EFI_SUCCESS The driver order is updated successfully.
@return other than EFI_SUCCESS if failed to set the "DriverOrder" EFI Variable.
**/
EFI_STATUS
Var_ChangeDriverOrder (
VOID
);
/**
This function delete and build multi-instance device path ConIn
console device.