From c41bffd3805f6bd4cbe817c969d21485040f1e3a Mon Sep 17 00:00:00 2001 From: Harry Liebel Date: Tue, 9 Sep 2014 15:58:33 +0000 Subject: ArmPlatformPkg/Bds: Fix delete boot option - We need to delete the boot option variable from storage not just adjust the BootOrder variable. - The Linux tool 'efibootmgr' still showed the previously removed boot options. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Harry Liebel Reviewed-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16070 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/BootOption.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'ArmPlatformPkg/Bds/BootOption.c') diff --git a/ArmPlatformPkg/Bds/BootOption.c b/ArmPlatformPkg/Bds/BootOption.c index 8ed636b53b..5712d2ccb4 100644 --- a/ArmPlatformPkg/Bds/BootOption.c +++ b/ArmPlatformPkg/Bds/BootOption.c @@ -367,6 +367,7 @@ BootOptionDelete ( UINTN BootOrderSize; UINT16* BootOrder; UINTN BootOrderCount; + CHAR16 BootVariableName[9]; EFI_STATUS Status; // Remove the entry from the BootOrder environment variable @@ -399,7 +400,17 @@ BootOptionDelete ( ); } + // Delete Boot#### environment variable + UnicodeSPrint (BootVariableName, 9 * sizeof(CHAR16), L"Boot%04X", BootOption->LoadOptionIndex); + Status = gRT->SetVariable ( + BootVariableName, + &gEfiGlobalVariableGuid, + EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, + 0, + NULL + ); + FreePool (BootOrder); - return EFI_SUCCESS; + return Status; } -- cgit v1.2.3