[Concept,00/13] bootstd: bls: Scan every partition; Ubuntu autoinstall via BLS

Message ID 20260507221507.505998-1-sjg@u-boot.org
Headers
Series bootstd: bls: Scan every partition; Ubuntu autoinstall via BLS |

Message

Simon Glass May 7, 2026, 10:14 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

The Boot Loader Specification places loader/entries/*.conf on the ESP or
XBOOTLDR partition, and bootmeth_bls relies on the iterator's BLS-target
carve-out to reach those even when not marked bootable. In practice,
however, distros that drive entries through kernel-install write to
whichever partition holds /boot, which on common Ubuntu/Debian layouts
is the ext4 rootfs. Two consequences follow today: efi-x86_app64
overrides bootcmd to "bootflow scan -lpb" so the scan reaches
non-BLS-target data partitions on hybrid ISOs, and the Ubuntu
autoinstall path writes BLS entries onto the ESP rather than the rootfs.

Patch 1 reverts the bootcmd override. Patch 2 sets BOOTMETHF_ANY_PART
on bootmeth_bls so the iterator hands it every partition, with a
partition-size filter so ext4 probes do not run on raw single-LBA slots
(e.g. ChromeOS kernel partitions).

Patch 3 honours --kernel in the grub-cfg parser. Patch 4 wires BLS into
future kernel updates: the autoinstall path writes BLS entries directly
to the ESP (kernel-install never works inside curtin's chroot anyway,
because /boot/efi is a plain directory there), while the interactive
path drops a first-boot systemd unit that runs kernel-install from the
real installed system. Entries land on the ESP for autoinstall so the
bootflow iterator's per-partition advance picks BLS up before the EFI
bootmeth chain-loads our own BOOTX64.EFI fallback into a loop.

Patches 5-11 cover further Ubuntu autoinstall script work: unattended
autoinstall mode (5), planting u-boot.efi on the target ESP (6), and a
small cleanup pass (7-11).

Patch 12 adds a new CI test, test_distro_ubuntu_iso_install, that runs
an unattended Ubuntu install through U-Boot + BLS under QEMU + OVMF and
verifies the installed system boots back into U-Boot. Patch 13 wires it
into the sjg-lab-slow gitlab-ci stage.

Docs in doc/usage/bls.rst, doc/develop/bootstd/bls.rst,
doc/develop/bootstd/overview.rst and doc/usage/os/ubuntu-live.rst are
updated to match. The end-to-end CI test passes (4m46 on sjg-lab-slow).


Simon Glass (13):
  Revert "configs: efi-x86_app64: Scan all partitions at autoboot"
  bootmeth: bls: Scan every partition for entries
  scripts: ubuntu: Honour --kernel in grub-cfg parser
  scripts: ubuntu: Wire BLS into future kernel updates
  scripts: ubuntu: Add unattended autoinstall mode
  scripts: ubuntu: Install U-Boot on target ESP
  scripts: ubuntu: Drop __future__ annotations import
  scripts: ubuntu: Refer readers to the noble release dir
  scripts: ubuntu: Use command.run() in hash_password()
  scripts: ubuntu: Lift BLS-setup magic strings
  scripts: ubuntu: Use Args:/Returns: docstrings throughout
  test/py: distro: Add test_distro_ubuntu_iso_install
  gitlab-ci: Add sjg-lab-slow stage and Ubuntu install job

 .gitlab-ci.yml                   |  37 +++
 boot/bootmeth_bls.c              |  24 +-
 configs/efi-x86_app64_defconfig  |   1 -
 doc/develop/bootstd/bls.rst      |  34 ++-
 doc/develop/bootstd/overview.rst |  11 +-
 doc/usage/bls.rst                |  46 +++-
 doc/usage/os/ubuntu-live.rst     | 195 +++++++++++----
 scripts/ubuntu-iso-to-uboot.py   | 415 +++++++++++++++++++++++++++++--
 test/py/tests/test_distro.py     |  53 ++++
 9 files changed, 730 insertions(+), 86 deletions(-)

---
base-commit: 6aab88b82cfb744689466b02c7a6a7bc663f2e90
branch: fsf