Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong EFI file in iso, qcow and raw efi images when cross-building #3949

Closed
deitch opened this issue Oct 4, 2023 · 0 comments · Fixed by #3951
Closed

Wrong EFI file in iso, qcow and raw efi images when cross-building #3949

deitch opened this issue Oct 4, 2023 · 0 comments · Fixed by #3951

Comments

@deitch
Copy link
Collaborator

deitch commented Oct 4, 2023

Description

When you build an image via lkt build, and the target is one of the following for EFI:

  • raw
  • qcow
  • iso

it injects the correct .EFI file in the boot path. For arm64, that is BOOTAA64.EFI, while for amd64, that is BOOTX64.EFI.

It detects which one to inject based in uname -m.

That works fine if you are building on amd64 for amd64, or arm64 for arm64. However, if you are cross-building - arm64 for amd64 or amd64 for arm64 - then the final image should be the target arch, but because it uses uname -m, it injects for the build arch.

Steps to reproduce the issue:

  1. On an arm64 device, runlinuxkit build linuxkit --arch amd64; or, on an amd64 device, linuxkit build linuxkit --arch arm64
  2. Try to boot it, it will hang
  3. Inspect the filesystem, under /BOOT/EFI, you will find the .EFI file for the arch on which you built not for which you are _targeting)

The fix is straightforward:

  1. Find the four places we set the BOOTFILE
  2. Replace uname -m detection with passing the target arch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant