Alpine Linux on arm install Part 2
Step 2: Get U-Boot
Overview
Build u-boot for the Orange Pi Zero using Nix's cross-compilation infrastructure.
Build u-boot with Nix
nix-build '<nixpkgs>' -A pkgsCross.aarch64-multiplatform.ubootOrangePiZero2
The resulting u-boot-sunxi-with-spl.bin will be in ./result/.
Notes from the NixOS U-Boot Wiki
Reference: https://wiki.nixos.org/wiki/U-Boot
Cross-compilation package sets
Nix provides cross-compilation package sets for ARM targets:
| Target Architecture | Package Set |
|---|---|
| AArch64 | aarch64-multiplatform |
| ARMv7l | armv7l-hf-multiplatform |
| ARMv6l | raspberryPi |
General command format
nix-build -A [pkgsCross.$cross_name.]$packageName
When building from an x86_64 host for an ARM board, use the pkgsCross prefix. On a native AArch64 system, the prefix can be omitted:
nix-build -A ubootOrangePiZero2Finding available u-boot packages
To find board-specific u-boot packages in nixpkgs, search for uboot in the package set:
nix-env -qaP -A nixpkgs.pkgsCross.aarch64-multiplatform | grep -i uboot
For board defconfigs and SD card write offsets, consult the official U-Boot documentation or board-specific pages, as the large variety of ecosystems makes a single guide impractical.
Comments