On 2025/11/28 20:34, Kunihiko Hayashi wrote:
Hi Heinrich,

On 2025/11/21 17:41, Heinrich Schuchardt wrote:
On 11/21/25 00:38, Masahisa Kojima wrote:
The bootm command can handle the compressed image, but current
code fails to boot from it.

       ## Loading kernel (any) from FIT Image at a8000000 ...
       <snip>
            Compression:  gzip compressed
            Data Start:   0xa80000d4
            Data Size:    10114520 Bytes = 9.6 MiB
            Architecture: AArch64
            OS:           EFI Firmware
            Load Address: 0x90000000

       <snip>
          Uncompressing Kernel Image to 90000000
       ## Transferring control to EFI (at address a80000d4) ...
       Booting <NULL>
       Not a PE-COFF file
       Loading image failed

To take care of the compressed image, the load address needs
to be passed instead of the original compressed image address.

Signed-off-by: Masahisa Kojima <[email protected]>

Hello Masahisa,

Thank you for diving into this problem.

In test/py/tests/test_efi_fit.py we are testing on the sandbox with and
without compression. Why would the problem not show up in the test?

539         # Run tests
540         # - fdt OFF, initrd OFF, gzip OFF
541         launch_efi(False, False, False)
542         # - fdt ON, initrd OFF, gzip OFF
543         launch_efi(True, False, False)
544         # - fdt OFF, initrd ON, gzip OFF
545         launch_efi(False, True, False)
546
547         if is_sandbox:
548             # - fdt OFF, initrd OFF, gzip ON
549             launch_efi(False, False, True)
550             # - fdt ON, initrd OFF, gzip ON
551             launch_efi(True, False, True)
552             # - fdt OFF, initrd ON, gzip ON
553             launch_efi(False, True, True)

The test should be corrected to show you issue.

Can you show us how to run it with sandbox?

To understand the situation, I tried running the test using v2025.10.

      ./test/py/test.py --bd sandbox   --build  -k efi_fit
      ./test/py/test.py --bd sandbox64 --build  -k efi_fit

The test was skipped as follows:
      test/py/tests/test_efi_fit.py::test_efi_fit_launch SKIPPED (.config
feature "generate_acpi_table" enabled)

After disabling ACPI, the test failed with the following error
and could not be reproduced.

It was a bit tricky, however, I have successfully reproduce the test in 
sandbox64.
(sandbox causes SEGV because of the other issue).

Before executing the test, disable the following definitions:

    CONFIG_ACPI
    CONFIG_BINFMT_FDT

This test includes three items with gzip.

    # - fdt OFF, initrd OFF, gzip ON
    launch_efi(False, False, True)
    # - fdt ON, initrd OFF, gzip ON
    launch_efi(True, False, True)
    # - fdt OFF, initrd ON, gzip ON
    launch_efi(False, True, True)

"initrd = ON" test item can't be executed.

    INITRD Dump
    ===========
    => load
    Load File2 protocol not found

This item uses File2 protocol to read "initrd" file, however,
test_efi_fit.py uses "bootm" on the FIT image, so there is no chance
to set FilePathList in EFI.

At this time, all we need to do is launch the compressed EFI app,
so we can disable "initrd" test item tentatively.

I found an error in this test before applying the patch,

    Booting /\home\user\u-boot\build-sandbox64\test-efi-fit.fit
    Not a PE-COFF file
    Loading image failed
    ...
    FAILED test/py/tests/test_efi_fit.py::test_efi_fit_launch - assert 'Hello, 
world'

and found no error after applying the patch.

    test/py/tests/test_efi_fit.py .                                    [100%]

Tested-by: Kunihiko Hayashi <[email protected]>

If this patch is out of patchwork, maybe it should be re-posted with this tag.

Thank you,

---
Best Regards
Kunihiko Hayashi

Reply via email to