NixOS on ARM: Difference between revisions

imported>Mbrock
Add note about the cma kernel parameter
imported>Samueldr
m Adds pkgsCross invocation to build u-boot
Line 377: Line 377:


== Porting NixOS to new boards ==
== Porting NixOS to new boards ==
=== The easiest way ===
Using the cross-compiling architecture it is now possible to cross-compile u-boot from an x86_64 host. Here's a sample use.
<syntaxhighlight>
# Assuming you're in a recent nixpkgs checkout
$ nix-shell \
    -I "nixpkgs=$PWD" \
    -p 'let plat = pkgsCross.aarch64-multiplatform; in plat.buildUBoot{defconfig = "orangepi_zero_plus2_defconfig"; extraMeta.platforms = ["aarch64-linux"]; BL31 = "${plat.armTrustedFirmwareAllwinner}/bl31.bin"; filesToInstall = ["u-boot-sunxi-with-spl.bin"];}'
</syntaxhighlight>
This should build whatever is needed for, and then build u-boot for the desired defconfig, then open a shell with the build in <code>$buildInputs</code>. Do note that this particular invocation may need more changes than only the defconfig if built for other than allwinner boards.


=== The easy way ===
=== The easy way ===