armu-bootarm64

Applying fdt overlay with u-boot using extlinux.conf


I want to boot a distro with my board where the package manager controls extlinux.conf and ships dtb file for my board but I also have an extension board so I'll need an overlay to enable some features.

Previously I would just write a boot.scr file that applies the overlay and then boots the kernel. But the kernel's and initramfs' filenames change between versions so managing the boot.scr would be tedious.

Luckily it also ships with extlinux.conf that points to the new versions but I'm having a hard time finding a way to apply an fdt overlay that way.

Is that even possible?


Solution

  • The Syslinux syntax used in extlinux.conf files read by U-Boot does not include a keyword to apply fdt overlays, so you're out of luck here.

    It is possible to use the localboot keyword to have U-Boot execute a custom command instead of loading the kernel image specified with the kernel keyword. If a label contains the localboot keyword followed by a non-negative number, e.g.:

    label mycustomboot localboot 0

    U-Boot when booting the entry executes the commands contained in the localcmd environment variable. So in theory you could put in your localcmd environment variable the series of commands you need to execute at boot (load the kernel, the fdt and the overlay, apply the overlay, and boot the kernel). But I guess this would defeat the purpose of using extlinux.conf in the first place, and wouldn't be much different from how you do things with your boot.scr file...