nixpkgs/nixos/modules/system/boot/loader/raspberrypi/builder_uboot.nix
Bastian Köcher 8bc970bbc7 raspberrypi-bootloader: Adds support for using uboot
Uboot is copied into `/boot` in the installation process.
The boot entries are created by calling the `generic-extlinux-compatible` builder.
2018-04-22 18:27:17 +03:00

34 lines
763 B
Nix

{ config, pkgs, configTxt }:
let
cfg = config.boot.loader.raspberryPi;
isAarch64 = pkgs.stdenv.isAarch64;
uboot =
if cfg.version == 1 then
pkgs.ubootRaspberryPi
else if cfg.version == 2 then
pkgs.ubootRaspberryPi2
else
if isAarch64 then
pkgs.ubootRaspberryPi3_64bit
else
pkgs.ubootRaspberryPi3_32bit;
extlinuxConfBuilder =
import ../generic-extlinux-compatible/extlinux-conf-builder.nix {
inherit pkgs;
};
in
pkgs.substituteAll {
src = ./builder_uboot.sh;
isExecutable = true;
inherit (pkgs) bash;
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
firmware = pkgs.raspberrypifw;
inherit uboot;
inherit configTxt;
inherit extlinuxConfBuilder;
version = cfg.version;
}