On 6/15/23 11:14, Simon Glass wrote:
On Tue, 13 Jun 2023 at 09:11, Heinrich Schuchardt
<heinrich.schucha...@canonical.com> wrote:

On the arm64 architecture booti_setup() is called for EFI FIT images.
This function call fails because EFI images typically do not have a
kernel signature.

Check that the operating system property "os" of the image is "linux"
before invoking booti_setup().

Fixes: 487b5fa6deb1 ("bootm: Handle kernel_noload on arm64")
Signed-off-by: Heinrich Schuchardt <heinrich.schucha...@canonical.com>
---
  boot/bootm.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/boot/bootm.c b/boot/bootm.c
index 4144ff3b03..75f0b4a9af 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -240,7 +240,8 @@ static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, 
int argc,

         if (images.os.type == IH_TYPE_KERNEL_NOLOAD) {
                 if (IS_ENABLED(CONFIG_CMD_BOOTI) &&
-                   images.os.arch == IH_ARCH_ARM64) {
+                   images.os.arch == IH_ARCH_ARM64 &&
+                   images.os.os == IH_OS_LINUX) {
                         ulong image_addr;
                         ulong image_size;

--
2.40.1


Reviewed-by: Simon Glass <s...@chromium.org>

I'm a little wary of this since no tests change. What is needed to test this?

We test loading EFI FIT images with test/py/tests/test_efi_fit.py. The image we use for testing is lib/efi_loader/helloworld.efi.

The its file used on arm64 has:

   arch = "arm";

This is why booti_setup() was never executed. We should fix this.

Furthermore all EFI binaries that we create in U-Boot have a kernel signature in the CRT header so booti_setup() will not fail. This is needed to run tools like initrddump.efi with GRUB's linux command.

test_fit.py is skipped on qemu_arm64 but some other test_fit*.py tests are executed. This should ensure regression testing.

Best regards

Heinrich

Reply via email to