[PATCH 1/1] efi_loader: BOOTSANDBOX.EFI is not a default file name

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Thu Apr 28 18:29:15 CEST 2022


On the sandbox choose a default EFI file name according to the host
architecture.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 include/efi_default_filename.h | 48 +++++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 18 deletions(-)

diff --git a/include/efi_default_filename.h b/include/efi_default_filename.h
index cb2ef9e131..13b9de8754 100644
--- a/include/efi_default_filename.h
+++ b/include/efi_default_filename.h
@@ -1,32 +1,44 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Default boot file name when none is present in the FilePath.
- * This is defined in the UEFI specification.
+ * When a boot option does not provide a file path the EFI file to be
+ * booted is \EFI\BOOT\$(BOOTEFI_NAME).EFI. The architecture specific
+ * file name is defined in this include.
  *
- * Copyright (c) 2022, Linaro Limited
+ * Copyright (c) 2022, Heinrich Schuchardt <xypron.glpk at gmx.de>
  */
+
 #ifndef _EFI_DEFAULT_FILENAME_H
 #define _EFI_DEFAULT_FILENAME_H
 
-#if defined(CONFIG_ARM64)
-#define BOOTEFI_NAME "BOOTAA64.EFI"
-#elif defined(CONFIG_ARM)
-#define BOOTEFI_NAME "BOOTARM.EFI"
-#elif defined(CONFIG_X86_64)
+#include <host_arch.h>
+
+#undef BOOTEFI_NAME
+
+#if HOST_ARCH == HOST_ARCH_X86_64
 #define BOOTEFI_NAME "BOOTX64.EFI"
-#elif defined(CONFIG_X86)
+#endif
+
+#if HOST_ARCH == HOST_ARCH_X86
 #define BOOTEFI_NAME "BOOTIA32.EFI"
-#elif defined(CONFIG_ARCH_RV32I)
+#endif
+
+#if HOST_ARCH == HOST_ARCH_AARCH64
+#define BOOTEFI_NAME "BOOTAA64.EFI"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_ARM
+#define BOOTEFI_NAME "BOOTARM.EFI"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_RISCV32
 #define BOOTEFI_NAME "BOOTRISCV32.EFI"
-#elif defined(CONFIG_ARCH_RV64I)
+#endif
+
+#if HOST_ARCH == HOST_ARCH_RISCV64
 #define BOOTEFI_NAME "BOOTRISCV64.EFI"
-#elif defined(CONFIG_SANDBOX)
-/*
- * SANDBOX is not defined in UEFI specification, but
- * this definition avoids build failure for SANDBOX.
- */
-#define BOOTEFI_NAME "BOOTSANDBOX.EFI"
-#else
+#endif
+
+#ifndef BOOTEFI_NAME
 #error Unsupported UEFI architecture
 #endif
 
-- 
2.34.1



More information about the U-Boot mailing list