[PATCH v2 1/4] cmd/bootefi: move efi_init_obj_list() to the start of do_bootefi
Heinrich Schuchardt
heinrich.schuchardt at canonical.com
Tue Apr 21 00:03:18 CEST 2026
None of the bootefi commands can be executed if the EFI sub-system cannot
be initialized.
Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
v2:
no change
---
cmd/bootefi.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 85f41c3b0a0..6dab709e507 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -142,6 +142,14 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc,
if (argc < 2)
return CMD_RET_USAGE;
+ /* Initialize EFI drivers */
+ ret = efi_init_obj_list();
+ if (ret != EFI_SUCCESS) {
+ log_err("Error: Cannot initialize UEFI sub-system, r = %lu\n",
+ ret & ~EFI_ERROR_MASK);
+ return CMD_RET_FAILURE;
+ }
+
if (argc > 2) {
ulong rd_addr = 0;
char *end = strchr(argv[2], ':');
@@ -179,14 +187,6 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc,
if (IS_ENABLED(CONFIG_CMD_BOOTEFI_SELFTEST) &&
!strcmp(argv[1], "selftest")) {
- /* Initialize EFI drivers */
- ret = efi_init_obj_list();
- if (ret != EFI_SUCCESS) {
- log_err("Error: Cannot initialize UEFI sub-system, r = %lu\n",
- ret & ~EFI_ERROR_MASK);
- return CMD_RET_FAILURE;
- }
-
ret = efi_install_fdt(fdt);
if (ret != EFI_SUCCESS)
return CMD_RET_FAILURE;
--
2.53.0
More information about the U-Boot
mailing list