]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/Bds: Fix delete boot option
authorHarry Liebel <Harry.Liebel@arm.com>
Tue, 9 Sep 2014 15:58:33 +0000 (15:58 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 9 Sep 2014 15:58:33 +0000 (15:58 +0000)
- 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 <Harry.Liebel@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16070 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/Bds/BootOption.c

index 8ed636b53bbbd744d7628e34f70ca86396bcb3e2..5712d2ccb4f98dfab3b7cf813589e1163ac56948 100644 (file)
@@ -367,6 +367,7 @@ BootOptionDelete (
   UINTN         BootOrderSize;\r
   UINT16*       BootOrder;\r
   UINTN         BootOrderCount;\r
+  CHAR16        BootVariableName[9];\r
   EFI_STATUS    Status;\r
 \r
   // Remove the entry from the BootOrder environment variable\r
@@ -399,7 +400,17 @@ BootOptionDelete (
         );\r
   }\r
 \r
+  // Delete Boot#### environment variable\r
+  UnicodeSPrint (BootVariableName, 9 * sizeof(CHAR16), L"Boot%04X", BootOption->LoadOptionIndex);\r
+  Status = gRT->SetVariable (\r
+      BootVariableName,\r
+      &gEfiGlobalVariableGuid,\r
+      EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+      0,\r
+      NULL\r
+      );\r
+\r
   FreePool (BootOrder);\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r