On 26/10/2024 at 02:35, Vagrant Cascadian wrote:
https://source.denx.de/u-boot/u-boot/-/blob/3fbc657669591ca893613f14d42e07069b7d56cd/doc/develop/distro.rst?plain=1#L38-62 Distros simply need to install the boot configuration files (see next section) in an ext2/3/4 or FAT partition, mark the partition bootable (via the MBR bootable flag, or GPT legacy_bios_bootable attribute), and U-Boot (or any other bootloader) will find those boot files and execute them. This is conceptually identical to creating a grub2 configuration file on a desktop PC. Note that in the absence of any partition that is explicitly marked bootable, U-Boot falls back to searching the first valid partition of a disk for boot configuration files. Other bootloaders are recommended to do the same, since I believe that partition table bootable flags aren't so commonly used outside the realm of x86 PCs.
I understand from the above that if the first partition is the 16MiB reserved partition then the root/boot partition should have the "legacy BIOS bootable" (parted 'legacy_boot' flag) on GPT or the 'boot' flag on DOS/MBR.
Mixed feelings about leaving the first 16MB unpartitioned vs. specifying some partition for it that has some special flag set. Creating a partition and marking it with MBR boot or legacy_bios_boot might trip up u-boot if it does not contain the extlinux/boot.scr/efi stuff it is expecting.
Note that we are discussing the pros and cons of marking the reserved partition with the GPT "BIOS boot partition" type (parted 'bios_grub' flag), not the DOS/MBR "boot" flag nor GPT "legacy BIOS bootable" attribute (parted 'legacy_boot' flag). The "BIOS boot partition" type is designed to contain a "legacy" (non-EFI) boot loader such as GRUB-BIOS core image, which matches the use case pretty well. Do you have any information that it may interact with ARM boot process in any way ?
Leaving the first 16MB unpartitioned is not possible currently with automatic partitioning. A reserved partition must be created then deleted by the user or a preseeded command. One option could be to enforce that a new partition starts beyond the first 16MiB, but that does not sound trivial.