BLS Comes to U-Boot: A New Bootmeth

U-Boot has long supported extlinux-style boot configurations, but there is another widely-used standard for describing boot entries: the Boot Loader Specification (BLS). Fedora, RHEL and other distributions use BLS Type #1 entries to describe available kernels and their parameters. With this series, U-Boot gains native support for discovering and booting from these entries.

Why BLS?

The extlinux format works well, but BLS offers a different approach. Rather than a single configuration file listing all boot options, BLS uses individual entry files—one per kernel version—in a standardised directory layout. This design maps naturally to how distributions manage kernel packages: installing a new kernel simply drops a new .conf file into loader/entries/, without editing a shared configuration.

The specification also defines fields for architecture filtering, version-based sorting, and machine identification, providing structure that extlinux leaves to convention.

What’s Implemented

The new bootmeth_bls bootmeth integrates with U-Boot’s standard boot framework. During bootflow scan, it looks for a BLS entry file at loader/entry.conf on each bootdev partition. When found, it parses the entry and registers a bootflow that can be displayed in menus or booted directly.

The parser handles all the core BLS fields:

  • titleversion — identification and display
  • linux — kernel path, including FIT path#config syntax
  • options — kernel command line (multiple lines concatenated)
  • initrd — initial ramdisk (multiple lines supported)
  • devicetreedevicetree-overlay — device tree configuration
  • architecturemachine-idsort-key — parsed for future use

The bootmeth reuses U-Boot’s existing PXE infrastructure for the actual file-loading and boot execution, converting the BLS entry into a PXE label behind the scenes. This avoids duplicating the kernel/initrd/FDT loading logic and keeps the new code focused on parsing and discovery.

A U-Boot Extension: the ‘fit’ Field

FITs are central to U-Boot’s boot flow, but the BLS spec has no concept of them. The linux field can point to a FIT using path#config syntax, but this overloads the field’s meaning and makes it harder for the bootmeth to distinguish a plain kernel from a FIT.

To address this, the series adds a fit field as a U-Boot-specific extension. When present, fit takes priority over linux and explicitly identifies the image as a FIT:

title Ubuntu 24.04
version 6.8.0
fit /boot/ubuntu-6.8.0.fit
options root=/dev/sda3 ro quiet
initrd /boot/initrd-6.8.0.img

This is not part of the BLS spec yet, but it fits naturally into the key-value format and gives U-Boot the information it needs to handle FITs properly.

Multiple Initrds

The BLS spec allows multiple initrd lines, and distributions use this for supplementary initrds (microcode updates, overlays, etc.). The series extends the PXE infrastructure to support this: all initrd paths are collected into an alist and loaded consecutively in memory.

The first initrd is placed at ramdisk_addr_r as before (if provided). Subsequent initrds use LMB allocation, letting the memory allocator find suitable placement rather than manually calculating offsets.

What’s Next

The current implementation reads a single entry file at loader/entry.conf. Full BLS support would scan loader/entries/*.conf for multiple entries, sort them by version and sort-key, and filter by architecture. These are natural next steps.

Devicetree overlay application is another gap—the devicetree-overlay field is parsed but not yet acted upon during boot.

The series deliberately omits support for Unified Kernel Images (UKIs), which combine kernel, initrd, and boot stub into a single UEFI PE file. U-Boot’s FIT format already serves this role and more—it bundles kernel, initrd, device trees, and configurations into one signed image, and works in both EFI and non-EFI environments. FIT is the more powerful and flexible format than what is essentially a repurposed PE file.

Getting Started~

Enable BLS support with CONFIG_BOOTMETH_BLS=y – the bootmeth is ordered after extlinux by default, so existing setups are unaffected. Create a loader/entry.conf on a boot partition and U-Boot will discover it during bootflow scan.

Full documentation is available.