U-Boot: Difference between revisions

Rework example build
Pigs (talk | contribs)
m Add category booting
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''U-Boot''' is a common '''''platform firmware''''' implementation for embedded and embedded-like devices.
[https://www.u-boot.org/ U-Boot] is a common '''''platform firmware''''' implementation for embedded and embedded-like devices.


It may also be used as a bootloader, but with modern U-Boot, [[UEFI]] boot is generally possible too.
It may also be used as a bootloader, but with modern U-Boot, [[UEFI]] boot is generally possible too.
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 ==
The term ''vendor U-Boot'' means the provided pre-built U-Boot binaries and the source as well. It generally implies use of an older fork of U-Boot from a ''BSP'' (''Board Support Package'').
Vendor U-Boot may or may not work to boot and use NixOS.
Vendor U-Boot may or may not work to boot and use NixOS.


Line 92: Line 108:
* [https://source.denx.de/u-boot/u-boot Official U-Boot source repo]
* [https://source.denx.de/u-boot/u-boot Official U-Boot source repo]
* [https://docs.u-boot.org/ Official U-Boot documentation]
* [https://docs.u-boot.org/ Official U-Boot documentation]
[[Category:Booting]]