Skip to content

tools/linux.py: Fix u-boot boot and add support for booting EFI stubs via u-boot#537

Merged
jannau merged 3 commits intoAsahiLinux:mainfrom
jannau:tools-linux-uboot-modernize
Feb 6, 2026
Merged

tools/linux.py: Fix u-boot boot and add support for booting EFI stubs via u-boot#537
jannau merged 3 commits intoAsahiLinux:mainfrom
jannau:tools-linux-uboot-modernize

Conversation

@jannau
Copy link
Copy Markdown
Member

@jannau jannau commented Jan 23, 2026

Switching from u-boot's distro boot scripts to standard boot broke ./tools/linux.py --u-boot ... since distro_bootcmd is no longer used. Adjust to the new boot method. Since there was a feature request for booting EFI stub kernel binaries as used by distributions support this via u-boot.
This will not work out of the box because there isn't enough reusable space in the default u-boot environment. This will require trivial fix inside u-boot.

U-boot switched to standard boot for Apple silicon systems. Adjust the
env to boot the payload directly.

Signed-off-by: Janne Grunau <j@jannau.net>
The Fedora-Asahi-Remix kernel is built as EFI stub. This means it needs
to be booted by u-boot. The EFI stub self-decompresses so force
compression to none.

Signed-off-by: Janne Grunau <j@jannau.net>
Drop 'preboot' env variable and set bootdelay to 0. When booting via
u-boot there is no need to start USB via the preboot command. Probing
all USB ports takes u-boot quite a while. It is not needed when booting
kernel and initramfs from memory.

Signed-off-by: Janne Grunau <j@jannau.net>
@jannau jannau requested a review from svenpeter42 as a code owner January 23, 2026 21:48
@jannau
Copy link
Copy Markdown
Member Author

jannau commented Jan 23, 2026

cc: @alxdrl

@alxdrl
Copy link
Copy Markdown
Contributor

alxdrl commented Jan 24, 2026

Thank you @jannau

Just tested here: loads fine but I'm dropped a the U-Boot prompt and I get invalid device tree when doing run bootcmd.

Must be doing something really dumb, what am I missing ?

https://gist.github.com/alxdrl/64a71add072a658471281ee8233d0074

(Edit: also tried chainloading a newer m1n1 beforehand)

@jannau
Copy link
Copy Markdown
Member Author

jannau commented Jan 24, 2026

U-Boot 2025.04 (Apr 20 2025 - 00:00:00 +0000)
...
bootmenu option 0 was not found

Your u-boot image is old. I'd would have expected 2025.10. The bootmenu log line is strange as well. The expected behaviour is that kernel boots immediately

can you try with the u-boot image from https://download.copr.fedorainfracloud.org/results/@asahi/u-boot/fedora-42-aarch64/09946170-uboot-tools/uboot-images-armv8-2025.10-100.fc42.noarch.rpm

@alxdrl
Copy link
Copy Markdown
Contributor

alxdrl commented Jan 24, 2026

Yeah that's a lot better now (used the wrong RPM URL yesterday)

Edit: @jannau about 261 bytes remaining for bootenv, really a tight fit especially for additionnal bootargs... I'll need to roll my own u-boot build I suppose... or do you see other options (like in-memory boot.scr) ?

@jannau
Copy link
Copy Markdown
Member Author

jannau commented Jan 24, 2026

I've prepared AsahiLinux/u-boot@4411224 as quick workaround. Fighting currently with fedora infrastructure but hopefully in the next few days there will be a build.

In the meantime you can build https://github.com/AsahiLinux/u-boot/releases/tag/asahi-v2025.10-2 yourself

@alxdrl
Copy link
Copy Markdown
Contributor

alxdrl commented Jan 24, 2026

I've prepared AsahiLinux/u-boot@4411224 as quick workaround. Fighting currently with fedora infrastructure but hopefully in the next few days there will be a build.

awesome

Edit: https://copr.fedorainfracloud.org/coprs/alxdrl/asahi-custom/build/10064679/

@jannau jannau merged commit e541be3 into AsahiLinux:main Feb 6, 2026
7 checks passed
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 this pull request may close these issues.

3 participants