U-Boot: Difference between revisions

Rework example build
m Add a section about using U-Boot with NixOS
Line 59: Line 59:
</syntaxhighlight>
</syntaxhighlight>


=== Using U-Boot ===
=== Installing U-Boot ===
You will need to consult either the [https://docs.u-boot.org/ Official U-Boot documentation], or a board-specific page to find out how to use the produced output.
You will need to consult either the [https://docs.u-boot.org/ Official U-Boot documentation], or a board-specific page to find out how to use the produced output.


Line 68: Line 68:
* [[NixOS on ARM]]
* [[NixOS on ARM]]
* [[NixOS on RISCV/VisionFive 2|NixOS on RISCV]]
* [[NixOS on RISCV/VisionFive 2|NixOS on RISCV]]
== Using NixOS with U-Boot ==
{{Note|This section assumes U-Boot is installed already.}}
With U-Boot, NixOS currently still assumes use of [https://docs.u-boot.org/en/v2024.04/develop/distro.html U-Boot's Generic Distro Configuration Concept] as the mechanism for discoverable boot. The preferred scheme is ''extlinux-compatible''. This is how the kernel <code>Image</code>, <code>initrd</code>, dtb, and Kernel command-line arguments are provided with complete support for the lifecycles of generations.
Note that U-Boot is moving to [https://docs.u-boot.org/en/v2024.04/develop/bootstd.html ''U-Boot Standard Boot'']. How it affects the assumptions from NixOS is still not documented.
Booting through UEFI with U-Boot should work. Booting with UEFI is tentatively supported, with intent of being the only fully supported boot method in the future. See [[NixOS on ARM/UEFI]], which describes part of the drawbacks.
=== Quick overview about the Generic Distro Configuration support ===
U-Boot is scripted to scan all attached storage devices and partitions, and look for a file named <code>/extlinux/extlinux.conf</code> or <code>/boot/extlinux/extlinux.conf</code>. This will will be generated by NixOS when configured with {{Nixos:option|boot.loader.generic-extlinux-compatible.enable}}.
The partition also needs to '''have its "bootable" flag set'''. This is true for ''both MBR and GPT partitioning schemes''.


== Vendor U-Boot ==
== Vendor U-Boot ==