1{ config, pkgs, configTxt }:
2
3let
4 cfg = config.boot.loader.raspberryPi;
5 isAarch64 = pkgs.stdenv.isAarch64;
6
7 uboot =
8 if cfg.version == 1 then
9 pkgs.ubootRaspberryPi
10 else if cfg.version == 2 then
11 pkgs.ubootRaspberryPi2
12 else
13 if isAarch64 then
14 pkgs.ubootRaspberryPi3_64bit
15 else
16 pkgs.ubootRaspberryPi3_32bit;
17
18 extlinuxConfBuilder =
19 import ../generic-extlinux-compatible/extlinux-conf-builder.nix {
20 inherit pkgs;
21 };
22in
23pkgs.substituteAll {
24 src = ./builder_uboot.sh;
25 isExecutable = true;
26 inherit (pkgs) bash;
27 path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
28 firmware = pkgs.raspberrypifw;
29 inherit uboot;
30 inherit configTxt;
31 inherit extlinuxConfBuilder;
32 version = cfg.version;
33}
34