efibootmgr/backport-efibootmgr-delete_bootnext-is-just-a-boolean-not-an-entry-id.patch
zhangxingrong bb9532bb41 add some patchs from upstream
(cherry picked from commit a8a605475c404a35c694d9b20ad8b7ab0aa396e0)
2024-06-17 14:45:36 +08:00

33 lines
1.0 KiB
Diff

From 0ca99d442e9d0a49d3ec373413d781ca392b57bc Mon Sep 17 00:00:00 2001
From: Dima Zavin <dmitriyz@waymo.com>
Date: Mon, 8 Jan 2024 11:23:20 -0800
Subject: [PATCH] efibootmgr: delete_bootnext is just a boolean, not an entry
id
When deleting bootnext, there's nothing to validate (other than
the variable existing, in which case del will fail as expected).
This appears to be a copy/paste error when adding the delete-bootnext
option from the [create] bootnext option.
Signed-off-by: Dima Zavin <dmitriyz@waymo.com>
---
src/efibootmgr.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/efibootmgr.c b/src/efibootmgr.c
index b35fcf4..6f51d33 100644
--- a/src/efibootmgr.c
+++ b/src/efibootmgr.c
@@ -1928,10 +1928,6 @@ main(int argc, char **argv)
}
if (opts.delete_bootnext) {
- if (!is_current_entry(opts.delete_bootnext))
- errorx(17, "Boot entry %04X does not exist",
- opts.delete_bootnext);
-
ret = efi_del_variable(EFI_GLOBAL_GUID, "BootNext");
if (ret < 0)
error(10, "Could not delete BootNext");