public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/1] efi_loader: correctly identify binary name
@ 2022-06-10 18:55 Heinrich Schuchardt
  2022-06-10 23:56 ` AKASHI Takahiro
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2022-06-10 18:55 UTC (permalink / raw)
  To: u-boot
  Cc: Vagrant Cascadian, AKASHI Takahiro, Masahisa Kojima,
	Vagrant Cascadian, Heinrich Schuchardt

Only on the sandbox the default EFI binary name (e.g. BOOTX64.EFI) must
match the host architecture.

In all other cases we must use the target architecture.

Use #elif where appropriate.

Reported-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 include/efi_default_filename.h | 40 +++++++++++++++++++++-------------
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/include/efi_default_filename.h b/include/efi_default_filename.h
index 13b9de8754..fc46e386a6 100644
--- a/include/efi_default_filename.h
+++ b/include/efi_default_filename.h
@@ -14,32 +14,42 @@
 
 #undef BOOTEFI_NAME
 
+#ifdef CONFIG_SANDBOX
+
 #if HOST_ARCH == HOST_ARCH_X86_64
 #define BOOTEFI_NAME "BOOTX64.EFI"
-#endif
-
-#if HOST_ARCH == HOST_ARCH_X86
+#elif HOST_ARCH == HOST_ARCH_X86
 #define BOOTEFI_NAME "BOOTIA32.EFI"
-#endif
-
-#if HOST_ARCH == HOST_ARCH_AARCH64
+#elif HOST_ARCH == HOST_ARCH_AARCH64
 #define BOOTEFI_NAME "BOOTAA64.EFI"
-#endif
-
-#if HOST_ARCH == HOST_ARCH_ARM
+#elif HOST_ARCH == HOST_ARCH_ARM
 #define BOOTEFI_NAME "BOOTARM.EFI"
-#endif
-
-#if HOST_ARCH == HOST_ARCH_RISCV32
+#elif HOST_ARCH == HOST_ARCH_RISCV32
 #define BOOTEFI_NAME "BOOTRISCV32.EFI"
+#elif HOST_ARCH == HOST_ARCH_RISCV64
+#define BOOTEFI_NAME "BOOTRISCV64.EFI"
+#else
+#error Unsupported UEFI architecture
 #endif
 
-#if HOST_ARCH == HOST_ARCH_RISCV64
+#else
+
+#if defined(CONFIG_ARM64)
+#define BOOTEFI_NAME "BOOTAA64.EFI"
+#elif defined(CONFIG_ARM)
+#define BOOTEFI_NAME "BOOTARM.EFI"
+#elif defined(CONFIG_X86_64)
+#define BOOTEFI_NAME "BOOTX64.EFI"
+#elif defined(CONFIG_X86)
+#define BOOTEFI_NAME "BOOTIA32.EFI"
+#elif defined(CONFIG_ARCH_RV32I)
+#define BOOTEFI_NAME "BOOTRISCV32.EFI"
+#elif defined(CONFIG_ARCH_RV64I)
 #define BOOTEFI_NAME "BOOTRISCV64.EFI"
+#else
+#error Unsupported UEFI architecture
 #endif
 
-#ifndef BOOTEFI_NAME
-#error Unsupported UEFI architecture
 #endif
 
 #endif
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] efi_loader: correctly identify binary name
  2022-06-10 18:55 [PATCH 1/1] efi_loader: correctly identify binary name Heinrich Schuchardt
@ 2022-06-10 23:56 ` AKASHI Takahiro
  0 siblings, 0 replies; 2+ messages in thread
From: AKASHI Takahiro @ 2022-06-10 23:56 UTC (permalink / raw)
  To: Heinrich Schuchardt
  Cc: u-boot, Vagrant Cascadian, Masahisa Kojima, Vagrant Cascadian

On Fri, Jun 10, 2022 at 08:55:24PM +0200, Heinrich Schuchardt wrote:
> Only on the sandbox the default EFI binary name (e.g. BOOTX64.EFI) must
> match the host architecture.
> 
> In all other cases we must use the target architecture.

So most of the new code, particularly else clause of "#ifdef CONFIG_SANDBOX",
is the same as the *original* commit in my (or rather Kojima-san's) patch.
Please retain the original copyright.

[1] https://lists.denx.de/pipermail/u-boot/2022-April/482711.html

-Takahiro Akashi

> Use #elif where appropriate.
> 
> Reported-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  include/efi_default_filename.h | 40 +++++++++++++++++++++-------------
>  1 file changed, 25 insertions(+), 15 deletions(-)
> 
> diff --git a/include/efi_default_filename.h b/include/efi_default_filename.h
> index 13b9de8754..fc46e386a6 100644
> --- a/include/efi_default_filename.h
> +++ b/include/efi_default_filename.h
> @@ -14,32 +14,42 @@
>  
>  #undef BOOTEFI_NAME
>  
> +#ifdef CONFIG_SANDBOX
> +
>  #if HOST_ARCH == HOST_ARCH_X86_64
>  #define BOOTEFI_NAME "BOOTX64.EFI"
> -#endif
> -
> -#if HOST_ARCH == HOST_ARCH_X86
> +#elif HOST_ARCH == HOST_ARCH_X86
>  #define BOOTEFI_NAME "BOOTIA32.EFI"
> -#endif
> -
> -#if HOST_ARCH == HOST_ARCH_AARCH64
> +#elif HOST_ARCH == HOST_ARCH_AARCH64
>  #define BOOTEFI_NAME "BOOTAA64.EFI"
> -#endif
> -
> -#if HOST_ARCH == HOST_ARCH_ARM
> +#elif HOST_ARCH == HOST_ARCH_ARM
>  #define BOOTEFI_NAME "BOOTARM.EFI"
> -#endif
> -
> -#if HOST_ARCH == HOST_ARCH_RISCV32
> +#elif HOST_ARCH == HOST_ARCH_RISCV32
>  #define BOOTEFI_NAME "BOOTRISCV32.EFI"
> +#elif HOST_ARCH == HOST_ARCH_RISCV64
> +#define BOOTEFI_NAME "BOOTRISCV64.EFI"
> +#else
> +#error Unsupported UEFI architecture
>  #endif
>  
> -#if HOST_ARCH == HOST_ARCH_RISCV64
> +#else
> +
> +#if defined(CONFIG_ARM64)
> +#define BOOTEFI_NAME "BOOTAA64.EFI"
> +#elif defined(CONFIG_ARM)
> +#define BOOTEFI_NAME "BOOTARM.EFI"
> +#elif defined(CONFIG_X86_64)
> +#define BOOTEFI_NAME "BOOTX64.EFI"
> +#elif defined(CONFIG_X86)
> +#define BOOTEFI_NAME "BOOTIA32.EFI"
> +#elif defined(CONFIG_ARCH_RV32I)
> +#define BOOTEFI_NAME "BOOTRISCV32.EFI"
> +#elif defined(CONFIG_ARCH_RV64I)
>  #define BOOTEFI_NAME "BOOTRISCV64.EFI"
> +#else
> +#error Unsupported UEFI architecture
>  #endif
>  
> -#ifndef BOOTEFI_NAME
> -#error Unsupported UEFI architecture
>  #endif
>  
>  #endif
> -- 
> 2.36.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-10 23:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-10 18:55 [PATCH 1/1] efi_loader: correctly identify binary name Heinrich Schuchardt
2022-06-10 23:56 ` AKASHI Takahiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox